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

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)

Created:
4 years ago by xlai (Olivia)
Modified:
4 years ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, yzshen+watch_chromium.org, Stephen Chennney, rwlbuis, darin (slow to review), krit, drott+blinkwatch_chromium.org, blink-reviews-html_chromium.org, jam, abarth-chromium, dglazkov+blink, Rik, darin-cc_chromium.org, blink-reviews, blink-reviews-bindings_chromium.org, ajuma+watch_chromium.org, blink-reviews-api_chromium.org, jbroman, pdr+graphicswatchlist_chromium.org, jbroman+watch_chromium.org, danakj+watch_chromium.org, ajuma+watch-canvas_chromium.org, Aaron Boodman, f(malita), cc-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revamp OffscreenCanvas commit flow This patch aims to simplify the existing work flow of OffscreenCanvas commit() and help OffscreenCanvas transition to the new Display Compositor architecture. This facilitates the next step of adding resizing functionality of OffscreenCanvas. Major changes: 1. OffscreenCanvas now use SurfaceIdAllocator in the renderer/worker, instead of being in the browser. This is consistent with the new display compositor architecture. 2. SurfaceLayer for HTMLCanvasElement is only created when Surface is created in the browser; before that, a dummy SolidColorLayer is put as a placeholder. 3. CanvasSurfaceLayerBridge becomes the client of OffscreenCanvasSurfaceImpl, so that it can receive IPC messages from browser. 4. FrameSinkId is now generated in renderer/main by CanvasSurfaceLayerBridge, which remains unchanged throughout the lifecycle of canvas; LocalFrameId is generated in renderer/worker by OffscreenCanvasFrameDispatcher. At this time it is only generated once, but will be generated repeatedly when resizing functionality is added in the future patches. What is being simplified: 1. Sync IPC GetSurfaceId is removed, reducing overhead in HTMLCanvasElement. transferControlToOffscreen() API call. 2. When OffscreenCanvas is transferred from main thread to worker thread, there are now only 2 integers that need to be copied, which constitute the FrameSinkId. Before this, there were 5 integers that need to be copied. As a result, there are a lot less attributes that need to be kept by OffscreenCanvas and CanvasSurfaceLayerBridge. TBR=avi@chromium.org BUG=664547, 619138, 662498 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Committed: https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef Cr-Commit-Position: refs/heads/master@{#439356}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Furnish #

Total comments: 13

Patch Set 3 : rebase #

Total comments: 2

Patch Set 4 : fix based on fsamuel feedback #

Total comments: 4

Patch Set 5 : fix based on more feedback #

Patch Set 6 : more fix #

Total comments: 4

Patch Set 7 : rebase #

Patch Set 8 : fix #

Patch Set 9 : fix analyze #

Patch Set 10 : fix #

Patch Set 11 : rebase and fix conflict #

Unified diffs Side-by-side diffs Delta from patch set Stats (+298 lines, -301 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.cc View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
A content/browser/renderer_host/offscreen_canvas_surface_factory_impl.h View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
A content/browser/renderer_host/offscreen_canvas_surface_factory_impl.cc View 1 2 3 1 chunk +28 lines, -0 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_surface_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +18 lines, -4 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_surface_impl.cc View 1 2 3 2 chunks +28 lines, -28 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_surface_manager.h View 1 chunk +1 line, -4 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_surface_manager.cc View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/offscreen_canvas_surface_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +25 lines, -35 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/app/mojo/content_browser_manifest.json View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h View 2 chunks +1 line, -7 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp View 5 chunks +5 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp View 1 chunk +3 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 3 chunks +13 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 2 chunks +8 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h View 1 2 2 chunks +2 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp View 2 chunks +3 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +31 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +51 lines, -15 lines 0 comments Download
D third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp View 1 chunk +0 lines, -81 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h View 1 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -8 lines 0 comments Download
M third_party/WebKit/public/blink_typemaps.gni View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom View 1 2 3 4 1 chunk +17 lines, -7 lines 0 comments Download

Messages

Total messages: 49 (31 generated)
xlai (Olivia)
PTAL. Thanks! https://codereview.chromium.org/2584643002/diff/1/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp (left): https://codereview.chromium.org/2584643002/diff/1/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp#oldcode77 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp:77: bool success = this->surfaceLayerBridge()->createSurfaceLayer(50, 50); This unit ...
4 years ago (2016-12-15 19:14:36 UTC) #4
Fady Samuel
A few comments but this is looking great so far! Thanks! :D https://codereview.chromium.org/2584643002/diff/20001/content/browser/renderer_host/offscreen_canvas_surface_manager.cc File content/browser/renderer_host/offscreen_canvas_surface_manager.cc ...
4 years ago (2016-12-15 19:54:52 UTC) #5
Justin Novosad
This looks great! https://codereview.chromium.org/2584643002/diff/40001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h (right): https://codereview.chromium.org/2584643002/diff/40001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h#newcode54 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h:54: scoped_refptr<cc::SolidColorLayer> m_solidColorLayer; It would be cleaner ...
4 years ago (2016-12-15 22:19:35 UTC) #6
xlai (Olivia)
https://codereview.chromium.org/2584643002/diff/20001/content/browser/renderer_host/offscreen_canvas_surface_manager.cc File content/browser/renderer_host/offscreen_canvas_surface_manager.cc (right): https://codereview.chromium.org/2584643002/diff/20001/content/browser/renderer_host/offscreen_canvas_surface_manager.cc#newcode36 content/browser/renderer_host/offscreen_canvas_surface_manager.cc:36: if (surface_iter == registered_surface_instances_.end()) { On 2016/12/15 19:54:52, Fady ...
4 years ago (2016-12-15 22:20:12 UTC) #7
Fady Samuel
https://codereview.chromium.org/2584643002/diff/20001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp (right): https://codereview.chromium.org/2584643002/diff/20001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp#newcode65 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp:65: m_webLayer = On 2016/12/15 22:20:12, xlai (Olivia) wrote: > ...
4 years ago (2016-12-15 22:26:01 UTC) #8
Fady Samuel
https://codereview.chromium.org/2584643002/diff/60001/third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom File third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom (left): https://codereview.chromium.org/2584643002/diff/60001/third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom#oldcode24 third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom:24: CreateCompositorFrameSink(cc.mojom.SurfaceId surface_id, This should only take in a FrameSinkId
4 years ago (2016-12-15 22:28:12 UTC) #9
xlai (Olivia)
https://codereview.chromium.org/2584643002/diff/40001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h (right): https://codereview.chromium.org/2584643002/diff/40001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h#newcode54 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h:54: scoped_refptr<cc::SolidColorLayer> m_solidColorLayer; On 2016/12/15 22:19:35, Justin Novosad wrote: > ...
4 years ago (2016-12-15 22:46:28 UTC) #10
Fady Samuel
LGTM + nit https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp (right): https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp#newcode67 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp:67: surfaceLayer->SetSurfaceId(m_currentSurfaceId, deviceScaleFactor, nit: TODO(xlai): Update this ...
4 years ago (2016-12-15 22:55:51 UTC) #11
Justin Novosad
lgtm
4 years ago (2016-12-15 23:05:20 UTC) #12
xlai (Olivia)
Adding more reviewers. kenrb@: Please review offscreen_canvas_surface.mojom haraken@: Please review ScriptValueSerializer/Deserializer and third_party/WebKit/public/ jbauman@: Please ...
4 years ago (2016-12-16 01:37:50 UTC) #16
haraken
bindings/ LGTM
4 years ago (2016-12-16 01:42:19 UTC) #17
jbauman
lgtm https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp (right): https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp#newcode51 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp:51: int32_t width, I guess this could still glitch ...
4 years ago (2016-12-16 02:19:26 UTC) #18
kenrb
mojo lgtm
4 years ago (2016-12-16 18:35:51 UTC) #19
xlai (Olivia)
https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp (right): https://codereview.chromium.org/2584643002/diff/100001/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp#newcode51 third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp:51: int32_t width, On 2016/12/16 02:19:26, jbauman wrote: > I ...
4 years ago (2016-12-16 21:34:06 UTC) #20
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/2584643002/200001
4 years ago (2016-12-17 22:51:04 UTC) #40
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/2584643002/200001
4 years ago (2016-12-17 22:53:05 UTC) #44
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years ago (2016-12-17 22:57:06 UTC) #47
commit-bot: I haz the power
4 years ago (2016-12-17 22:59:10 UTC) #49
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef
Cr-Commit-Position: refs/heads/master@{#439356}

Powered by Google App Engine
This is Rietveld 408576698