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

Issue 2508943003: Make OffscreenCanvas resizeable (Closed)

Created:
4 years, 1 month ago by Justin Novosad
Modified:
4 years, 1 month ago
Reviewers:
xidachen, xlai (Olivia)
CC:
chromium-reviews, krit, dshwang, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, pdr+graphicswatchlist_chromium.org, jbroman, haraken, dglazkov+blink, Rik, f(malita), blink-reviews, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make OffscreenCanvas resizeable This change implements all the script observable aspects of changing the size of an OffscreenCanvas object. What is missing after this change is to correctly handle the compositing layer updates for the commit() flow. BUG=662498 Committed: https://crrev.com/09cffb4f307ead2a20776a6e6b0d9cc1ca3e5ff7 Cr-Commit-Position: refs/heads/master@{#432881}

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -65 lines) Patch
A third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html View 1 chunk +152 lines, -0 lines 1 comment Download
M third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html View 1 chunk +0 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h View 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 chunk +19 lines, -21 lines 1 comment Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.idl View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h View 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp View 1 chunk +31 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp View 2 chunks +2 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp View 1 chunk +5 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (9 generated)
Justin Novosad
PTAL
4 years, 1 month ago (2016-11-16 22:52:45 UTC) #3
Justin Novosad
https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode111 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:111: void BaseRenderingContext2D::unwindStateStack() { code moved from CanvasRenderingContext2D.cpp
4 years, 1 month ago (2016-11-16 22:58:18 UTC) #6
xidachen
lgtm https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html File third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html (right): https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html#newcode10 third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html:10: canvas.height = 40; I am guessing that when ...
4 years, 1 month ago (2016-11-17 02:12:23 UTC) #9
Justin Novosad
On 2016/11/17 02:12:23, xidachen wrote: > lgtm > > https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html > File third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html > (right): ...
4 years, 1 month ago (2016-11-17 15:30:12 UTC) #10
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/2508943003/1
4 years, 1 month ago (2016-11-17 15:30:43 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 1 month ago (2016-11-17 15:35:01 UTC) #14
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/09cffb4f307ead2a20776a6e6b0d9cc1ca3e5ff7 Cr-Commit-Position: refs/heads/master@{#432881}
4 years, 1 month ago (2016-11-17 15:37:47 UTC) #16
xlai (Olivia)
https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp File third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp (right): https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp#newcode104 third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp:104: m_imageBuffer = nullptr; This function's implementation doesn't look correct. ...
4 years, 1 month ago (2016-11-21 16:26:58 UTC) #17
xlai (Olivia)
4 years, 1 month ago (2016-11-21 19:56:17 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/m...
File
third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
(right):

https://codereview.chromium.org/2508943003/diff/1/third_party/WebKit/Source/m...
third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp:104:
m_imageBuffer = nullptr;
On 2016/11/21 16:26:57, xlai (Olivia) wrote:
> This function's implementation doesn't look correct.
> 
> Once offscreenCanvas'size is changed, the existing image buffer of its 2d
> context is set to nullpointer, means everything that has drawn to 2d context
so
> far is lost. 

Ah I just realize that the image buffer (with a new size) is always recreated in
every call to transferToStaticBitmapImage() if it is nullptr.

Powered by Google App Engine
This is Rietveld 408576698