|
|
|
This patch fixes the existing blend modes.
It also introduces a new 'multiply' blend mode. This mode is different from the existing one that just multiplies all components (instead of doing actual blending).
Hard-light and overlay have some rounding issues. This will be addressed later.
This patch also does not add the non-separable blend modes.
See review for 7103061.
BUG=1037
Patch Set 1 #
Total messages: 7
|
reed1
|
12 years, 11 months ago (2013年01月22日 19:01:02 UTC) #1 | ||||||||||||||||||||||
Good catch on MULTIPLY. The old code was written to support modulating between two shaders (for drawVertices). It was unfortunate that I chose that name. However, scanning known google callers, I think we can do the following: 1. rename kMultiply_Mode to kModulate_Mode 1.1 add comment // multiplies corresponding components 2. add kMultiply_Mode to implement the CSS/SVG behavor 2.1 look at the impl in SkBlendImageFilter.cpp, and see how that compares to yours (speed and numerical correctness).
For sanity, perhaps we should just do #1 first (the rename), so we're sure we catch all of the places in skia. Then in a follow-up CL we can do a clean ADD of a new mode.
On 2013年01月22日 19:33:11, reed1 wrote: > For sanity, perhaps we should just do #1 first (the rename), so we're sure we > catch all of the places in skia. Then in a follow-up CL we can do a clean ADD of > a new mode. should that be done in a new review?
Yes, I suggest two sequential CLs. 1. rename the existing Multiply to Modulate (and fix up existing skia callers) 2. add Multiply (implemented to match CSS spec).
On 2013年01月23日 14:07:43, reed1 wrote: > Yes, I suggest two sequential CLs. > > 1. rename the existing Multiply to Modulate (and fix up existing skia callers) Who are the existing callers? Is it anything that uses skia (such as chrome?) or just the test files? > 2. add Multiply (implemented to match CSS spec). Will do.
On 2013年01月23日 18:47:11, RikC wrote: > On 2013年01月23日 14:07:43, reed1 wrote: > > Yes, I suggest two sequential CLs. > > > > 1. rename the existing Multiply to Modulate (and fix up existing skia callers) > Who are the existing callers? Is it anything that uses skia (such as chrome?) or > just the test files? > > > 2. add Multiply (implemented to match CSS spec). > Will do. Added multiply to modulate patch with https://codereview.appspot.com/7205045/