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

Issue 1307143005: Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed)

Created:
5 years, 3 months ago by Justin Novosad
Modified:
5 years, 2 months ago
CC:
blink-reviews, krit, blink-reviews-html_chromium.org, drott+blinkwatch_chromium.org, mlamouri+watch-blink_chromium.org, blink-reviews-css, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, danakj, feature-media-reviews_chromium.org, dglazkov+blink, Rik, apavlov+blink_chromium.org, eric.carlson_apple.com, darktears, f(malita), Stephen Chennney, philipj_slow, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make 2D canvas smarter about chosing whether or not to use GPU acceleration The CL takes advantage of the fact that canvas rendering is deferred to defer the decision of whether or not a canvas should be GPU-accelerated. The decision is made based on the conditions under which a canvas is flushed for the first time. For example, if the purpose of the first flush is to perform a readback, then GPU-acceleration will be disabled for the canvas in order to avoid reading GPU memory into RAM, which is known to be a slow path. BUG=265849

Patch Set 1 #

Patch Set 2 : fixing some logic #

Total comments: 3

Patch Set 3 : fixes #

Patch Set 4 : rebase #

Total comments: 1

Patch Set 5 : rebase #

Patch Set 6 : added unit test for sw fallback #

Total comments: 1

Patch Set 7 : Added unit test for texture alloc failure #

Patch Set 8 : migrated to chromium repo #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -133 lines) Patch
M third_party/WebKit/Source/core/css/CSSCanvasValue.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 chunks +14 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 2 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasImageSource.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 3 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h View 1 2 3 4 5 6 7 5 chunks +15 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp View 1 2 3 4 5 6 7 19 chunks +122 lines, -54 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 5 6 7 10 chunks +131 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsTypes.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 7 4 chunks +16 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 39 (15 generated)
Justin Novosad
PTAL. This one can wait for senorblanco to return from vacation.
5 years, 3 months ago (2015-09-09 18:31:23 UTC) #2
Justin Novosad
senorblanco ping.
5 years, 3 months ago (2015-09-15 16:27:42 UTC) #3
Stephen White
Great to see this functionality get implemented. https://codereview.chromium.org/1307143005/diff/20001/Source/platform/graphics/Canvas2DLayerBridge.cpp File Source/platform/graphics/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/1307143005/diff/20001/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode187 Source/platform/graphics/Canvas2DLayerBridge.cpp:187: m_surface = ...
5 years, 3 months ago (2015-09-15 20:43:58 UTC) #4
Justin Novosad
done.
5 years, 3 months ago (2015-09-16 15:39:43 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307143005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307143005/40001
5 years, 3 months ago (2015-09-16 15:43:43 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/69974) ios_rel_device_ninja on ...
5 years, 3 months ago (2015-09-16 15:45:02 UTC) #9
Justin Novosad
Did a rebase
5 years, 3 months ago (2015-09-16 17:47:57 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307143005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307143005/60001
5 years, 3 months ago (2015-09-16 17:48:10 UTC) #12
Stephen White
https://codereview.chromium.org/1307143005/diff/60001/Source/platform/graphics/Canvas2DLayerBridge.cpp File Source/platform/graphics/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/1307143005/diff/60001/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode72 Source/platform/graphics/Canvas2DLayerBridge.cpp:72: if (!surface) IWBN if we had a test for ...
5 years, 3 months ago (2015-09-16 18:19:33 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/104836)
5 years, 3 months ago (2015-09-16 18:54:35 UTC) #15
Justin Novosad
On 2015/09/16 18:19:33, Stephen White wrote: > Source/platform/graphics/Canvas2DLayerBridge.cpp:72: if (!surface) > IWBN if we had ...
5 years, 3 months ago (2015-09-22 19:12:33 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307143005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307143005/100001
5 years, 3 months ago (2015-09-22 19:13:19 UTC) #20
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/106314)
5 years, 3 months ago (2015-09-22 20:09:06 UTC) #22
Stephen White
LGTM https://codereview.chromium.org/1307143005/diff/100001/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp File Source/platform/graphics/Canvas2DLayerBridgeTest.cpp (right): https://codereview.chromium.org/1307143005/diff/100001/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp#newcode141 Source/platform/graphics/Canvas2DLayerBridgeTest.cpp:141: mainMock.fakeContextLost(); I was actually hoping that we could ...
5 years, 3 months ago (2015-09-23 14:13:26 UTC) #23
Justin Novosad
On 2015/09/23 14:13:26, Stephen White wrote: > LGTM > > https://codereview.chromium.org/1307143005/diff/100001/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp > File Source/platform/graphics/Canvas2DLayerBridgeTest.cpp (right): ...
5 years, 3 months ago (2015-09-23 14:19:39 UTC) #24
Justin Novosad
On 2015/09/23 14:19:39, Justin Novosad wrote: > On 2015/09/23 14:13:26, Stephen White wrote: > > ...
5 years, 3 months ago (2015-09-23 14:22:52 UTC) #25
Justin Novosad
New patch. Added unit test to cover texture allocation failure. Turns out the test found ...
5 years, 3 months ago (2015-09-23 18:47:52 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307143005/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307143005/120001
5 years, 3 months ago (2015-09-23 18:48:43 UTC) #28
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/106777) linux_chromium_clobber_rel_ng on ...
5 years, 3 months ago (2015-09-23 18:49:16 UTC) #30
Justin Novosad
+kbr for modules/webgl approval
5 years, 3 months ago (2015-09-23 20:05:34 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307143005/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307143005/140001
5 years, 3 months ago (2015-09-23 20:07:43 UTC) #34
Ken Russell (switch to Gerrit)
modules/webgl/ LGTM I think you should close this CL and open a new one. The ...
5 years, 3 months ago (2015-09-23 20:31:14 UTC) #35
Noel Gordon
https://codereview.chromium.org/1307143005/diff/140001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (left): https://codereview.chromium.org/1307143005/diff/140001/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#oldcode591 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:591: { Seems like a layering violation?
5 years, 2 months ago (2015-09-28 06:47:18 UTC) #38
Justin Novosad
5 years, 2 months ago (2015-09-28 17:12:30 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/1307143005/diff/140001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (left):

https://codereview.chromium.org/1307143005/diff/140001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLImageElement.cpp:591: {
On 2015/09/28 06:47:18, noel gordon wrote:
> Seems like a layering violation?

How do you mean? core depends on platform.

Powered by Google App Engine
This is Rietveld 408576698