aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-08-04 10:56:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-04 10:56:40 -0700
commit0673676854da8051eb97515b601eb425b079e103 (patch)
tree512a31bb9b0f88165f10ab0fab68314ddb6d9893 /src
parentba59a67f916f0909815d9a5b93e0a2af528f5791 (diff)
Don't compare coord change matrices to determine effect compatibility when using explicit local coords.
R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/438053002
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDrawState.h8
-rw-r--r--src/gpu/gl/GrGLProgramEffects.cpp7
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index d1b7a66f5c..b894cb5a29 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -893,13 +893,17 @@ public:
fDrawFace != that.fDrawFace) {
return false;
}
+
+ bool explicitLocalCoords = this->hasLocalCoordAttribute();
for (int i = 0; i < fColorStages.count(); i++) {
- if (fColorStages[i] != that.fColorStages[i]) {
+ if (!GrEffectStage::AreCompatible(fColorStages[i], that.fColorStages[i],
+ explicitLocalCoords)) {
return false;
}
}
for (int i = 0; i < fCoverageStages.count(); i++) {
- if (fCoverageStages[i] != that.fCoverageStages[i]) {
+ if (!GrEffectStage::AreCompatible(fCoverageStages[i], that.fCoverageStages[i],
+ explicitLocalCoords)) {
return false;
}
}
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index cff31e29c2..3fa4f15ac8 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -90,8 +90,11 @@ GrCoordSet get_source_coords(uint32_t transformKey, int transformIdx) {
SkMatrix get_transform_matrix(const GrDrawEffect& drawEffect, int transformIdx) {
const GrCoordTransform& coordTransform = drawEffect.effect()->coordTransform(transformIdx);
SkMatrix combined;
- if (kLocal_GrCoordSet == coordTransform.sourceCoords() &&
- !drawEffect.programHasExplicitLocalCoords()) {
+
+ if (kLocal_GrCoordSet == coordTransform.sourceCoords()) {
+ // If we have explicit local coords then we shouldn't need a coord change.
+ SkASSERT(!drawEffect.programHasExplicitLocalCoords() ||
+ drawEffect.getCoordChangeMatrix().isIdentity());
combined.setConcat(coordTransform.getMatrix(), drawEffect.getCoordChangeMatrix());
} else {
combined = coordTransform.getMatrix();