Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: include/gpu/GrPaint.h

Issue 751283002: Add XferProcessor factory in GrPaint and GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comiple bug Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrInvariantOutput.h ('k') | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/gpu/GrInvariantOutput.h ('k') | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698