When calling OffscreenCanvas.transferToImageBitmap, the canvas's backing is transfered, but the full context state must be retained, including the matrix and clip stack on the ImageBufferSurface.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b46b601d0286d9ffc010250ce48602f21bfd6404 commit b46b601d0286d9ffc010250ce48602f21bfd6404 Author: junov <junov@chromium.org> Date: Fri May 27 21:08:50 2016 Fix 2D canvas state persistency after OffscreenCanvas.transferToImageBitmap This change restores the matrix and clip state stack on the new ImageBuffer that get created by OffscreenCanvasRenderingContext2D after the previous buffer was torn off by transferToImageBItmap. This change also adds the clip() method to OffscreenCanvasRenderingContext2D. BUG= 593349 Review-Url: https://codereview.chromium.org/1995733005 Cr-Commit-Position: refs/heads/master@{#396559} [add] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferToImageBitmap-state-persistency-expected.txt [add] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferToImageBitmap-state-persistency.html [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h [modify] https://crrev.com/b46b601d0286d9ffc010250ce48602f21bfd6404/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl
Comment 1 by junov@chromium.org
, Mar 9 2016