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

Issue 661053003: Make beginLayer() and CanvasRenderingContext2D use SkXfermode::Mode. (Closed)

Created:
6 years, 2 months ago by dshwang
Modified:
5 years, 11 months ago
CC:
blink-reviews, eae+blinkwatch, fs, kouhei+svg_chromium.org, rwlbuis, krit, blink-reviews-html_chromium.org, rune+blink, danakj, dglazkov+blink, Rik, jchaffraix+rendering, aandrey+blink_chromium.org, pdr+svgwatchlist_chromium.org, zoltan1, jbroman, pdr+graphicswatchlist_chromium.org, gyuyoung.kim_webkit.org, blink-reviews-rendering, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, mkwst+moarreviews_chromium.org, ed+blinkwatch_opera.com, f(malita), Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Make beginLayer() and CanvasRenderingContext2D use SkXfermode::Mode. CompositeOperator and BlendMode is mutual exclusive. From the CSS perspective, a css property is always set either, not both.[1] For example, source-in with lighten is impossible. If source-in is needed, BlendMode must be WebBlendNormal. Otherwise, if lighten is needed, CompositeOperartion must be source-over. This CL makes CanvasRenderingContext2D use SkXfermode::Mode directly. It helps to avoid a bug of having invalid CompositeOperator and BlendMode combination. GraphicsContext::beginLayer() gets WebBlendMode as parameter. GraphicsContext::beginLayer() receives only CompositeOperator while GraphicsContext::setCompositeOperation() receives both CompositeOperator and BlendMode. It can causes a developer to be confused. For example, CanvasRenderingContext2D::fullCanvasCompositedDraw() restores only CompositeOperator after beginLayer(), although fortunately it doesn't cause any bugs because BlendMode is always WebBlendNormal at the moment. [1] http://dev.w3.org/fxtf/compositing-1 BUG=425656 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188586

Patch Set 1 #

Patch Set 2 : build fix #

Patch Set 3 : Make beginLayer() and CanvasRenderingContext2D use SkXfermode::Mode directly #

Patch Set 4 : Fix layouttests failure #

Patch Set 5 : Rebase to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -57 lines) Patch
M Source/core/html/canvas/CanvasRenderingContext2D.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 4 15 chunks +22 lines, -27 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceClipper.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilter.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceMasker.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/GraphicsContext.h View 1 2 3 4 2 chunks +7 lines, -5 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 2 chunks +21 lines, -5 lines 0 comments Download
M Source/platform/graphics/GraphicsContextState.h View 1 2 3 4 2 chunks +3 lines, -5 lines 0 comments Download
M Source/platform/graphics/GraphicsContextState.cpp View 1 2 3 4 3 chunks +4 lines, -8 lines 0 comments Download
M Source/platform/graphics/paint/CompositingDisplayItem.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/platform/graphics/paint/FilterDisplayItem.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/skia/SkiaUtils.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/platform/graphics/skia/SkiaUtils.cpp View 1 2 3 4 2 chunks +75 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (6 generated)
dshwang
Stephen, could you review?
6 years, 2 months ago (2014-10-21 11:26:28 UTC) #2
Stephen Chennney
I would prefer it if the constraint between the composite mode and blend mode was ...
6 years, 2 months ago (2014-10-21 13:31:09 UTC) #4
Justin Novosad
Could we take this opportunity to move GraphicsContext one step close to skia by using ...
6 years, 2 months ago (2014-10-21 15:22:58 UTC) #5
Stephen White
+1 to moving call sites towards Skia semantics. I don't mind this patch as-is, since ...
6 years, 2 months ago (2014-10-21 15:37:52 UTC) #6
dshwang
I agree on you. I'll make GraphicsContext know only SkXfermode and updates call sites.
6 years, 2 months ago (2014-10-21 15:49:24 UTC) #7
dshwang
On 2014/10/21 15:49:24, dshwang wrote: > I agree on you. I'll make GraphicsContext know only ...
6 years, 2 months ago (2014-10-21 18:27:46 UTC) #8
Justin Novosad
On 2014/10/21 18:27:46, dshwang wrote: > On 2014/10/21 15:49:24, dshwang wrote: > > I agree ...
6 years, 2 months ago (2014-10-23 03:23:34 UTC) #9
dshwang
On 2014/10/23 03:23:34, junov wrote: > I see, I did not realize we had those ...
6 years, 2 months ago (2014-10-23 17:38:29 UTC) #10
Justin Novosad
Excellent! Thanks for doing this. Assuming all the tests pass: lgtm
6 years, 2 months ago (2014-10-23 17:48:29 UTC) #12
dshwang
On 2014/10/23 17:48:29, junov wrote: > Excellent! Thanks for doing this. > Assuming all the ...
6 years, 2 months ago (2014-10-23 18:37:02 UTC) #13
dshwang
After https://codereview.chromium.org/663313005/ is landed, I rebase it to ToT @junov, could you review again?
5 years, 11 months ago (2015-01-16 16:42:53 UTC) #14
Justin Novosad
On 2015/01/16 16:42:53, dshwang wrote: > After https://codereview.chromium.org/663313005/ is landed, I rebase it to ToT ...
5 years, 11 months ago (2015-01-16 19:05:59 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/661053003/100001
5 years, 11 months ago (2015-01-17 13:25:05 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/661053003/100001
5 years, 11 months ago (2015-01-18 17:14:28 UTC) #20
commit-bot: I haz the power
5 years, 11 months ago (2015-01-19 05:28:09 UTC) #21
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=188586

Powered by Google App Engine
This is Rietveld 408576698