Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index 00f6a8ad804a342bfbfd134c0e88ecc5bf4598eb..0ccc659f48a6fba82d56eced6cb6a17ba9b7c87e 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -78,8 +78,20 @@ bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuil |
if (!pipelineBuilder.willXPNeedDstCopy(*this->caps(), colorPOI, coveragePOI)) { |
return true; |
} |
- SkIRect copyRect; |
+ |
GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
+ |
+ if (this->caps()->textureBarrierSupport()) { |
+ if (GrTexture* rtTex = rt->asTexture()) { |
+ // The render target is a texture, se we can read from it directly in the shader. The XP |
+ // will be responsible to detect this situation and request a texture barrier. |
+ dstCopy->setTexture(rtTex); |
+ dstCopy->setOffset(0, 0); |
+ return true; |
+ } |
+ } |
+ |
+ SkIRect copyRect; |
pipelineBuilder.clip().getConservativeBounds(rt, ©Rect); |
if (drawBounds) { |