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

Unified Diff: include/gpu/GrTypes.h

Issue 99993002: Add GPU support for color bitmap fonts (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add ignored test Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index ff8f442f7d300ea4ae90e7bf89a3bc2f91259faf..44ead30745661f80b1964db4c7de878020caed11 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -238,8 +238,9 @@ enum GrMaskFormat {
kA8_GrMaskFormat, //!< 1-byte per pixel
kA565_GrMaskFormat, //!< 2-bytes per pixel
kA888_GrMaskFormat, //!< 4-bytes per pixel
+ kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format
- kLast_GrMaskFormat = kA888_GrMaskFormat
+ kLast_GrMaskFormat = kARGB_GrMaskFormat
};
static const int kMaskFormatCount = kLast_GrMaskFormat + 1;
@@ -247,11 +248,13 @@ static const int kMaskFormatCount = kLast_GrMaskFormat + 1;
* Return the number of bytes-per-pixel for the specified mask format.
*/
static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) {
- SkASSERT((unsigned)format <= 2);
+ SkASSERT((unsigned)format <= 3);
// kA8 (0) -> 1
// kA565 (1) -> 2
// kA888 (2) -> 4
- return 1 << (int)format;
+ // kARGB (3) -> 4
robertphillips 2013/12/02 21:05:40 can we have a static assert here r.e. "4 == kLast_
+ static int sBytesPerPixel[4] = { 1, 2, 4, 4 };
+ return sBytesPerPixel[(int) format];
}
/**

Powered by Google App Engine
This is Rietveld 408576698