Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: src/gpu/GrXferProcessor.cpp

Issue 1132093004: Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (Closed) Base URL: https://skia.googlesource.com/skia.git@copy
Patch Set: remove asserts Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPipelineBuilder.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrXferProcessor.cpp
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp
index 343a05eaae36a17433b70bd8967362cd4d12c6cc..e771f643c7fbfaa46f8348cd2846e6b1e1e29a9a 100644
--- a/src/gpu/GrXferProcessor.cpp
+++ b/src/gpu/GrXferProcessor.cpp
@@ -9,17 +9,17 @@
#include "gl/GrGLCaps.h"
GrXferProcessor::GrXferProcessor()
- : fWillReadDstColor(false), fReadsCoverage(true), fDstCopyTextureOffset() {
+ : fWillReadDstColor(false), fReadsCoverage(true), fDstTextureOffset() {
}
-GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willReadDstColor)
+GrXferProcessor::GrXferProcessor(const DstTexture* dstTexture, bool willReadDstColor)
: fWillReadDstColor(willReadDstColor)
, fReadsCoverage(true)
- , fDstCopyTextureOffset() {
- if (dstCopy && dstCopy->texture()) {
- fDstCopy.reset(dstCopy->texture());
- fDstCopyTextureOffset = dstCopy->offset();
- this->addTextureAccess(&fDstCopy);
+ , fDstTextureOffset() {
+ if (dstTexture && dstTexture->texture()) {
+ fDstTexture.reset(dstTexture->texture());
+ fDstTextureOffset = dstTexture->offset();
+ this->addTextureAccess(&fDstTexture);
this->setWillReadFragmentPosition();
}
}
@@ -43,8 +43,8 @@ GrXferProcessor::OptFlags GrXferProcessor::getOptimizations(const GrProcOptInfo&
void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
- if (this->getDstCopyTexture() &&
- kTopLeft_GrSurfaceOrigin == this->getDstCopyTexture()->origin()) {
+ if (this->getDstTexture() &&
+ kTopLeft_GrSurfaceOrigin == this->getDstTexture()->origin()) {
key |= 0x2;
}
b->add32(key);
@@ -54,7 +54,7 @@ void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBu
bool GrXferProcessor::willNeedXferBarrier(const GrRenderTarget* rt,
const GrCaps& caps,
GrXferBarrierType* outBarrierType) const {
- if (static_cast<const GrSurface*>(rt) == this->getDstCopyTexture()) {
+ if (static_cast<const GrSurface*>(rt) == this->getDstTexture()) {
// Texture barriers are required when a shader reads and renders to the same texture.
SkASSERT(rt);
SkASSERT(caps.textureBarrierSupport());
@@ -162,25 +162,24 @@ SkString GrXferProcessor::BlendInfo::dump() const {
GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
- const GrDeviceCoordTexture* dstCopy,
+ const DstTexture* dstTexture,
const GrCaps& caps) const {
#ifdef SK_DEBUG
if (this->willReadDstColor(caps, colorPOI, coveragePOI)) {
if (!caps.shaderCaps()->dstReadInShaderSupport()) {
- SkASSERT(dstCopy && dstCopy->texture());
+ SkASSERT(dstTexture && dstTexture->texture());
} else {
- SkASSERT(!dstCopy || !dstCopy->texture());
+ SkASSERT(!dstTexture || !dstTexture->texture());
}
} else {
- SkASSERT(!dstCopy || !dstCopy->texture());
+ SkASSERT(!dstTexture || !dstTexture->texture());
}
#endif
- return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstCopy);
+ return this->onCreateXferProcessor(caps, colorPOI, coveragePOI, dstTexture);
}
-bool GrXPFactory::willNeedDstCopy(const GrCaps& caps, const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const {
+bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI) const {
return (this->willReadDstColor(caps, colorPOI, coveragePOI)
&& !caps.shaderCaps()->dstReadInShaderSupport());
}
-
« no previous file with comments | « src/gpu/GrPipelineBuilder.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698