Index: src/core/SkDraw.cpp |
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp |
index 9347efe475b4c9ade919e40a0864f1a5ce1e8867..24c80557168c8019adfb54f62e361520960b2c15 100644 |
--- a/src/core/SkDraw.cpp |
+++ b/src/core/SkDraw.cpp |
@@ -2403,7 +2403,13 @@ bool SkTriColorShader::TriColorShaderContext::setup(const SkPoint pts[], const S |
if (!m.invert(&im)) { |
return false; |
} |
- fDstToUnit.setConcat(im, this->getTotalInverse()); |
+ // We can't call getTotalInverse(), because we explicitly don't want to look at the localmatrix |
+ // as our interators are intrinsically tied to the vertices, and nothing else. |
+ SkMatrix ctmInv; |
+ if (!this->getCTM().invert(&ctmInv)) { |
+ return false; |
+ } |
+ fDstToUnit.setConcat(im, ctmInv); |
return true; |
} |
@@ -2556,18 +2562,13 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, |
VertState::Proc vertProc = state.chooseProc(vmode); |
if (NULL != textures || NULL != colors) { |
- SkMatrix tempM; |
- SkMatrix savedLocalM; |
- if (shader) { |
- savedLocalM = shader->getLocalMatrix(); |
- } |
- |
while (vertProc(&state)) { |
if (NULL != textures) { |
+ SkMatrix tempM; |
if (texture_to_matrix(state, vertices, textures, &tempM)) { |
- tempM.postConcat(savedLocalM); |
- shader->setLocalMatrix(tempM); |
- if (!blitter->resetShaderContext(*fBitmap, p, *fMatrix)) { |
+ SkShader::ContextRec rec(*fBitmap, p, *fMatrix); |
+ rec.fLocalMatrix = &tempM; |
+ if (!blitter->resetShaderContext(rec)) { |
continue; |
} |
} |
@@ -2603,11 +2604,6 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count, |
}; |
SkScan::FillTriangle(tmp, *fRC, blitter.get()); |
} |
- |
- // now restore the shader's original local matrix |
- if (NULL != shader) { |
- shader->setLocalMatrix(savedLocalM); |
- } |
} else { |
// no colors[] and no texture |
HairProc hairProc = ChooseHairProc(paint.isAntiAlias()); |