aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkXfermode.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-13 21:12:04 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-13 21:12:04 +0000
commitc0d4aa2088a0788f9df221497945d2ba1b342f44 (patch)
tree7a8d7d3c111f0eadce1deb4028b20495fea38d2c /include/core/SkXfermode.h
parent80adceb39a82b7a07bea2dcb2fcd7bef54c38eb1 (diff)
fix asMode() to always succeed if the xfermode was built from a Mode
update dox to reflect this update test git-svn-id: http://skia.googlecode.com/svn/trunk@1121 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkXfermode.h')
-rw-r--r--include/core/SkXfermode.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 155d3f853c..506f336935 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -115,10 +115,10 @@ public:
kLastMode = kExclusion_Mode
};
- /** If the xfermode is one of the modes in the Mode enum, then asMode()
- returns true and sets (if not null) mode accordingly.
- This is a better version of IsMode(), which is only able to report
- about modes that are expressible as coefficients.
+ /**
+ * If the xfermode is one of the modes in the Mode enum, then asMode()
+ * returns true and sets (if not null) mode accordingly. Otherwise it
+ * returns false and ignores the mode parameter.
*/
virtual bool asMode(Mode* mode);
@@ -138,10 +138,9 @@ public:
*/
static SkXfermodeProc16 GetProc16(Mode mode, SkColor srcColor);
- /** If the specified xfermode advertises itself as one of the porterduff
- modes (via SkXfermode::Coeff), return true and if not null, set mode
- to the corresponding porterduff mode. If it is not recognized as a one,
- return false and ignore the mode parameter.
+ /**
+ * 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.
*/
static bool IsMode(SkXfermode*, Mode* mode);
@@ -189,7 +188,6 @@ public:
// overrides from SkFlattenable
virtual Factory getFactory() { return CreateProc; }
virtual void flatten(SkFlattenableWriteBuffer&);
- virtual bool asMode(SkXfermode::Mode* mode);
protected:
SkProcXfermode(SkFlattenableReadBuffer&);