aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrTexture.h1
-rw-r--r--src/gpu/GrDrawTarget.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 8274140adc..8e39fb55b5 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -94,6 +94,7 @@ public:
* render target
*/
GrRenderTarget* asRenderTarget() { return fRenderTarget; }
+ const GrRenderTarget* asRenderTarget() const { return fRenderTarget; }
/**
* Removes the reference on the associated GrRenderTarget held by this
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 730450b166..3e3ff51d45 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -771,6 +771,14 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
GrCrash("Index reads outside valid index range.");
}
}
+
+ GrAssert(NULL != this->getDrawState().getRenderTarget());
+ for (int i = 0; i < GrDrawState::kNumStages; ++i) {
+ if (this->getDrawState().getTexture(i)) {
+ GrAssert(this->getDrawState().getTexture(i)->asRenderTarget() !=
+ this->getDrawState().getRenderTarget());
+ }
+ }
#endif
const GrDrawState& drawState = this->getDrawState();
if (NULL == drawState.getRenderTarget()) {