Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Issue 2602253002: Fixed WebglRenderingContextBase toImageData (Closed)

Created:
3 years, 11 months ago by xlai (Olivia)
Modified:
3 years, 11 months ago
CC:
chromium-reviews, blink-reviews, haraken
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704 Cr-Commit-Position: refs/heads/master@{#441511}

Patch Set 1 #

Patch Set 2 : expected image #

Patch Set 3 : fix #

Patch Set 4 : fix error #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -27 lines) Patch
M third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main.html View 1 2 3 2 chunks +35 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main-expected.html View 1 2 3 2 chunks +33 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker.html View 1 2 3 4 chunks +48 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker-expected.html View 1 2 3 2 chunks +32 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/DEPS View 1 chunk +1 line, -0 lines 2 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 2 chunks +34 lines, -12 lines 2 comments Download

Messages

Total messages: 19 (13 generated)
xlai (Olivia)
https://codereview.chromium.org/2602253002/diff/60001/third_party/WebKit/Source/modules/webgl/DEPS File third_party/WebKit/Source/modules/webgl/DEPS (right): https://codereview.chromium.org/2602253002/diff/60001/third_party/WebKit/Source/modules/webgl/DEPS#newcode4 third_party/WebKit/Source/modules/webgl/DEPS:4: "+skia/ext", I saw that "skia/ext" is allowed in https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/notifications/DEPS. ...
3 years, 11 months ago (2017-01-02 22:50:04 UTC) #8
Ken Russell (switch to Gerrit)
Very nice and good tests. Sorry for the delay reviewing this. LGTM https://codereview.chromium.org/2602253002/diff/60001/third_party/WebKit/Source/modules/webgl/DEPS File third_party/WebKit/Source/modules/webgl/DEPS ...
3 years, 11 months ago (2017-01-04 04:01:12 UTC) #11
Justin Novosad
lgtm
3 years, 11 months ago (2017-01-04 20:30:01 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2602253002/60001
3 years, 11 months ago (2017-01-04 21:41:18 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
3 years, 11 months ago (2017-01-04 23:37:59 UTC) #17
commit-bot: I haz the power
3 years, 11 months ago (2017-01-04 23:41:30 UTC) #19
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704
Cr-Commit-Position: refs/heads/master@{#441511}

Powered by Google App Engine
This is Rietveld 408576698