OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkData.h" | 8 #include "SkData.h" |
9 #include "SkLazyPtr.h" | 9 #include "SkLazyPtr.h" |
10 #include "SkPDFCanon.h" | 10 #include "SkPDFCanon.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 case SkXfermode::kSrcOut_Mode: | 58 case SkXfermode::kSrcOut_Mode: |
59 case SkXfermode::kDstOut_Mode: | 59 case SkXfermode::kDstOut_Mode: |
60 case SkXfermode::kSrcATop_Mode: | 60 case SkXfermode::kSrcATop_Mode: |
61 case SkXfermode::kDstATop_Mode: | 61 case SkXfermode::kDstATop_Mode: |
62 case SkXfermode::kModulate_Mode: | 62 case SkXfermode::kModulate_Mode: |
63 return "Normal"; | 63 return "Normal"; |
64 | 64 |
65 // TODO(vandebo): Figure out if we can support more of these modes. | 65 // TODO(vandebo): Figure out if we can support more of these modes. |
66 case SkXfermode::kXor_Mode: | 66 case SkXfermode::kXor_Mode: |
67 case SkXfermode::kPlus_Mode: | 67 case SkXfermode::kPlus_Mode: |
68 return NULL; | 68 return nullptr; |
69 } | 69 } |
70 return NULL; | 70 return nullptr; |
71 } | 71 } |
72 | 72 |
73 // If a SkXfermode is unsupported in PDF, this function returns | 73 // If a SkXfermode is unsupported in PDF, this function returns |
74 // SrcOver, otherwise, it returns that Xfermode as a Mode. | 74 // SrcOver, otherwise, it returns that Xfermode as a Mode. |
75 static SkXfermode::Mode mode_for_pdf(const SkXfermode* xfermode) { | 75 static SkXfermode::Mode mode_for_pdf(const SkXfermode* xfermode) { |
76 SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode; | 76 SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode; |
77 if (xfermode) { | 77 if (xfermode) { |
78 xfermode->asMode(&mode); | 78 xfermode->asMode(&mode); |
79 } | 79 } |
80 switch (mode) { | 80 switch (mode) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 static_assert(SkPaint::kJoinCount == 3, "paint_join_mismatch"); | 222 static_assert(SkPaint::kJoinCount == 3, "paint_join_mismatch"); |
223 SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); | 223 SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); |
224 dict->insertInt("LJ", strokeJoin); | 224 dict->insertInt("LJ", strokeJoin); |
225 | 225 |
226 dict->insertScalar("LW", fStrokeWidth); | 226 dict->insertScalar("LW", fStrokeWidth); |
227 dict->insertScalar("ML", fStrokeMiter); | 227 dict->insertScalar("ML", fStrokeMiter); |
228 dict->insertBool("SA", true); // SA = Auto stroke adjustment. | 228 dict->insertBool("SA", true); // SA = Auto stroke adjustment. |
229 dict->insertName("BM", as_blend_mode(xferMode)); | 229 dict->insertName("BM", as_blend_mode(xferMode)); |
230 dict->emitObject(stream, objNumMap, substitutes); | 230 dict->emitObject(stream, objNumMap, substitutes); |
231 } | 231 } |
OLD | NEW |