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

Side by Side 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: Rebase to latest 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrBitmapTextContext.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 kConstA_GrBlendCoeff, //<! constant color alpha 227 kConstA_GrBlendCoeff, //<! constant color alpha
228 kIConstA_GrBlendCoeff, //<! one minus constant color alpha 228 kIConstA_GrBlendCoeff, //<! one minus constant color alpha
229 229
230 kPublicGrBlendCoeffCount 230 kPublicGrBlendCoeffCount
231 }; 231 };
232 232
233 /** 233 /**
234 * Formats for masks, used by the font cache. 234 * Formats for masks, used by the font cache.
235 * Important that these are 0-based. 235 * Important that these are 0-based.
236 */ 236 */
237 enum GrMaskFormat { 237 enum GrMaskFormat {
bsalomon 2013/12/03 18:52:10 Is this enum useful and does it belong in this hea
jvanverth1 2013/12/03 19:11:38 I don't think it needs to be public, but I suggest
238 kA8_GrMaskFormat, //!< 1-byte per pixel 238 kA8_GrMaskFormat, //!< 1-byte per pixel
239 kA565_GrMaskFormat, //!< 2-bytes per pixel 239 kA565_GrMaskFormat, //!< 2-bytes per pixel
240 kA888_GrMaskFormat, //!< 4-bytes per pixel 240 kA888_GrMaskFormat, //!< 4-bytes per pixel
241 kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format
241 242
242 kLast_GrMaskFormat = kA888_GrMaskFormat 243 kLast_GrMaskFormat = kARGB_GrMaskFormat
243 }; 244 };
244 static const int kMaskFormatCount = kLast_GrMaskFormat + 1; 245 static const int kMaskFormatCount = kLast_GrMaskFormat + 1;
245 246
246 /** 247 /**
247 * Return the number of bytes-per-pixel for the specified mask format. 248 * Return the number of bytes-per-pixel for the specified mask format.
248 */ 249 */
249 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { 250 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) {
250 SkASSERT((unsigned)format <= 2); 251 SkASSERT((unsigned)format <= 3);
251 // kA8 (0) -> 1 252 // kA8 (0) -> 1
252 // kA565 (1) -> 2 253 // kA565 (1) -> 2
253 // kA888 (2) -> 4 254 // kA888 (2) -> 4
254 return 1 << (int)format; 255 // kARGB (3) -> 4
256 static const int sBytesPerPixel[] = { 1, 2, 4, 4 };
257 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, array_ size_mismatch);
258
259 return sBytesPerPixel[(int) format];
255 } 260 }
256 261
257 /** 262 /**
258 * Pixel configurations. 263 * Pixel configurations.
259 */ 264 */
260 enum GrPixelConfig { 265 enum GrPixelConfig {
261 kUnknown_GrPixelConfig, 266 kUnknown_GrPixelConfig,
262 kAlpha_8_GrPixelConfig, 267 kAlpha_8_GrPixelConfig,
263 kIndex_8_GrPixelConfig, 268 kIndex_8_GrPixelConfig,
264 kRGB_565_GrPixelConfig, 269 kRGB_565_GrPixelConfig,
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 }; 618 };
614 619
615 /** 620 /**
616 * This value translates to reseting all the context state for any backend. 621 * This value translates to reseting all the context state for any backend.
617 */ 622 */
618 static const uint32_t kAll_GrBackendState = 0xffffffff; 623 static const uint32_t kAll_GrBackendState = 0xffffffff;
619 624
620 /////////////////////////////////////////////////////////////////////////////// 625 ///////////////////////////////////////////////////////////////////////////////
621 626
622 #endif 627 #endif
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698