aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrPaint.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-11-23 13:20:41 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-23 13:20:42 -0800
commitc4b72720e75313079212e69e46a5ef7c474b2305 (patch)
treeb0bf74db86503bd22684bb3107613db4e6625244 /include/gpu/GrPaint.h
parent60ce86d4718dab83f33488ec41710ad6763fc7f8 (diff)
Don't create a GXPFactory when blend is SrcOver
Diffstat (limited to 'include/gpu/GrPaint.h')
-rw-r--r--include/gpu/GrPaint.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 9d0fe5575e..152cb51d7e 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -57,7 +57,7 @@ public:
bool isAntiAlias() const { return fAntiAlias; }
const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
- fXPFactory.reset(SkRef(xpFactory));
+ fXPFactory.reset(SkSafeRef(xpFactory));
return xpFactory;
}
@@ -100,10 +100,7 @@ public:
this->numCoverageFragmentProcessors(); }
const GrXPFactory* getXPFactory() const {
- if (!fXPFactory) {
- fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode));
- }
- return fXPFactory.get();
+ return fXPFactory;
}
const GrFragmentProcessor* getColorFragmentProcessor(int i) const {
@@ -127,7 +124,7 @@ public:
fCoverageFragmentProcessors[i]->ref();
}
- fXPFactory.reset(SkRef(paint.getXPFactory()));
+ fXPFactory.reset(SkSafeRef(paint.getXPFactory()));
return *this;
}