Complete OffscreenCanvas webgl toImageData for convertToBlob() |
|||||
Issue descriptionComplete the rest of the implementation of toImageData() for OffscreenCanvas webgl rendering context. In particular, currently the jpeg and webp image cannot be rendered.
,
Oct 20 2016
I could be wrong, but I thought this part of code: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp?sq=package:chromium&rcl=1476847656&l=651 does the implementation for WebGL's toImageData?
,
Oct 20 2016
Oh, this is actually part of the code in my CL https://codereview.chromium.org/2420203002/. I implemented toImageData for both webgl and 2d for OffscreenCanvas. But the part for webgl only works for PNG image type. So I put a TODO there with a bug to mark it.
,
Oct 20 2016
,
Oct 20 2016
,
Jan 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7922f33fe97e510c7259ebc077bd04ea2657e704 commit 7922f33fe97e510c7259ebc077bd04ea2657e704 Author: xlai <xlai@chromium.org> Date: Wed Jan 04 23:37:21 2017 Fixed WebglRenderingContextBase toImageData Previously, WebglRenderingContextBase::toImageData(), which is used by convertToBlob, wrongly used DrawingBuffer::transferToStaticBitmapImage() to obtain the image data. This results in black image when toImageData() is called back-to-back, because transferToStaticBitmapImage() discards the backbuffer when preserveDrawingBuffer (a user-set flag) is false. The new implementation in this patch follows what HTMLCanvasElement::toImageData do; but it removes all unnecessary steps in HTMLCanvasElement that deals with ImageBuffer(Surface) and other extra steps that do not apply to OffscreenCanvas, and also handles the additional situation when toImageData can be called on worker thread. BUG= 657531 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2602253002 Cr-Commit-Position: refs/heads/master@{#441511} [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main-expected.html [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main.html [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker-expected.html [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker.html [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/DEPS [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp [modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
,
Jan 5 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by xlai@chromium.org
, Oct 19 2016