Index: src/gpu/GrXferProcessor.cpp |
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp |
index a95445e287825db5934a55f27f7c4cf88da104ee..43f40c515809deba0fdcb002051d5db97e673698 100644 |
--- a/src/gpu/GrXferProcessor.cpp |
+++ b/src/gpu/GrXferProcessor.cpp |
@@ -10,7 +10,7 @@ |
#include "GrProcOptInfo.h" |
#include "gl/GrGLCaps.h" |
-GrXferProcessor::GrXferProcessor() |
+GrXferProcessor::GrXferProcessor(GrRenderTarget* dst) |
: fWillReadDstColor(false) |
, fDstReadUsesMixedSamples(false) |
, fReadsCoverage(true) |
@@ -19,14 +19,15 @@ GrXferProcessor::GrXferProcessor() |
GrXferProcessor::GrXferProcessor(const DstTexture* dstTexture, |
bool willReadDstColor, |
- bool hasMixedSamples) |
+ bool hasMixedSamples, |
+ GrRenderTarget* dst) |
: fWillReadDstColor(willReadDstColor) |
, fDstReadUsesMixedSamples(willReadDstColor && hasMixedSamples) |
, fReadsCoverage(true) |
, fDstTextureOffset() { |
if (dstTexture && dstTexture->texture()) { |
SkASSERT(willReadDstColor); |
- fDstTexture.reset(dstTexture->texture()); |
+ fDstTexture.reset(dstTexture->texture(), GrTextureParams::kNone_FilterMode,SkShader::kClamp_TileMode, dst); |
fDstTextureOffset = dstTexture->offset(); |
this->addTextureAccess(&fDstTexture); |
this->setWillReadFragmentPosition(); |
@@ -204,9 +205,11 @@ GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI, |
const GrProcOptInfo& coveragePOI, |
bool hasMixedSamples, |
const DstTexture* dstTexture, |
- const GrCaps& caps) const { |
+ const GrCaps& caps, GrRenderTarget* dst) const { |
#ifdef SK_DEBUG |
- if (this->willReadDstColor(caps, colorPOI, coveragePOI, hasMixedSamples)) { |
+ bool willReadDstColor = this->willReadDstColor(caps, colorPOI, coveragePOI, hasMixedSamples); |
+ |
+ if (willReadDstColor) { |
if (!caps.shaderCaps()->dstReadInShaderSupport()) { |
SkASSERT(dstTexture && dstTexture->texture()); |
} else { |
@@ -217,7 +220,7 @@ GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI, |
} |
SkASSERT(!hasMixedSamples || caps.shaderCaps()->dualSourceBlendingSupport()); |
#endif |
- return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, hasMixedSamples, dstTexture); |
+ return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, hasMixedSamples, dstTexture, dst); |
} |
bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, |