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

Side by Side Diff: include/gpu/GrTypes.h

Issue 1464543002: Remove unsigned < signed comparison. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 2010 Google Inc. 2 * Copyright 2010 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 GrTypes_DEFINED 8 #ifndef GrTypes_DEFINED
9 #define GrTypes_DEFINED 9 #define GrTypes_DEFINED
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format 173 kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format
174 174
175 kLast_GrMaskFormat = kARGB_GrMaskFormat 175 kLast_GrMaskFormat = kARGB_GrMaskFormat
176 }; 176 };
177 static const int kMaskFormatCount = kLast_GrMaskFormat + 1; 177 static const int kMaskFormatCount = kLast_GrMaskFormat + 1;
178 178
179 /** 179 /**
180 * Return the number of bytes-per-pixel for the specified mask format. 180 * Return the number of bytes-per-pixel for the specified mask format.
181 */ 181 */
182 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { 182 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) {
183 SkASSERT((unsigned)format < kMaskFormatCount); 183 SkASSERT(format < kMaskFormatCount);
184 // kA8 (0) -> 1 184 // kA8 (0) -> 1
185 // kA565 (1) -> 2 185 // kA565 (1) -> 2
186 // kARGB (2) -> 4 186 // kARGB (2) -> 4
187 static const int sBytesPerPixel[] = { 1, 2, 4 }; 187 static const int sBytesPerPixel[] = { 1, 2, 4 };
188 static_assert(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, "array_siz e_mismatch"); 188 static_assert(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, "array_siz e_mismatch");
189 static_assert(kA8_GrMaskFormat == 0, "enum_order_dependency"); 189 static_assert(kA8_GrMaskFormat == 0, "enum_order_dependency");
190 static_assert(kA565_GrMaskFormat == 1, "enum_order_dependency"); 190 static_assert(kA565_GrMaskFormat == 1, "enum_order_dependency");
191 static_assert(kARGB_GrMaskFormat == 2, "enum_order_dependency"); 191 static_assert(kARGB_GrMaskFormat == 2, "enum_order_dependency");
192 192
193 return sBytesPerPixel[(int) format]; 193 return sBytesPerPixel[(int) format];
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 return 4 * width * height; 638 return 4 * width * height;
639 } 639 }
640 } 640 }
641 641
642 /** 642 /**
643 * This value translates to reseting all the context state for any backend. 643 * This value translates to reseting all the context state for any backend.
644 */ 644 */
645 static const uint32_t kAll_GrBackendState = 0xffffffff; 645 static const uint32_t kAll_GrBackendState = 0xffffffff;
646 646
647 #endif 647 #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