Index: include/gpu/GrPaint.h |
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h |
index 6a40a71ffcec425d4071e614a5397bda30796bea..f31830bb2bfa6d58361d9edfaef28f542d7dd7d9 100644 |
--- a/include/gpu/GrPaint.h |
+++ b/include/gpu/GrPaint.h |
@@ -12,6 +12,7 @@ |
#include "GrColor.h" |
#include "GrFragmentStage.h" |
+#include "GrXferProcessor.h" |
#include "SkXfermode.h" |
@@ -78,6 +79,11 @@ public: |
void setDither(bool dither) { fDither = dither; } |
bool isDither() const { return fDither; } |
+ const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { |
+ fXPFactory.reset(SkRef(xpFactory)); |
+ return xpFactory; |
+ } |
+ |
/** |
* Appends an additional color processor to the color computation. |
*/ |
@@ -109,6 +115,8 @@ public: |
int numCoverageStages() const { return fCoverageStages.count(); } |
int numTotalStages() const { return this->numColorStages() + this->numCoverageStages(); } |
+ const GrXPFactory* getXPFactory() const { return fXPFactory.get(); } |
+ |
const GrFragmentStage& getColorStage(int s) const { return fColorStages[s]; } |
const GrFragmentStage& getCoverageStage(int s) const { return fCoverageStages[s]; } |
@@ -123,6 +131,8 @@ public: |
fColorStages = paint.fColorStages; |
fCoverageStages = paint.fCoverageStages; |
+ fXPFactory.reset(SkRef(paint.getXPFactory())); |
+ |
return *this; |
} |
@@ -197,15 +207,16 @@ private: |
friend class GrContext; // To access above two functions |
friend class GrStencilAndCoverTextContext; // To access above two functions |
- SkSTArray<4, GrFragmentStage> fColorStages; |
- SkSTArray<2, GrFragmentStage> fCoverageStages; |
+ SkAutoTUnref<const GrXPFactory> fXPFactory; |
+ SkSTArray<4, GrFragmentStage> fColorStages; |
+ SkSTArray<2, GrFragmentStage> fCoverageStages; |
- GrBlendCoeff fSrcBlendCoeff; |
- GrBlendCoeff fDstBlendCoeff; |
- bool fAntiAlias; |
- bool fDither; |
+ GrBlendCoeff fSrcBlendCoeff; |
+ GrBlendCoeff fDstBlendCoeff; |
+ bool fAntiAlias; |
+ bool fDither; |
- GrColor fColor; |
+ GrColor fColor; |
void resetBlend() { |
fSrcBlendCoeff = kOne_GrBlendCoeff; |
@@ -221,10 +232,7 @@ private: |
fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); |
} |
- void resetStages() { |
- fColorStages.reset(); |
- fCoverageStages.reset(); |
- } |
+ void resetStages(); |
}; |
#endif |