diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-12 21:33:02 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-12 21:33:02 +0000 |
commit | ace2269edfed9dfd3097597f1698921aaddf80a1 (patch) | |
tree | 5661ac65850a997a32307cbd4667e31ac4e1ce62 /src/pdf | |
parent | 01efe139af523702361bd917a1e33a6af3f014b6 (diff) |
Fixed a bug with linear gradient PDF matrices and added test cases
R=vandebo@chromium.org, reed@google.com
Author: richardlin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16094020
git-svn-id: http://skia.googlecode.com/svn/trunk@9553 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkPDFShader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index b52111e25d..a0dffb7791 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -37,8 +37,8 @@ static void unitToPointsMatrix(const SkPoint pts[2], SkMatrix* matrix) { vec.scale(inv); matrix->setSinCos(vec.fY, vec.fX); - matrix->preTranslate(pts[0].fX, pts[0].fY); matrix->preScale(mag, mag); + matrix->postTranslate(pts[0].fX, pts[0].fY); } /* Assumes t + startOffset is on the stack and does a linear interpolation on t @@ -609,8 +609,9 @@ SkPDFFunctionShader::SkPDFFunctionShader(SkPDFShader::State* state) SkMatrix mapperMatrix; unitToPointsMatrix(transformPoints, &mapperMatrix); SkMatrix finalMatrix = fState.get()->fCanvasTransform; - finalMatrix.preConcat(mapperMatrix); finalMatrix.preConcat(fState.get()->fShaderTransform); + finalMatrix.preConcat(mapperMatrix); + SkRect bbox; bbox.set(fState.get()->fBBox); if (!transformBBox(finalMatrix, &bbox)) { |