Add optimized path for YUV-to-WebGL, remove old path

For camera-to-WebGL on Nexus 6P at 720p, this improves blocking
texImage2D time from ~12ms to ~4ms (200% speedup). On some other
devices and resolutions, I think there can be up to a ~10x speedup.

* Adds an optimized upload path for CPU-side YUV video frames (e.g.
  those coming from a video camera on Android). This path uploads the
  individual Y/U/V textures to the GPU, performs a GPU YUV-RGB decode,
  and copies the result into the WebGL texture.

  This code path could potentially be further optimized in 2 ways:
    * Avoid the extra copy of the CPU-side YUV data from
      browser-renderer shared memory (VideoFrame::STORAGE_SHMEM) to
      renderer-gpu shared memory (transfer buffer, probably).
    * Avoid the extra copy from the decoded image (SkImage) into the
      WebGL texture, and instead decode directly into the WebGL texture.

* Removes an old GPU-GPU path that was obsoleted by
  CopyVideoTextureToPlatformTexture. This obsolete path was only
  handling CPU-GPU uploads instead of GPU-GPU uploads, and it was doing
  so by performing an expensive YUV-RGB conversion on the CPU.

  This also allowed some cleanup in TexImageHelperHTMLVideoElement.

Bug: 867368
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Id25d5dbfc76ec8f9dc606890588a20978f6943f6
Reviewed-on: https://chromium-review.googlesource.com/1161606
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585322}
8 files changed