Index: src/gpu/GrXferProcessor.cpp |
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp |
index 476394f8009ae208a459e01415b5b746295a65ff..47e8cb648af18a43fb7a74217ee96a627909af74 100644 |
--- a/src/gpu/GrXferProcessor.cpp |
+++ b/src/gpu/GrXferProcessor.cpp |
@@ -32,6 +32,19 @@ void GrXferProcessor::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuil |
this->onGetGLProcessorKey(caps, b); |
} |
+bool GrXferProcessor::willNeedXferBarrier(const GrRenderTarget* rt, |
+ const GrDrawTargetCaps& caps, |
+ GrXferBarrierType* outBarrierType) const { |
+ if (static_cast<const GrSurface*>(rt) == this->getDstCopyTexture()) { |
+ // Texture barriers are required when a shader reads and renders to the same texture. |
+ SkASSERT(rt); |
+ SkASSERT(caps.textureBarrierSupport()); |
+ *outBarrierType = kTexture_GrXferBarrierType; |
+ return true; |
+ } |
+ return false; |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI, |