New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 613409 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 610759



Sign in to add a comment

StaticBitmapImage should keep pointer to GrContext which comes from transferToImageBitmap

Project Member Reported by xidac...@chromium.org, May 20 2016

Issue description

When transferToImageBitmap happens, the created ImageBitmap only keeps a mailbox which contains the texture info. It should keep track of the GrContext that comes from the original drawing buffer. We should use that GrContext when this ImageBitmap is consumed later. Also, when this ImageBitmap is transferred, we need to re-mailbox the texture.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c44bccbcfded3d5906dc0fa79c9b0e810369b36c

commit c44bccbcfded3d5906dc0fa79c9b0e810369b36c
Author: xidachen <xidachen@chromium.org>
Date: Fri May 27 19:12:38 2016

Avoid copy pixel data in texImage2D(ImageBitmap)

This is the first patch in order to avoid reading back GPU texture.
Currently in texImage2D(ImageBitmap), it makes a copy of the pixel data
stored inside the ImageBitmap (copyBitmapData). We should avoid that.
To solve that, we use SkImage's peekPixels() API. peekPixels() returns
true only when the ImageBitmap is stored in the CPU-side RAM. In the
case when an ImageBitmap is texture backed, this approach will not work.

I will have a follow up patch right after this, to handles the case where
an ImageBitmap is texture backed.

BUG= 613411 ,  613409 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2016043002
Cr-Commit-Position: refs/heads/master@{#396529}

[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
[modify] https://crrev.com/c44bccbcfded3d5906dc0fa79c9b0e810369b36c/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.h

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef

commit 0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef
Author: xidachen <xidachen@chromium.org>
Date: Fri Jun 24 17:55:27 2016

Avoid GPU readback in tex(Sub)Image2D(ImageBitmap)

At this moment, if an ImageBitmap is texture backed, texImage2D will do
a GPU read back which is expensive. The solution is to prepare a mailbox
for the ImageBitmap, and use the WebGL context to consume it and then do
a GPU-GPU texture copy.

BUG= 613411 ,  613409 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2026803002
Cr-Commit-Position: refs/heads/master@{#401903}

[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/frame/ImageBitmap.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/html/HTMLImageElement.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/html/HTMLVideoElement.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/core/html/canvas/CanvasImageSource.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DUsageTrackingTest.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
[modify] https://crrev.com/0bed6ac0177c01b7aa2719ecbb5f80143ccaa4ef/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h

Status: Fixed (was: Assigned)

Sign in to add a comment