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

Issue 14298018: This CL implements the first draft of Canvas 2D Context Attributes, aka getContext('2d', { alpha: f… (Closed)

Created:
7 years, 8 months ago by Stephen White
Modified:
7 years, 7 months ago
Reviewers:
jamesr, dglazkov
CC:
blink-reviews, abarth_chromum.org, jochen+watch_chromium.org, aandrey
Visibility:
Public.

Description

This CL implements the first draft of Canvas 2D Context Attributes, aka getContext('2d', { alpha: false }). See also WhatWG proposal http://wiki.whatwg.org/wiki/CanvasOpaque and OWP launch bug http://crbug.com/234297. Canvas2DLayerBridge and ImageBuffer now have an opacityMode in their constructor, which indicates NonOpaque (the usual, RGBA buffer) or Opaque. ImageBuffer will be cleared to opaque black instead of transparent black. Canvas2DLayerBridge will also mark its compositing layer as opaque if set. CanvasRenderingContext2D creates its buffers as Opaque when the getContext() call includes { alpha: false }. To avoid flag proliferation, this feature is protected by the new "experimental canvas features" flag, under which it and other not-ready-to-ship-by-default canvas features will be developed. BUG=234742 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=149384

Patch Set 1 #

Patch Set 2 : Add missing files #

Patch Set 3 : git cl hates me #

Patch Set 4 : New approach to runtime flags, using RuntimeEnabledFeatures #

Patch Set 5 : IDL cleanup #

Total comments: 6

Patch Set 6 : Fixes from review comments; remove WebPreferences.h changes; fix comment. #

Total comments: 7

Patch Set 7 : Fixes for review comments #

Patch Set 8 : Rebased to ToT #

Patch Set 9 : Add new test cases; remove misleading comment. #

Patch Set 10 : Updated to ToT #

Patch Set 11 : Rebased to ToT; test cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -68 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/alpha.html View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/alpha.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +52 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/alpha-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +35 lines, -0 lines 0 comments Download
M Source/WebKit/chromium/public/WebRuntimeFeatures.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M Source/WebKit/chromium/src/WebRuntimeFeatures.cpp View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/WebKit/chromium/tests/Canvas2DLayerManagerTest.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp View 1 2 3 4 5 3 chunks +12 lines, -3 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 9 10 5 chunks +8 lines, -6 lines 0 comments Download
A + Source/core/html/canvas/Canvas2DContextAttributes.h View 1 2 3 4 5 6 7 8 9 2 chunks +18 lines, -19 lines 0 comments Download
A + Source/core/html/canvas/Canvas2DContextAttributes.cpp View 1 2 3 2 chunks +20 lines, -9 lines 0 comments Download
A + Source/core/html/canvas/Canvas2DContextAttributes.idl View 1 2 3 4 2 chunks +3 lines, -9 lines 0 comments Download
M Source/core/html/canvas/CanvasContextAttributes.h View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.h View 1 2 3 4 5 6 7 8 9 6 chunks +8 lines, -3 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -1 line 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.idl View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/page/RuntimeEnabledFeatures.h View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M Source/core/page/RuntimeEnabledFeatures.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/platform/graphics/ImageBuffer.h View 1 2 3 2 chunks +8 lines, -3 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h View 1 2 3 4 5 6 7 2 chunks +8 lines, -3 lines 0 comments Download
M Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/platform/graphics/skia/ImageBufferSkia.cpp View 1 2 3 4 5 6 7 8 9 10 6 chunks +11 lines, -7 lines 0 comments Download
M Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Stephen White
James, could you take a look? Thanks!
7 years, 8 months ago (2013-04-25 16:56:44 UTC) #1
jamesr
https://codereview.chromium.org/14298018/diff/9027/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp File Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp (right): https://codereview.chromium.org/14298018/diff/9027/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp#newcode81 Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:81: Canvas2DContextAttributes* canvas2DAttrs = static_cast<Canvas2DContextAttributes*>(attrs.get()); do you have to downcast? ...
7 years, 8 months ago (2013-04-26 00:41:31 UTC) #2
Stephen White
Thanks for your review! https://codereview.chromium.org/14298018/diff/9027/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp File Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp (right): https://codereview.chromium.org/14298018/diff/9027/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp#newcode81 Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:81: Canvas2DContextAttributes* canvas2DAttrs = static_cast<Canvas2DContextAttributes*>(attrs.get()); On ...
7 years, 8 months ago (2013-04-26 15:51:03 UTC) #3
Stephen White
New version up w/changes for review comments. PTAL
7 years, 8 months ago (2013-04-26 18:18:57 UTC) #4
jamesr
https://codereview.chromium.org/14298018/diff/22001/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/14298018/diff/22001/Source/core/html/HTMLCanvasElement.cpp#newcode164 Source/core/html/HTMLCanvasElement.cpp:164: Settings* settings = document()->settings(); not sure why this moved, ...
7 years, 8 months ago (2013-04-26 18:30:09 UTC) #5
Stephen White
New version up. https://codereview.chromium.org/14298018/diff/22001/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/14298018/diff/22001/Source/core/html/HTMLCanvasElement.cpp#newcode164 Source/core/html/HTMLCanvasElement.cpp:164: Settings* settings = document()->settings(); On 2013/04/26 ...
7 years, 8 months ago (2013-04-26 18:53:18 UTC) #6
jamesr
On 2013/04/26 18:53:18, Stephen White wrote: > https://codereview.chromium.org/14298018/diff/22001/Source/core/html/canvas/CanvasRenderingContext2D.cpp > File Source/core/html/canvas/CanvasRenderingContext2D.cpp (right): > > https://codereview.chromium.org/14298018/diff/22001/Source/core/html/canvas/CanvasRenderingContext2D.cpp#newcode2258 ...
7 years, 8 months ago (2013-04-26 20:03:07 UTC) #7
Stephen White
On 2013/04/26 20:03:07, jamesr wrote: > On 2013/04/26 18:53:18, Stephen White wrote: > > > ...
7 years, 8 months ago (2013-04-27 10:44:12 UTC) #8
jamesr
I'm pretty sure that copy does nothing for 2d or webgl. Write some tests so ...
7 years, 7 months ago (2013-04-28 18:50:39 UTC) #9
Stephen White
Dimitri: could you take a look for V8HTMLCanvasElementCustom.cpp? Thanks!
7 years, 7 months ago (2013-04-29 03:01:08 UTC) #10
dglazkov
lgtm.
7 years, 7 months ago (2013-04-29 23:12:40 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/senorblanco@chromium.org/14298018/27005
7 years, 7 months ago (2013-04-29 23:16:56 UTC) #12
commit-bot: I haz the power
7 years, 7 months ago (2013-04-29 23:30:42 UTC) #13
Message was sent while issue was closed.
Change committed as 149384

Powered by Google App Engine
This is Rietveld 408576698