diff options
author | 2015-12-21 13:12:54 -0800 | |
---|---|---|
committer | 2015-12-21 13:12:55 -0800 | |
commit | 2047b7855546b21f7956c398592c070b3f91a9db (patch) | |
tree | 1d1c46f1e3248373f58c0d72b897077621b6ea00 /src/gpu/GrPipeline.h | |
parent | bada1885da479d948f065182d6dfa85a1140bda5 (diff) |
Don't ref/unref the static src-over xp
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1540363002
bug=chromium:570301
Review URL: https://codereview.chromium.org/1540363002
Diffstat (limited to 'src/gpu/GrPipeline.h')
-rw-r--r-- | src/gpu/GrPipeline.h | 12 |
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); } /** |