## epoger will rebaseline by 25 Dec 2013
#gradtext
+#bsalomon: Slight AA changes to a rect in GPU configs after change that increases
+#batching
+bleed
+
memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexAttribIndices));
return *this;
}
+
+ static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b,
+ bool usingExplicitLocalCoords) {
+ SkASSERT(NULL != a.fEffect.get());
+ SkASSERT(NULL != b.fEffect.get());
- bool operator== (const GrEffectStage& other) const {
- SkASSERT(NULL != fEffect.get());
- SkASSERT(NULL != other.fEffect.get());
-
- if (!this->getEffect()->isEqual(*other.getEffect())) {
+ if (!a.getEffect()->isEqual(*b.getEffect())) {
return false;
}
- if (fCoordChangeMatrixSet != other.fCoordChangeMatrixSet) {
+ // We always track the coord change matrix, but it has no effect when explicit local coords
+ // are used.
+ if (usingExplicitLocalCoords) {
+ return true;
+ }
+
+ if (a.fCoordChangeMatrixSet != b.fCoordChangeMatrixSet) {
return false;
}
- if (!fCoordChangeMatrixSet) {
+ if (!a.fCoordChangeMatrixSet) {
return true;
}
- return fCoordChangeMatrix == other.fCoordChangeMatrix;
+ return a.fCoordChangeMatrix == b.fCoordChangeMatrix;
}
- bool operator!= (const GrEffectStage& s) const { return !(*this == s); }
-
/**
* This is called when the coordinate system in which the geometry is specified will change.
*
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;
}
}
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();