Index: include/core/SkPaint.h |
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h |
index e28d2fc92d59db56603f43860cf9e23fb82f95d4..ddc90ae19c7877fae6ce25bfae23eb3e45a4b7de 100644 |
--- a/include/core/SkPaint.h |
+++ b/include/core/SkPaint.h |
@@ -8,11 +8,14 @@ |
#ifndef SkPaint_DEFINED |
#define SkPaint_DEFINED |
+#include "SkBlendMode.h" |
#include "SkColor.h" |
#include "SkFilterQuality.h" |
#include "SkMatrix.h" |
#include "SkXfermode.h" |
+//#define SK_SUPPORT_LEGACY_XFERMODE_OBJECT |
+ |
class SkAutoDescriptor; |
class SkAutoGlyphCache; |
class SkColorFilter; |
@@ -525,12 +528,13 @@ public: |
#endif |
void setColorFilter(sk_sp<SkColorFilter>); |
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_OBJECT |
/** Get the paint's xfermode object. |
<p /> |
The xfermode's reference count is not affected. |
@return the paint's xfermode (or NULL) |
*/ |
- SkXfermode* getXfermode() const { return fXfermode.get(); } |
+ SkXfermode* getXfermode() const; |
/** Set or clear the xfermode object. |
<p /> |
@@ -552,6 +556,11 @@ public: |
the paint's xfermode is set to null. |
*/ |
SkXfermode* setXfermodeMode(SkXfermode::Mode); |
+#endif |
+ |
+ SkBlendMode getBlendMode() const { return (SkBlendMode)fBlendMode; } |
+ bool isSrcOver() const { return (SkBlendMode)fBlendMode == SkBlendMode::kSrcOver; } |
+ void setBlendMode(SkBlendMode mode) { fBlendMode = (unsigned)mode; } |
/** Get the paint's patheffect object. |
<p /> |
@@ -1090,7 +1099,6 @@ private: |
sk_sp<SkTypeface> fTypeface; |
sk_sp<SkPathEffect> fPathEffect; |
sk_sp<SkShader> fShader; |
- sk_sp<SkXfermode> fXfermode; |
sk_sp<SkMaskFilter> fMaskFilter; |
sk_sp<SkColorFilter> fColorFilter; |
sk_sp<SkRasterizer> fRasterizer; |
@@ -1103,6 +1111,7 @@ private: |
SkColor fColor; |
SkScalar fWidth; |
SkScalar fMiterLimit; |
+ uint32_t fBlendMode; // just need 5-6 bits for SkXfermode::Mode |
union { |
struct { |
// all of these bitfields should add up to 32 |