Index: include/core/SkXfermode.h |
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h |
index bedcc2456976713cdd7159d3dac16782f038ada9..6db7119973e2eb7feda126fef7e217d9b4165e4f 100644 |
--- a/include/core/SkXfermode.h |
+++ b/include/core/SkXfermode.h |
@@ -15,6 +15,7 @@ |
class GrFragmentProcessor; |
class GrTexture; |
+class GrXPFactory; |
class SkString; |
/** \class SkXfermode |
@@ -200,14 +201,24 @@ public: |
*/ |
virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture* background = NULL) const; |
- /** Returns true if the xfermode can be expressed as coeffs (src, dst), or as an effect |
- (effect). This helper calls the asCoeff() and asFragmentProcessor() virtuals. If the |
- xfermode is NULL, it is treated as kSrcOver_Mode. It is legal to call this with all params |
- NULL to simply test the return value. effect, src, and dst must all be NULL or all |
- non-NULL. |
+ /** A subclass may implement this factory function to work with the GPU backend. It is legal |
+ to call this with xpf NULL to simply test the return value. If effect is non-NULL |
bsalomon
2014/11/26 21:02:44
Use "factory" instead of "effect"? I don't really
egdaniel
2014/12/01 18:18:24
Done.
|
+ then the xfermode may optionally allocate an effect to return and the caller as *effect. |
+ The caller will install it and own a ref to it. Since the xfermode may or may not assign |
+ *effect, the caller should set *effect to NULL beforehand. XP's cannot use a background |
+ texture since they have no coord transforms. |
+ */ |
+ virtual bool asXPFactory(GrXPFactory** xpf) const; |
+ |
+ /** Returns true if the xfermode can be expressed as coeffs (src, dst), a xfer processor |
+ (returned as xpFactory), or a fragment processor. This helper calls the asCoeff(), |
+ asXPFactor(), and asFragmentProcessor() virtuals. If the xfermode is NULL, it is treated |
+ as kSrcOver_Mode. It is legal to call this with all params NULL to simply test the return |
+ value. effect, src, and dst must all be NULL or all non-NULL. |
*/ |
- static bool asFragmentProcessorOrCoeff(SkXfermode*, GrFragmentProcessor**, Coeff* src, |
- Coeff* dst, GrTexture* background = NULL); |
+ static bool asFragmentProcessorOrXPFactoryOrCoeff(SkXfermode*, GrFragmentProcessor**, |
bsalomon
2014/11/26 21:02:44
Yikes! I guess its just temporary. Do we really ne
egdaniel
2014/12/01 18:18:24
Better for now?
|
+ GrXPFactory**, Coeff* src, Coeff* dst, |
+ GrTexture* background = NULL); |
SK_TO_STRING_PUREVIRT() |
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |