Implement SkXfermode image filter. This required changing the signature of SkXfermode...
authorsenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 May 2013 17:49:12 +0000 (17:49 +0000)
committersenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 May 2013 17:49:12 +0000 (17:49 +0000)
commit86fc266eda887920e3dd104bee8121ae19729cf5
treeca43dd64735b058926a9efaf6e3c9a7cf65e2fd4
parent70fdc128377bac81dac987fdc996a1b4e269e1fb
Implement 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

Review URL: https://codereview.chromium.org/16125008

git-svn-id: http://skia.googlecode.com/svn/trunk@9373 2bbb7eff-a529-9590-31e7-b0007b416f81
gm/xfermodeimagefilter.cpp [new file with mode: 0644]
gyp/effects.gypi
gyp/gmslides.gypi
include/core/SkXfermode.h
include/effects/SkXfermodeImageFilter.h [new file with mode: 0644]
src/core/SkXfermode.cpp
src/effects/SkArithmeticMode.cpp
src/effects/SkXfermodeImageFilter.cpp [new file with mode: 0644]
src/ports/SkGlobalInitialization_default.cpp