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

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed)

Created:
7 years ago by Justin Novosad
Modified:
7 years ago
CC:
blink-reviews, shans, eae+blinkwatch, adamk+blink_chromium.org, pdr, Steve Block, dino_apple.com, rwlbuis, jamesr, krit, alancutter (OOO until 2018), bemjb+rendering_chromium.org, dsinclair, dglazkov+blink, danakj, dstockwell, Timothy Loh, Rik, jchaffraix+rendering, aandrey+blink_chromium.org, pdr., Eric Willigers, rjwright, zoltan1, philipj_slow, feature-media-reviews_chromium.org, darktears, leviw+renderwatch, blink-layers+watch_chromium.org, Mike Lawther (Google), f(malita)
Visibility:
Public.

Description

Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge This change adds a new abstraction layer called ImageBufferSurface which is used to provide a rendering surface to ImageBuffers. The motivation is to move the construction of the canvas layer bridge into HTMLCanvasElement, which will make it possible, in a future change, to attach it to a per-WebView Canvas2DLayerManager. Having one Manager per WebView (instead of per renderer process) will make it possible to have canvas resource management policies that depend on whether the owning WebView is active. Other effects of this change: * Changed all call sites that used Unaccelerated image buffers to stop using platform surfaces, and used malloc'ed buffers instead. * Non-drawable image buffers no longer create an SkCanvas and a GraphicsContext * It is now possible to create an accelerated ImageBuffer without a Canvas2DLayerBridge (useful for accelerated image filters). * Buffer creation fallback sequence is no longer baked-in to the ImageBuffer constructor, making it possible for different call sites to have different fallback logic. * ImageBuffer no longer provides support for device scale factors BUG=244427 R=senorblanco,jamesr Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163572

Patch Set 1 #

Patch Set 2 : Re-upload with similarity 0 #

Patch Set 3 : rebase + build fix #

Patch Set 4 : build fixes for win+mac #

Total comments: 10

Patch Set 5 : response to comments + rebase #

Patch Set 6 : fix mac build #

Patch Set 7 : fix mac build #

Patch Set 8 : fix mac #

Patch Set 9 : mac+win build fix #

Total comments: 12

Patch Set 10 : fic mac + review #

Patch Set 11 : fix mac + review #

Patch Set 12 : fix mac + review #

Total comments: 1

Patch Set 13 : rebase #

Patch Set 14 : fix for component build #

Patch Set 15 : rebase #

Patch Set 16 : resolved merge #

Patch Set 17 : debug build fixes #

Patch Set 18 : fix debug assertion #

Patch Set 19 : win_layout build fix #

Patch Set 20 : try 2 #

Patch Set 21 : another rebase #

Patch Set 22 : rebase this #

Patch Set 23 : rebase mayhem #

Unified diffs Side-by-side diffs Delta from patch set Stats (+591 lines, -723 lines) Patch
M Source/core/frame/Frame.cpp View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -2 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.h View 1 2 3 4 5 chunks +3 lines, -5 lines 0 comments Download
Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 9 9 chunks +39 lines, -26 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.h View 1 2 3 4 2 chunks +5 lines, -7 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +5 lines, -35 lines 0 comments Download
M Source/core/html/canvas/WebGLRenderingContext.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLRenderingContext.cpp View 1 2 3 4 5 chunks +6 lines, -6 lines 0 comments Download
M Source/core/platform/DragImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
Source/core/platform/animation/AnimationTranslationUtil.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/FilterEffectRenderer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +12 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderLayer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/RenderThemeChromiumMac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderVideo.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/shapes/Shape.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -3 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +13 lines, -6 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourcePattern.cpp View 1 2 3 4 2 chunks +7 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/SVGRenderingContext.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +9 lines, -0 lines 0 comments Download
A + Source/platform/graphics/Canvas2DImageBufferSurface.h View 1 2 3 4 5 6 7 8 9 17 18 1 chunk +24 lines, -26 lines 0 comments Download
M Source/platform/graphics/Canvas2DLayerBridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +17 lines, -36 lines 0 comments Download
M Source/platform/graphics/Canvas2DLayerBridge.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +19 lines, -33 lines 0 comments Download
M Source/platform/graphics/CrossfadeGeneratedImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/GraphicsContext.h View 1 2 3 4 3 chunks +2 lines, -4 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +43 lines, -14 lines 0 comments Download
M Source/platform/graphics/GraphicsContextRecorder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -1 line 0 comments Download
M Source/platform/graphics/ImageBuffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +12 lines, -48 lines 0 comments Download
M Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 15 chunks +44 lines, -179 lines 0 comments Download
A + Source/platform/graphics/ImageBufferSurface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +44 lines, -6 lines 0 comments Download
A + Source/platform/graphics/ImageBufferSurface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +23 lines, -21 lines 0 comments Download
A + Source/platform/graphics/UnacceleratedImageBufferSurface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +12 lines, -16 lines 0 comments Download
A + Source/platform/graphics/UnacceleratedImageBufferSurface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +15 lines, -22 lines 0 comments Download
M Source/platform/graphics/filters/FEBlend.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/filters/FEComposite.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +3 lines, -3 lines 0 comments Download
M Source/platform/graphics/filters/FEDisplacementMap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/filters/FELighting.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/filters/FETile.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +12 lines, -1 line 0 comments Download
M Source/platform/graphics/filters/FETurbulence.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/filters/Filter.h View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M Source/platform/graphics/filters/FilterEffect.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +17 lines, -6 lines 0 comments Download
A + Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +15 lines, -16 lines 0 comments Download
A + Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +24 lines, -33 lines 0 comments Download
A + Source/platform/graphics/gpu/WebGLImageBufferSurface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +21 lines, -7 lines 0 comments Download
A + Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +21 lines, -22 lines 0 comments Download
M Source/platform/graphics/win/TransparencyWin.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M Source/web/WebMediaPlayerClientImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
Source/web/tests/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +21 lines, -16 lines 0 comments Download
Source/web/tests/Canvas2DLayerManagerTest.cpp View 1 2 3 4 5 6 7 8 9 8 chunks +51 lines, -39 lines 0 comments Download
M Source/web/tests/TransparencyWinTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +12 lines, -56 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
Justin Novosad
7 years ago (2013-12-04 18:27:10 UTC) #1
Stephen Chennney
On 2013/12/04 18:27:10, junov wrote: Please don't land this until the GraphicsContext move from core/platform ...
7 years ago (2013-12-04 18:56:06 UTC) #2
Justin Novosad
On 2013/12/04 18:56:06, Stephen Chenney wrote: > On 2013/12/04 18:27:10, junov wrote: > > Please ...
7 years ago (2013-12-04 19:27:23 UTC) #3
Stephen White
Overall, this is great work. It separates concerns of the different use cases nicely, and ...
7 years ago (2013-12-04 21:18:39 UTC) #4
Justin Novosad
New Patch. Addresses all review feedback received so far. Most significant differences: * Removed notion ...
7 years ago (2013-12-06 21:41:09 UTC) #5
Stephen White
https://codereview.chromium.org/104023007/diff/150001/Source/core/frame/ImageBitmap.cpp File Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/104023007/diff/150001/Source/core/frame/ImageBitmap.cpp#newcode15 Source/core/frame/ImageBitmap.cpp:15: #include "platform/graphics/UnacceleratedImageBufferSurface.h" Please remove this if it's no longer ...
7 years ago (2013-12-09 15:33:07 UTC) #6
Justin Novosad
https://codereview.chromium.org/104023007/diff/150001/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/104023007/diff/150001/Source/core/html/HTMLCanvasElement.cpp#newcode468 Source/core/html/HTMLCanvasElement.cpp:468: OwnPtr<ImageBufferSurface> surface = createImageBufferSurface(deviceSize, &msaaSampleCount); On 2013/12/09 15:33:08, Stephen ...
7 years ago (2013-12-09 16:37:30 UTC) #7
Justin Novosad
New patch. Applied corrections + fix for mac build
7 years ago (2013-12-09 19:52:27 UTC) #8
Stephen White
LGTM https://codereview.chromium.org/104023007/diff/210001/Source/platform/graphics/Canvas2DImageBufferSurface.h File Source/platform/graphics/Canvas2DImageBufferSurface.h (right): https://codereview.chromium.org/104023007/diff/210001/Source/platform/graphics/Canvas2DImageBufferSurface.h#newcode52 Source/platform/graphics/Canvas2DImageBufferSurface.h:52: m_layerBridge->beginDestruction(); Naming nit: better, but maybe removeFromCompositor()? (Can ...
7 years ago (2013-12-09 20:47:44 UTC) #9
Justin Novosad
On 2013/12/09 20:47:44, Stephen White wrote: > LGTM > > https://codereview.chromium.org/104023007/diff/210001/Source/platform/graphics/Canvas2DImageBufferSurface.h > File Source/platform/graphics/Canvas2DImageBufferSurface.h (right): ...
7 years ago (2013-12-09 21:18:44 UTC) #10
Justin Novosad
Still need approval from an OWNER of Source/web
7 years ago (2013-12-09 21:19:58 UTC) #11
eseidel
web/ changes lgtm.
7 years ago (2013-12-09 21:42:19 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/210001
7 years ago (2013-12-09 21:48:25 UTC) #13
commit-bot: I haz the power
Failed to apply patch for Source/core/platform/graphics/CrossfadeGeneratedImage.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
7 years ago (2013-12-09 21:48:40 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/230001
7 years ago (2013-12-09 22:22:33 UTC) #15
commit-bot: I haz the power
Retried try job too often on linux_blink for step(s) webkit_tests, webkit_unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink&number=4988
7 years ago (2013-12-10 01:28:08 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/310001
7 years ago (2013-12-10 16:40:13 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/330001
7 years ago (2013-12-10 17:03:39 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/10044
7 years ago (2013-12-10 18:01:51 UTC) #19
commit-bot: I haz the power
Failed to apply patch for Source/platform/graphics/ImageBufferSurface.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; A Source/platform/graphics/ImageBufferSurface.cpp ...
7 years ago (2013-12-10 18:02:26 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/380001
7 years ago (2013-12-10 18:08:06 UTC) #21
Justin Novosad
Gah! This patch is too big. I am stuck in an infinite loop of rebase+merge+fix ...
7 years ago (2013-12-10 18:25:45 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/400001
7 years ago (2013-12-10 18:38:16 UTC) #23
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, wtf_unittests ...
7 years ago (2013-12-10 19:33:12 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/junov@chromium.org/104023007/420001
7 years ago (2013-12-10 20:26:10 UTC) #25
commit-bot: I haz the power
7 years ago (2013-12-10 22:08:54 UTC) #26
Message was sent while issue was closed.
Change committed as 163572

Powered by Google App Engine
This is Rietveld 408576698