aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/effects
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-09-15 15:33:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-15 15:33:27 -0700
commitae4738f677c70f4ec7687422e1510ee3d80d810e (patch)
tree81c2e343e61a5102a74fbb67246101d1006c0738 /include/gpu/effects
parentcd7f03597475ea423aa819bdae03996b26874dd5 (diff)
Create fragment processor for performing input color blend with child processor
The new FP is used to implement SkXM::Mode color filters and SkXM::Mode image filters. Also, these now support all advanced SkXM::Mode xfermodes. Review URL: https://codereview.chromium.org/1334293003
Diffstat (limited to 'include/gpu/effects')
-rw-r--r--include/gpu/effects/GrCustomXfermode.h11
-rw-r--r--include/gpu/effects/GrXfermodeFragmentProcessor.h10
2 files changed, 12 insertions, 9 deletions
diff --git a/include/gpu/effects/GrCustomXfermode.h b/include/gpu/effects/GrCustomXfermode.h
index 557397077e..bcbd5833ca 100644
--- a/include/gpu/effects/GrCustomXfermode.h
+++ b/include/gpu/effects/GrCustomXfermode.h
@@ -10,21 +10,14 @@
#include "SkXfermode.h"
-class GrFragmentProcessor;
class GrTexture;
/**
* Custom Xfer modes are used for blending when the blend mode cannot be represented using blend
- * coefficients. It is assumed that all blending is done within the processors' emit code. For each
- * blend mode there should be a matching fragment processor (used when blending with a background
- * texture) and xfer processor.
+ * coefficients.
*/
namespace GrCustomXfermode {
- bool IsSupportedMode(SkXfermode::Mode mode);
-
- GrFragmentProcessor* CreateFP(GrProcessorDataManager*, SkXfermode::Mode mode,
- GrTexture* background);
-
+ bool IsSupportedMode(SkXfermode::Mode mode);
GrXPFactory* CreateXPFactory(SkXfermode::Mode mode);
};
diff --git a/include/gpu/effects/GrXfermodeFragmentProcessor.h b/include/gpu/effects/GrXfermodeFragmentProcessor.h
index d93b400b8b..e2d1c0a544 100644
--- a/include/gpu/effects/GrXfermodeFragmentProcessor.h
+++ b/include/gpu/effects/GrXfermodeFragmentProcessor.h
@@ -13,6 +13,16 @@
class GrFragmentProcessor;
namespace GrXfermodeFragmentProcessor {
+ /** The color input to the returned processor is treated as the src and the passed in processor
+ is the dst. */
+ const GrFragmentProcessor* CreateFromDstProcessor(const GrFragmentProcessor* dst,
+ SkXfermode::Mode mode);
+
+ /** The color input to the returned processor is treated as the dst and the passed in processor
+ is the src. */
+ const GrFragmentProcessor* CreateFromSrcProcessor(const GrFragmentProcessor* src,
+ SkXfermode::Mode mode);
+
const GrFragmentProcessor* CreateFromTwoProcessors(const GrFragmentProcessor* src,
const GrFragmentProcessor* dst,
SkXfermode::Mode mode);