aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-12-21 13:12:54 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-21 13:12:55 -0800
commit2047b7855546b21f7956c398592c070b3f91a9db (patch)
tree1d1c46f1e3248373f58c0d72b897077621b6ea00 /src/gpu/GrPipeline.h
parentbada1885da479d948f065182d6dfa85a1140bda5 (diff)
Don't ref/unref the static src-over xp
Diffstat (limited to 'src/gpu/GrPipeline.h')
-rw-r--r--src/gpu/GrPipeline.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index fbfe119ac0..60d0cab1ab 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -103,7 +103,15 @@ public:
}
int numFragmentProcessors() const { return fFragmentProcessors.count(); }
- const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(); }
+ const GrXferProcessor& getXferProcessor() const {
+ if (fXferProcessor.get()) {
+ return *fXferProcessor.get();
+ } else {
+ // A null xp member means the common src-over case. GrXferProcessor's ref'ing
+ // mechanism is not thread safe so we do not hold a ref on this global.
+ return GrPorterDuffXPFactory::SimpleSrcOverXP();
+ }
+ }
const GrFragmentProcessor& getColorFragmentProcessor(int idx) const {
SkASSERT(idx < this->numColorFragmentProcessors());
@@ -136,7 +144,7 @@ public:
bool snapVerticesToPixelCenters() const { return SkToBool(fFlags & kSnapVertices_Flag); }
GrXferBarrierType xferBarrierType(const GrCaps& caps) const {
- return fXferProcessor->xferBarrierType(fRenderTarget.get(), caps);
+ return this->getXferProcessor().xferBarrierType(fRenderTarget.get(), caps);
}
/**