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

Issue 2063473002: Make 2D canvas disable gpu acceleration when getImageData is called (Closed)

Created:
4 years, 6 months ago by Justin Novosad
Modified:
4 years, 6 months ago
Reviewers:
xidachen, xlai (Olivia)
CC:
chromium-reviews, krit, pdr+graphicswatchlist_chromium.org, drott+blinkwatch_chromium.org, ajuma+watch-canvas_chromium.org, dshwang, jbroman, blink-reviews-platform-graphics_chromium.org, Rik, f(malita), blink-reviews, Stephen Chennney, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis, sebastienlc
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make 2D canvas disable gpu acceleration when getImageData is called In order to optimize performance, GPU-accelerated canvases should permanently switch out of accalerated mode as soon as getImageData is called. The cost of getImageData on the GPU is so prohibitively high that it almost always outways the benefit of acceleration. This is the first time we implement a SW/GPU switch that can happen after the first frame was presented, which may result in a small one time glitch due to rendering engine discrepancies. Let's see if we get any complaints about this. If there are complaints, we may inhibit the switch based on what kind of content was rendered to the canvas. BUG=606688 Committed: https://crrev.com/33732aec33c88cb18c212544da7d0a4ba53cd9ce Cr-Commit-Position: refs/heads/master@{#401751}

Patch Set 1 #

Total comments: 2

Patch Set 2 : fixed bugs #

Patch Set 3 : bug fixes #

Patch Set 4 : included missing file #

Total comments: 2

Patch Set 5 : unit test build fix #

Total comments: 2

Patch Set 6 : address comments and fix test failures #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -43 lines) Patch
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 1 2 3 4 5 4 chunks +38 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h View 1 2 3 4 5 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp View 1 2 3 1 chunk +30 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 chunks +1 line, -40 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsTypes.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 3 chunks +14 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBufferClient.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h View 1 2 3 1 chunk +47 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Justin Novosad
PTAL
4 years, 6 months ago (2016-06-10 21:49:38 UTC) #2
xidachen
https://codereview.chromium.org/2063473002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/2063473002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode483 third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp:483: } By looking at the test results failure, it ...
4 years, 6 months ago (2016-06-15 14:12:36 UTC) #3
xlai (Olivia)
I have two high-level comments: 1. Should you update GPU memory usage when you do ...
4 years, 6 months ago (2016-06-15 17:54:47 UTC) #4
Justin Novosad
On 2016/06/15 14:12:36, xidachen wrote: > https://codereview.chromium.org/2063473002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp > File third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp > (right): > > https://codereview.chromium.org/2063473002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode483 ...
4 years, 6 months ago (2016-06-16 18:52:08 UTC) #5
Justin Novosad
On 2016/06/15 17:54:47, xlai (Olivia) wrote: > I have two high-level comments: > 1. Should ...
4 years, 6 months ago (2016-06-17 14:25:50 UTC) #6
Justin Novosad
New Patch
4 years, 6 months ago (2016-06-23 18:33:02 UTC) #7
xlai (Olivia)
lgtm with nits https://codereview.chromium.org/2063473002/diff/60001/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h File third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h (right): https://codereview.chromium.org/2063473002/diff/60001/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h#newcode50 third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h:50: : ImageBufferSurface(size, opacityMode) I think you ...
4 years, 6 months ago (2016-06-23 19:55:02 UTC) #8
Justin Novosad
https://codereview.chromium.org/2063473002/diff/60001/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h File third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h (right): https://codereview.chromium.org/2063473002/diff/60001/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h#newcode50 third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h:50: : ImageBufferSurface(size, opacityMode) On 2016/06/23 19:55:02, xlai (Olivia) wrote: ...
4 years, 6 months ago (2016-06-23 21:02:09 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2063473002/100001
4 years, 6 months ago (2016-06-23 21:02:49 UTC) #12
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 6 months ago (2016-06-23 23:20:26 UTC) #13
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/33732aec33c88cb18c212544da7d0a4ba53cd9ce Cr-Commit-Position: refs/heads/master@{#401751}
4 years, 6 months ago (2016-06-23 23:22:19 UTC) #15
sunnyps
4 years, 5 months ago (2016-06-28 00:02:18 UTC) #16
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/2101823002/ by sunnyps@chromium.org.

The reason for reverting is: Causing crash in mailbox release callback - bug
623101.

Powered by Google App Engine
This is Rietveld 408576698