| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 dict->insertName("Type", "ExtGState"); | 203 dict->insertName("Type", "ExtGState"); |
| 204 | 204 |
| 205 SkScalar alpha = SkIntToScalar(fAlpha) / 0xFF; | 205 SkScalar alpha = SkIntToScalar(fAlpha) / 0xFF; |
| 206 dict->insertScalar("CA", alpha); | 206 dict->insertScalar("CA", alpha); |
| 207 dict->insertScalar("ca", alpha); | 207 dict->insertScalar("ca", alpha); |
| 208 | 208 |
| 209 SkPaint::Cap strokeCap = (SkPaint::Cap)fStrokeCap; | 209 SkPaint::Cap strokeCap = (SkPaint::Cap)fStrokeCap; |
| 210 SkPaint::Join strokeJoin = (SkPaint::Join)fStrokeJoin; | 210 SkPaint::Join strokeJoin = (SkPaint::Join)fStrokeJoin; |
| 211 SkXfermode::Mode xferMode = (SkXfermode::Mode)fMode; | 211 SkXfermode::Mode xferMode = (SkXfermode::Mode)fMode; |
| 212 | 212 |
| 213 SK_COMPILE_ASSERT(SkPaint::kButt_Cap == 0, paint_cap_mismatch); | 213 static_assert(SkPaint::kButt_Cap == 0, "paint_cap_mismatch"); |
| 214 SK_COMPILE_ASSERT(SkPaint::kRound_Cap == 1, paint_cap_mismatch); | 214 static_assert(SkPaint::kRound_Cap == 1, "paint_cap_mismatch"); |
| 215 SK_COMPILE_ASSERT(SkPaint::kSquare_Cap == 2, paint_cap_mismatch); | 215 static_assert(SkPaint::kSquare_Cap == 2, "paint_cap_mismatch"); |
| 216 SK_COMPILE_ASSERT(SkPaint::kCapCount == 3, paint_cap_mismatch); | 216 static_assert(SkPaint::kCapCount == 3, "paint_cap_mismatch"); |
| 217 SkASSERT(strokeCap >= 0 && strokeCap <= 2); | 217 SkASSERT(strokeCap >= 0 && strokeCap <= 2); |
| 218 dict->insertInt("LC", strokeCap); | 218 dict->insertInt("LC", strokeCap); |
| 219 | 219 |
| 220 SK_COMPILE_ASSERT(SkPaint::kMiter_Join == 0, paint_join_mismatch); | 220 static_assert(SkPaint::kMiter_Join == 0, "paint_join_mismatch"); |
| 221 SK_COMPILE_ASSERT(SkPaint::kRound_Join == 1, paint_join_mismatch); | 221 static_assert(SkPaint::kRound_Join == 1, "paint_join_mismatch"); |
| 222 SK_COMPILE_ASSERT(SkPaint::kBevel_Join == 2, paint_join_mismatch); | 222 static_assert(SkPaint::kBevel_Join == 2, "paint_join_mismatch"); |
| 223 SK_COMPILE_ASSERT(SkPaint::kJoinCount == 3, paint_join_mismatch); | 223 static_assert(SkPaint::kJoinCount == 3, "paint_join_mismatch"); |
| 224 SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); | 224 SkASSERT(strokeJoin >= 0 && strokeJoin <= 2); |
| 225 dict->insertInt("LJ", strokeJoin); | 225 dict->insertInt("LJ", strokeJoin); |
| 226 | 226 |
| 227 dict->insertScalar("LW", fStrokeWidth); | 227 dict->insertScalar("LW", fStrokeWidth); |
| 228 dict->insertScalar("ML", fStrokeMiter); | 228 dict->insertScalar("ML", fStrokeMiter); |
| 229 dict->insertBool("SA", true); // SA = Auto stroke adjustment. | 229 dict->insertBool("SA", true); // SA = Auto stroke adjustment. |
| 230 dict->insertName("BM", as_blend_mode(xferMode)); | 230 dict->insertName("BM", as_blend_mode(xferMode)); |
| 231 dict->emitObject(stream, objNumMap, substitutes); | 231 dict->emitObject(stream, objNumMap, substitutes); |
| 232 } | 232 } |
| OLD | NEW |