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

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

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

Description

Reland: 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 complaint, we may inhibit the switch based on what kind of content was rendered to the canvas. BUG=606688 Committed: https://crrev.com/627ddfd0de197d67567a15191f654b8835408bce Cr-Commit-Position: refs/heads/master@{#403806}

Patch Set 1 #

Total comments: 4

Patch Set 2 : include error fix #

Patch Set 3 : applied review comments #

Patch Set 4 : fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -46 lines) Patch
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 4 chunks +38 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h View 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h View 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp View 1 2 3 7 chunks +39 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp View 1 4 chunks +1 line, -38 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 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp View 3 chunks +14 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBufferClient.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h View 1 chunk +47 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
Justin Novosad
PTAL. Only Canvas2DLayerBridge has changed since previous version of this patch.
4 years, 5 months ago (2016-07-05 14:25:33 UTC) #2
xidachen
Looks like you need to rebase? https://codereview.chromium.org/2123623002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/2123623002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode501 third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp:501: if (isAccelerated() && ...
4 years, 5 months ago (2016-07-05 15:32:14 UTC) #3
Justin Novosad
Done.
4 years, 5 months ago (2016-07-05 15:43:10 UTC) #4
xidachen
lgtm
4 years, 5 months ago (2016-07-05 15:45:39 UTC) #5
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/2123623002/60001
4 years, 5 months ago (2016-07-05 16:59:01 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-07-05 18:28:19 UTC) #9
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-05 18:28:25 UTC) #10
commit-bot: I haz the power
4 years, 5 months ago (2016-07-05 18:30:09 UTC) #12
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/627ddfd0de197d67567a15191f654b8835408bce
Cr-Commit-Position: refs/heads/master@{#403806}

Powered by Google App Engine
This is Rietveld 408576698