aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-22 20:12:40 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-22 20:12:40 +0000
commitb862204352f1a6028e0bfafd25df1cbca114208b (patch)
treec82300074c34714628e8ea877b339d5393622a24
parentce8a195111246e2f84d1414f78e6c2112d9f8ee9 (diff)
[PDF] Fix gradient generation code (remove extra 'dup' in some cases)
Fixes http://crbug.com/157006 Review URL: https://codereview.appspot.com/6733061 git-svn-id: http://skia.googlecode.com/svn/trunk@6035 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/pdf/SkPDFShader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index e6f1d7f108..ace93ea73c 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -74,8 +74,9 @@ static void interpolateColorCode(SkScalar range, SkScalar* curColor,
}
for (int i = 0; i < components; i++) {
- // If the next components needs t, make a copy.
- if (dupInput[i]) {
+ // If the next components needs t and this component will consume a
+ // copy, make another copy.
+ if (dupInput[i] && multiplier[i] != 0) {
result->append("dup ");
}