Index: include/core/SkXfermode.h |
=================================================================== |
--- include/core/SkXfermode.h (revision 8410) |
+++ include/core/SkXfermode.h (working copy) |
@@ -13,6 +13,8 @@ |
#include "SkFlattenable.h" |
#include "SkColor.h" |
+class GrContext; |
+class GrEffectRef; |
class SkString; |
/** \class SkXfermode |
@@ -74,7 +76,7 @@ |
/** |
* The same as calling xfermode->asCoeff(..), except that this also checks |
- * if the xfermode is NULL, and if so, treats its as kSrcOver_Mode. |
+ * if the xfermode is NULL, and if so, treats it as kSrcOver_Mode. |
*/ |
static bool AsCoeff(const SkXfermode*, Coeff* src, Coeff* dst); |
@@ -136,7 +138,7 @@ |
/** |
* The same as calling xfermode->asMode(mode), except that this also checks |
- * if the xfermode is NULL, and if so, treats its as kSrcOver_Mode. |
+ * if the xfermode is NULL, and if so, treats it as kSrcOver_Mode. |
*/ |
static bool AsMode(const SkXfermode*, Mode* mode); |
@@ -181,6 +183,21 @@ |
return AsMode(xfer, mode); |
} |
+ /** A subclass may implement this factory function to work with the GPU backend. It is legal |
robertphillips
2013/03/27 18:12:09
will -> with
bsalomon
2013/03/27 18:39:42
Done.
|
+ to call this will all but the context param NULL to simply test the return value. effect, |
+ src, and dst must all be NULL or all non-NULL. If effect is non-NULL before this function |
+ is called then the xfermode may optionally allocate an effect to return and the caller will |
+ install it and own a ref to it. If the function returns true then the src and dst coeffs |
+ will be applied to the draw. |
+ */ |
+ virtual bool asNewEffect(GrContext*, GrEffectRef** effect, Coeff* src, Coeff* dst) const; |
+ |
+ /** |
+ * The same as calling xfermode->asNewEffect(...), except that this also checks if the xfermode |
+ * is NULL, and if so, treats it as kSrcOver_Mode. |
+ */ |
+ static bool AsNewEffect(SkXfermode*, GrContext*, GrEffectRef** effect, Coeff* src, Coeff* dst); |
+ |
SkDEVCODE(virtual void toString(SkString* str) const = 0;) |
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
protected: |