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

Unified Diff: include/gpu/GrColor.h

Issue 13895006: Expand modulate, add, subtract, extract component glsl helpers. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrColor.h
===================================================================
--- include/gpu/GrColor.h (revision 8735)
+++ include/gpu/GrColor.h (working copy)
@@ -84,6 +84,23 @@
kB_GrColorComponentFlag | kA_GrColorComponentFlag)
};
+static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) {
+ GrAssert(GrIsPow2(component));
+ switch (component) {
+ case kR_GrColorComponentFlag:
+ return 'r';
+ case kG_GrColorComponentFlag:
+ return 'g';
+ case kB_GrColorComponentFlag:
+ return 'b';
+ case kA_GrColorComponentFlag:
+ return 'a';
+ default:
+ GrCrash("Invalid color component flag.");
+ return '\0';
+ }
+}
+
static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
GrAssert(config >= 0 && config < kGrPixelConfigCnt);
static const uint32_t kFlags[] = {
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698