aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrPaint.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-01-09 16:00:33 +0000
committerGravatar Brian Salomon <bsalomon@google.com>2017-01-09 16:08:13 +0000
commit003312a211e65f35e402d6fe80a32e23d4c94ac4 (patch)
tree61635d3df8e7bf873c0ea08b211da03521b8a477 /include/gpu/GrPaint.h
parenta8f80de2bc17672b4b6f26d3cf6b38123ac850c9 (diff)
Revert "Removing ref counting from GrXPFactory."
This reverts commit a8f80de2bc17672b4b6f26d3cf6b38123ac850c9. Reason for revert: nanobench failing on windows bots, possibly others Change-Id: Iacb8c650064a28654c165665be057377ffb02ba5 Reviewed-on: https://skia-review.googlesource.com/6802 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/GrPaint.h')
-rw-r--r--include/gpu/GrPaint.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 6bbd66cbce..6cdc2de09c 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -84,9 +84,13 @@ public:
setAllowSRGBInputs(gammaCorrect);
}
- void setXPFactory(const GrXPFactory* xpFactory) { fXPFactory = xpFactory; }
+ void setXPFactory(sk_sp<GrXPFactory> xpFactory) {
+ fXPFactory = std::move(xpFactory);
+ }
- void setPorterDuffXPFactory(SkBlendMode mode) { fXPFactory = GrPorterDuffXPFactory::Get(mode); }
+ void setPorterDuffXPFactory(SkBlendMode mode) {
+ fXPFactory = GrPorterDuffXPFactory::Make(mode);
+ }
void setCoverageSetOpXPFactory(SkRegion::Op, bool invertCoverage = false);
@@ -123,7 +127,9 @@ public:
int numTotalFragmentProcessors() const { return this->numColorFragmentProcessors() +
this->numCoverageFragmentProcessors(); }
- const GrXPFactory* getXPFactory() const { return fXPFactory; }
+ GrXPFactory* getXPFactory() const {
+ return fXPFactory.get();
+ }
GrFragmentProcessor* getColorFragmentProcessor(int i) const {
return fColorFragmentProcessors[i].get();
@@ -167,7 +173,7 @@ public:
private:
bool internalIsConstantBlendedColor(GrColor paintColor, GrColor* constantColor) const;
- const GrXPFactory* fXPFactory;
+ mutable sk_sp<GrXPFactory> fXPFactory;
SkSTArray<4, sk_sp<GrFragmentProcessor>> fColorFragmentProcessors;
SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors;