[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
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index e6f1d7f..ace93ea 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -74,8 +74,9 @@
     }
 
     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 ");
         }