Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: src/pdf/SkPDFGraphicState.cpp

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698