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

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed)

Created:
6 years, 5 months ago by Justin Novosad
Modified:
6 years, 5 months ago
CC:
abarth-chromium, blink-reviews, blink-reviews-html_chromium.org, Rik, danakj, dglazkov+blink, krit, jbroman, pdr., rwlbuis, Stephen Chennney
Project:
blink
Visibility:
Public.

Description

Initial implementation of display list backed 2D canvases This change adds a new type of ImageBufferSurface that is backed by an SkPicture. Instead of rasterizing the canvas on the main thread, the contents of the SkPicture are fed into the SkPicture of the containing layer, thus allowing the content to be rasterized by the compositor. There are cases that break this rendering model, for example when a readback is performed on the canvas (e.g. call to getImageData) When that happens, the canvas backing falls back to being rasterized on the main thread. This feature is currently disabled by default and controlled through web settings. A follow-up chromium patch will expose the feature as an experiment that can be enable in chrome://flags or at the command line. BUG=386601 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178585

Patch Set 1 #

Patch Set 2 : compile error fix #

Total comments: 23

Patch Set 3 : applied review comments #

Total comments: 10

Patch Set 4 : corrections applied #

Patch Set 5 : will it blend #

Total comments: 2

Patch Set 6 : tiny fix #

Total comments: 2

Patch Set 7 : use WebRuntimeFeatures #

Total comments: 4

Patch Set 8 : Applied corrections suggested by p.sergey #

Patch Set 9 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -5 lines) Patch
M Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 6 7 8 2 chunks +23 lines, -0 lines 0 comments Download
M Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -1 line 0 comments Download
M Source/platform/graphics/ImageBufferSurface.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -2 lines 0 comments Download
M Source/platform/graphics/ImageBufferSurface.cpp View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -1 line 0 comments Download
A Source/platform/graphics/RecordingImageBufferSurface.h View 1 2 3 4 5 6 7 1 chunk +47 lines, -0 lines 0 comments Download
A Source/platform/graphics/RecordingImageBufferSurface.cpp View 1 2 3 4 5 1 chunk +134 lines, -0 lines 0 comments Download
M Source/platform/graphics/gpu/WebGLImageBufferSurface.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/skia/OpaqueRegionSkia.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/platform/graphics/skia/OpaqueRegionSkia.cpp View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M Source/web/WebRuntimeFeatures.cpp View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M public/web/WebRuntimeFeatures.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Justin Novosad
Please take a look
6 years, 5 months ago (2014-07-09 18:14:36 UTC) #1
Stephen White
This looks really great. Clean and comprehensible. https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/GraphicsContext.h#newcode99 Source/platform/graphics/GraphicsContext.h:99: void resetCanvas(SkCanvas* ...
6 years, 5 months ago (2014-07-09 20:04:08 UTC) #2
dshwang
wow, you initiated threaded canvas 2d. I will ask some questions in the tracking issue. ...
6 years, 5 months ago (2014-07-10 13:01:52 UTC) #3
Justin Novosad
New Patch https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/GraphicsContext.h#newcode99 Source/platform/graphics/GraphicsContext.h:99: void resetCanvas(SkCanvas* canvas) On 2014/07/09 20:04:07, Stephen ...
6 years, 5 months ago (2014-07-11 21:16:08 UTC) #4
dshwang
This looks really great. Few nits. https://codereview.chromium.org/379253002/diff/40001/Source/platform/graphics/GraphicsContext.cpp File Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/379253002/diff/40001/Source/platform/graphics/GraphicsContext.cpp#newcode162 Source/platform/graphics/GraphicsContext.cpp:162: m_opaqueRegion.reset(); Don't we ...
6 years, 5 months ago (2014-07-14 11:45:40 UTC) #5
Stephen White
https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/ImageBufferSurface.h File Source/platform/graphics/ImageBufferSurface.h (right): https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/ImageBufferSurface.h#newcode76 Source/platform/graphics/ImageBufferSurface.h:76: virtual PassRefPtr<SkPicture> getPicture(); On 2014/07/11 21:16:07, junov wrote: > ...
6 years, 5 months ago (2014-07-14 15:19:16 UTC) #6
Justin Novosad
New Patch. +jamesr for Source/web and public/web https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/RecordingImageBufferSurface.h File Source/platform/graphics/RecordingImageBufferSurface.h (right): https://codereview.chromium.org/379253002/diff/20001/Source/platform/graphics/RecordingImageBufferSurface.h#newcode57 Source/platform/graphics/RecordingImageBufferSurface.h:57: void fallbackToRasterCanvas(); ...
6 years, 5 months ago (2014-07-17 18:34:14 UTC) #7
Stephen White
LGTM with nit https://codereview.chromium.org/379253002/diff/80001/Source/platform/graphics/RecordingImageBufferSurface.cpp File Source/platform/graphics/RecordingImageBufferSurface.cpp (right): https://codereview.chromium.org/379253002/diff/80001/Source/platform/graphics/RecordingImageBufferSurface.cpp#newcode44 Source/platform/graphics/RecordingImageBufferSurface.cpp:44: m_graphicsContext->setTrackOpaqueRegion(true); Either the ": 0" clause ...
6 years, 5 months ago (2014-07-17 18:55:48 UTC) #8
Justin Novosad
Thanks. Still need approval for Source/web and public/web https://codereview.chromium.org/379253002/diff/80001/Source/platform/graphics/RecordingImageBufferSurface.cpp File Source/platform/graphics/RecordingImageBufferSurface.cpp (right): https://codereview.chromium.org/379253002/diff/80001/Source/platform/graphics/RecordingImageBufferSurface.cpp#newcode44 Source/platform/graphics/RecordingImageBufferSurface.cpp:44: m_graphicsContext->setTrackOpaqueRegion(true); ...
6 years, 5 months ago (2014-07-17 19:19:10 UTC) #9
jamesr
WebSettings are per-WebView. Can this value really be different for different WebViews in the same ...
6 years, 5 months ago (2014-07-17 20:04:39 UTC) #10
Justin Novosad
On 2014/07/17 20:04:39, jamesr wrote: > WebSettings are per-WebView. Can this value really be different ...
6 years, 5 months ago (2014-07-17 20:32:07 UTC) #11
jamesr
On 2014/07/17 20:32:07, junov wrote: > On 2014/07/17 20:04:39, jamesr wrote: > > WebSettings are ...
6 years, 5 months ago (2014-07-17 20:37:39 UTC) #12
Justin Novosad
On 2014/07/17 20:37:39, jamesr wrote: > Should they? Great question. Announcing project GTFOOWS :-P
6 years, 5 months ago (2014-07-17 20:41:12 UTC) #13
Justin Novosad
It's done. It is now a RuntimeEnabledFeature.
6 years, 5 months ago (2014-07-18 18:29:10 UTC) #14
Sergey
Hello. I really admire the overall idea, but it seems that this patch as is ...
6 years, 5 months ago (2014-07-19 10:52:21 UTC) #15
Sergey
A couple of questions to improve my understanding of blink source code common practices and ...
6 years, 5 months ago (2014-07-21 04:57:11 UTC) #16
Justin Novosad
On 2014/07/19 10:52:21, Sergey wrote: > Hello. > > I really admire the overall idea, ...
6 years, 5 months ago (2014-07-21 16:58:30 UTC) #17
Justin Novosad
https://codereview.chromium.org/379253002/diff/100001/Source/platform/graphics/ImageBufferSurface.cpp File Source/platform/graphics/ImageBufferSurface.cpp (left): https://codereview.chromium.org/379253002/diff/100001/Source/platform/graphics/ImageBufferSurface.cpp#oldcode63 Source/platform/graphics/ImageBufferSurface.cpp:63: ASSERT(canvas()); On 2014/07/21 04:57:10, Sergey wrote: > This is ...
6 years, 5 months ago (2014-07-21 17:26:46 UTC) #18
Justin Novosad
jamesr: Ping. Code was changed to use WebRuntimeFeatures.
6 years, 5 months ago (2014-07-21 18:26:08 UTC) #19
jamesr
/web/ lgtm
6 years, 5 months ago (2014-07-21 19:26:22 UTC) #20
Justin Novosad
The CQ bit was checked by junov@chromium.org
6 years, 5 months ago (2014-07-21 19:28:49 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/379253002/160001
6 years, 5 months ago (2014-07-21 19:29:38 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 5 months ago (2014-07-21 20:17:35 UTC) #23
commit-bot: I haz the power
6 years, 5 months ago (2014-07-21 20:52:51 UTC) #24
Message was sent while issue was closed.
Change committed as 178585

Powered by Google App Engine
This is Rietveld 408576698