DescriptionMake 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 #Messages
Total messages: 21 (6 generated)
|