aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawState.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrDrawState.h')
-rw-r--r--src/gpu/GrDrawState.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index c07001c3a3..3de33d82a7 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -209,10 +209,22 @@ public:
*/
const GrTexture* getTexture(int stage) const {
GrAssert((unsigned)stage < kNumStages);
+ GrAssert(!this->getSampler(stage).getCustomStage() ||
+ !fTextures[stage] ||
+ fTextures[stage] == this->getSampler(stage).getCustomStage()->texture(0));
+ if (this->getSampler(stage).getCustomStage()) {
+ return this->getSampler(stage).getCustomStage()->texture(0);
+ }
return fTextures[stage];
}
GrTexture* getTexture(int stage) {
GrAssert((unsigned)stage < kNumStages);
+ GrAssert(!this->getSampler(stage).getCustomStage() ||
+ !fTextures[stage] ||
+ fTextures[stage] == this->getSampler(stage).getCustomStage()->texture(0));
+ if (this->getSampler(stage).getCustomStage()) {
+ return this->getSampler(stage).getCustomStage()->texture(0);
+ }
return fTextures[stage];
}
@@ -811,7 +823,7 @@ public:
for (int i = 0; i < kNumStages; i++) {
SkSafeRef(fTextures[i]); // already copied by memcpy
- if (s.fTextures[i]) {
+ if (s.isStageEnabled(i)) {
this->fSamplerStates[i] = s.fSamplerStates[i];
}
}