[PDF] Fix gradient generation code (remove extra 'dup' in some cases)
authorvandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 22 Oct 2012 20:12:40 +0000 (20:12 +0000)
committervandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 22 Oct 2012 20:12:40 +0000 (20:12 +0000)
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

src/pdf/SkPDFShader.cpp

index e6f1d7f..ace93ea 100644 (file)
@@ -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 ");
         }