DescriptionImplement SkXfermode image filter. This required changing the signature of SkXfermode::asNewEffectOrCoeffs(), to add an optional background texture.
For the raster path, we do a straightforward 2-pass method: draw background, then composite the foreground over it.
For the GPU path, if the xfermode can be expressed as an effect, we build an effect with the background texture incorporated, then do a single-pass draw fetching both foreground and background textures, and compositing to the result. If the xfermode is expressed as src/dst coefficients, we do a 2-pass draw as in the raster path and use fixed-function blending.
R=bsalomon@google.com, reed@google.com
Committed: https://code.google.com/p/skia/source/detail?r=9373
Patch Set 1 #Patch Set 2 : Fix background texture access; add more test modes; fix raster fg/bg flip; implement regular blend … #Patch Set 3 : Fix .h filename in .gyp; remove commented-out code #
Total comments: 6
Patch Set 4 : Fix formatting, add comments. #
Total comments: 4
Patch Set 5 : add a test for NULL xfermode; improve comments #Patch Set 6 : compare mode in onIsEqual; improve comments; embiggen GM result #Patch Set 7 : Fix GPU side of SkArithmeticMode to handle background input. #
Total comments: 2
Patch Set 8 : Add new case to xfermodeimagefilter GM; revert changes to arithmode GM #
Messages
Total messages: 14 (0 generated)
|