summaryrefslogtreecommitdiff
path: root/core/SkDraw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/SkDraw.cpp')
-rw-r--r--core/SkDraw.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/core/SkDraw.cpp b/core/SkDraw.cpp
index 9347efe4..24c80557 100644
--- a/core/SkDraw.cpp
+++ b/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());