Add GPU acceleration support to 2D contexts with OffscreenCanvas In the mean time, some ref tests for OffscreenCanvas may fail under virtual/gpu due to subtle discrepancies in anti-aliasing and compositing
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
This issue has been moved once and is lower than Pri-1. Removing the milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f commit 524668f2a8ed8d87a049a2dc1e74ff0134c8f82f Author: junov <junov@chromium.org> Date: Mon Aug 08 20:16:52 2016 Enable GPU acceleration in 2D OffscreenCanvases on main thread This change allows OffscreenCanvasRenderingContext2D to create an AcceleratedImageBufferSurface for its backing on platforms that support GPU-accelerated canvas. The plumbing of the runtime option for controlling the availability of accelerated canvases was moved from WebSettings to RuntimeEnableFeatures so that we no longer need to access the DOM in order to access the feature flag. BUG= 593514 Review-Url: https://codereview.chromium.org/2192493003 Cr-Commit-Position: refs/heads/master@{#410423} [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/content/renderer/render_view_impl.cc [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/compositing/content-changed-chicken-egg-expected.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/compositing/content-changed-chicken-egg.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas-all.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas-border.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas-padding.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas-with-mask.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas-with-shadow.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/LayoutTests/fast/borders/border-radius-mask-canvas.html [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/core/frame/Settings.in [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/web/WebSettingsImpl.cpp [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/Source/web/WebSettingsImpl.h [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/public/web/WebRuntimeFeatures.h [modify] https://crrev.com/524668f2a8ed8d87a049a2dc1e74ff0134c8f82f/third_party/WebKit/public/web/WebSettings.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 commit 83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 Author: junov <junov@chromium.org> Date: Wed Sep 07 13:59:38 2016 Allow canvases to be GPU-accelerated in Workers This change sets up a per-thread shared GPU context that is managed by a thread-specific singleton SharedGpuContext. This means that all 2D contexts on a given worker will use the same context, which avoids having to rely on mailboxes all the time. Also this CL makes deep changes to AcceleratedStaticBitmapImage in order to support the use of the current thread's shared context, and it handles transfers between threads in order to support the transferrable behavior of ImageBitmap objects. BUG= 593514 Review-Url: https://codereview.chromium.org/2300633004 Cr-Commit-Position: refs/heads/master@{#416929} [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-1.js [add] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-2.js [add] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker.html [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/core/frame/ImageBitmap.cpp [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/DEPS [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/Image.h [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h [modify] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp [add] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp [add] https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5235c5b0662c2553b0c10ebece983c04d00ebed6 commit 5235c5b0662c2553b0c10ebece983c04d00ebed6 Author: lushnikov <lushnikov@chromium.org> Date: Thu Sep 08 00:15:27 2016 Revert of Allow canvases to be GPU-accelerated in Workers (patchset #5 id:80001 of https://codereview.chromium.org/2300633004/ ) Reason for revert: This makes the following tests fail on Linux MSAN bot: virtual/gpu/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html virtual/display_list_2d_canvas/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html Build link: https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20MSAN/builds/12091 Original issue's description: > Allow canvases to be GPU-accelerated in Workers > > This change sets up a per-thread shared GPU context that is managed by > a thread-specific singleton SharedGpuContext. This means that all 2D > contexts on a given worker will use the same context, which avoids > having to rely on mailboxes all the time. Also this CL makes deep changes > to AcceleratedStaticBitmapImage in order to support the use of > the current thread's shared context, and it handles transfers > between threads in order to support the transferrable behavior of > ImageBitmap objects. > > BUG= 593514 > > Committed: https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 > Cr-Commit-Position: refs/heads/master@{#416929} TBR=kbr@chromium.org,haraken@chromium.org,junov@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 593514 Review-Url: https://codereview.chromium.org/2323573002 Cr-Commit-Position: refs/heads/master@{#417127} [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/LayoutTests/TestExpectations [delete] https://crrev.com/4b8bca190cdc55bae81974aa09cc10f422f022fb/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-1.js [delete] https://crrev.com/4b8bca190cdc55bae81974aa09cc10f422f022fb/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-2.js [delete] https://crrev.com/4b8bca190cdc55bae81974aa09cc10f422f022fb/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker.html [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/core/frame/ImageBitmap.cpp [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/DEPS [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/Image.h [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h [modify] https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp [delete] https://crrev.com/4b8bca190cdc55bae81974aa09cc10f422f022fb/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp [delete] https://crrev.com/4b8bca190cdc55bae81974aa09cc10f422f022fb/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/04f74a5b5283f1e38fcf21ed684267cd13053e02 commit 04f74a5b5283f1e38fcf21ed684267cd13053e02 Author: junov <junov@chromium.org> Date: Thu Sep 08 14:20:50 2016 Reland of Allow canvases to be GPU-accelerated in Workers (patchset #1 id:1 of https://codereview.chromium.org/2323573002/ ) Reason for revert: The failure that was the reason for the original revert is still happening, so this change was not the cause. Reverting the revert... Original issue's description: > Revert of Allow canvases to be GPU-accelerated in Workers (patchset #5 id:80001 of https://codereview.chromium.org/2300633004/ ) > > Reason for revert: > This makes the following tests fail on Linux MSAN bot: > > virtual/gpu/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html > virtual/display_list_2d_canvas/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html > > Build link: > https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20MSAN/builds/12091 > > Original issue's description: > > Allow canvases to be GPU-accelerated in Workers > > > > This change sets up a per-thread shared GPU context that is managed by > > a thread-specific singleton SharedGpuContext. This means that all 2D > > contexts on a given worker will use the same context, which avoids > > having to rely on mailboxes all the time. Also this CL makes deep changes > > to AcceleratedStaticBitmapImage in order to support the use of > > the current thread's shared context, and it handles transfers > > between threads in order to support the transferrable behavior of > > ImageBitmap objects. > > > > BUG= 593514 > > > > Committed: https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 > > Cr-Commit-Position: refs/heads/master@{#416929} > > TBR=kbr@chromium.org,haraken@chromium.org,junov@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG= 593514 > > Committed: https://crrev.com/5235c5b0662c2553b0c10ebece983c04d00ebed6 > Cr-Commit-Position: refs/heads/master@{#417127} TBR=kbr@chromium.org,haraken@chromium.org,lushnikov@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 593514 Review-Url: https://codereview.chromium.org/2321063002 Cr-Commit-Position: refs/heads/master@{#417284} [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-1.js [add] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-2.js [add] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker.html [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/core/frame/ImageBitmap.cpp [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/DEPS [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/Image.h [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h [modify] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp [add] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp [add] https://crrev.com/04f74a5b5283f1e38fcf21ed684267cd13053e02/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
Comment 1 by xidac...@chromium.org
, Apr 11 2016