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

Side by Side Diff: include/core/SkImageInfo.h

Issue 870023002: Don't use SK_ASSERT in header. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 #ifndef SkImageInfo_DEFINED 8 #ifndef SkImageInfo_DEFINED
9 #define SkImageInfo_DEFINED 9 #define SkImageInfo_DEFINED
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 0, // Unknown 98 0, // Unknown
99 1, // Alpha_8 99 1, // Alpha_8
100 2, // RGB_565 100 2, // RGB_565
101 2, // ARGB_4444 101 2, // ARGB_4444
102 4, // RGBA_8888 102 4, // RGBA_8888
103 4, // BGRA_8888 103 4, // BGRA_8888
104 1, // kIndex_8 104 1, // kIndex_8
105 }; 105 };
106 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1), 106 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1),
107 size_mismatch_with_SkColorType_enum); 107 size_mismatch_with_SkColorType_enum);
108
109 SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize));
dshwang 2015/01/23 15:37:48 I think this ASSERT is covered by above SK_COMPILE
bsalomon 2015/01/23 15:55:50 I believe the assert is to guard against the case
110 return gSize[ct]; 108 return gSize[ct];
111 } 109 }
112 110
113 static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) { 111 static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) {
114 return width * SkColorTypeBytesPerPixel(ct); 112 return width * SkColorTypeBytesPerPixel(ct);
115 } 113 }
116 114
117 static inline bool SkColorTypeIsValid(unsigned value) { 115 static inline bool SkColorTypeIsValid(unsigned value) {
118 return value <= kLastEnum_SkColorType; 116 return value <= kLastEnum_SkColorType;
119 } 117 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 , fHeight(height) 296 , fHeight(height)
299 , fColorType(ct) 297 , fColorType(ct)
300 , fAlphaType(at) 298 , fAlphaType(at)
301 , fProfileType(pt) 299 , fProfileType(pt)
302 {} 300 {}
303 301
304 SkColorProfileType fProfileType; 302 SkColorProfileType fProfileType;
305 }; 303 };
306 304
307 #endif 305 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698