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

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

Issue 12771010: Add a macro for querying the byte order of SkPMColor. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« include/core/SkPostConfig.h ('K') | « include/core/SkPostConfig.h ('k') | 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 /* 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 */ 284 */
285 kBGRA_8888_GrPixelConfig, 285 kBGRA_8888_GrPixelConfig,
286 286
287 kGrPixelConfigCount 287 kGrPixelConfigCount
288 }; 288 };
289 289
290 // Aliases for pixel configs that match skia's byte order. 290 // Aliases for pixel configs that match skia's byte order.
291 #ifndef SK_CPU_LENDIAN 291 #ifndef SK_CPU_LENDIAN
292 #error "Skia gpu currently assumes little endian" 292 #error "Skia gpu currently assumes little endian"
293 #endif 293 #endif
294 #if 24 == SK_A32_SHIFT && 16 == SK_R32_SHIFT && \ 294 #if SK_PM_BYTE_ORDER_IS(B,G,R,A)
295 8 == SK_G32_SHIFT && 0 == SK_B32_SHIFT
296 static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfi g; 295 static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfi g;
297 #elif 24 == SK_A32_SHIFT && 16 == SK_B32_SHIFT && \ 296 #elif SK_PM_BYTE_ORDER_IS(R,G,B,A)
298 8 == SK_G32_SHIFT && 0 == SK_R32_SHIFT
299 static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfi g; 297 static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfi g;
300 #else 298 #else
301 #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format." 299 #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
302 #endif 300 #endif
303 301
304 // Returns true if the pixel config is 32 bits per pixel 302 // Returns true if the pixel config is 32 bits per pixel
305 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { 303 static inline bool GrPixelConfigIs8888(GrPixelConfig config) {
306 switch (config) { 304 switch (config) {
307 case kRGBA_8888_GrPixelConfig: 305 case kRGBA_8888_GrPixelConfig:
308 case kBGRA_8888_GrPixelConfig: 306 case kBGRA_8888_GrPixelConfig:
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 /** 623 /**
626 * Handle to the 3D API object. 624 * Handle to the 3D API object.
627 * OpenGL: FBO ID 625 * OpenGL: FBO ID
628 */ 626 */
629 GrBackendObject fRenderTargetHandle; 627 GrBackendObject fRenderTargetHandle;
630 }; 628 };
631 629
632 /////////////////////////////////////////////////////////////////////////////// 630 ///////////////////////////////////////////////////////////////////////////////
633 631
634 #endif 632 #endif
OLDNEW
« include/core/SkPostConfig.h ('K') | « include/core/SkPostConfig.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698