diff options
Diffstat (limited to 'libs/hwui/Program.h')
-rw-r--r-- | libs/hwui/Program.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h index f6ac8ec76da8..3e191d0a0186 100644 --- a/libs/hwui/Program.h +++ b/libs/hwui/Program.h @@ -45,18 +45,18 @@ namespace uirenderer { #define COLOR_COMPONENT_THRESHOLD 1.0f #define COLOR_COMPONENT_INV_THRESHOLD 0.0f -#define PROGRAM_KEY_TEXTURE 0x1 -#define PROGRAM_KEY_A8_TEXTURE 0x2 -#define PROGRAM_KEY_BITMAP 0x4 -#define PROGRAM_KEY_GRADIENT 0x8 -#define PROGRAM_KEY_BITMAP_FIRST 0x10 -#define PROGRAM_KEY_COLOR_MATRIX 0x20 -#define PROGRAM_KEY_COLOR_LIGHTING 0x40 -#define PROGRAM_KEY_COLOR_BLEND 0x80 -#define PROGRAM_KEY_BITMAP_NPOT 0x100 -#define PROGRAM_KEY_SWAP_SRC_DST 0x2000 - -#define PROGRAM_KEY_BITMAP_WRAPS_MASK 0x600 +#define PROGRAM_KEY_TEXTURE 0x01 +#define PROGRAM_KEY_A8_TEXTURE 0x02 +#define PROGRAM_KEY_BITMAP 0x04 +#define PROGRAM_KEY_GRADIENT 0x08 +#define PROGRAM_KEY_BITMAP_FIRST 0x10 +#define PROGRAM_KEY_COLOR_MATRIX 0x20 +#define PROGRAM_KEY_COLOR_BLEND 0x40 +#define PROGRAM_KEY_BITMAP_NPOT 0x80 + +#define PROGRAM_KEY_SWAP_SRC_DST 0x2000 + +#define PROGRAM_KEY_BITMAP_WRAPS_MASK 0x600 #define PROGRAM_KEY_BITMAP_WRAPT_MASK 0x1800 // Encode the xfermodes on 6 bits @@ -84,6 +84,7 @@ namespace uirenderer { #define PROGRAM_HAS_DEBUG_HIGHLIGHT 42 #define PROGRAM_EMULATE_STENCIL 43 +#define PROGRAM_HAS_ROUND_RECT_CLIP 44 /////////////////////////////////////////////////////////////////////////////// // Types @@ -104,7 +105,6 @@ struct ProgramDescription { enum ColorModifier { kColorNone = 0, kColorMatrix, - kColorLighting, kColorBlend }; @@ -160,6 +160,7 @@ struct ProgramDescription { bool hasDebugHighlight; bool emulateStencil; + bool hasRoundRectClip; /** * Resets this description. All fields are reset back to the default @@ -200,6 +201,8 @@ struct ProgramDescription { gamma = 2.2f; hasDebugHighlight = false; + emulateStencil = false; + hasRoundRectClip = false; } /** @@ -207,7 +210,7 @@ struct ProgramDescription { * the fragment shader. When this method returns true, the program should * be provided with a modulation color. */ - bool setColor(const float r, const float g, const float b, const float a) { + bool setColorModulate(const float a) { modulate = a < COLOR_COMPONENT_THRESHOLD; return modulate; } @@ -217,7 +220,7 @@ struct ProgramDescription { * the fragment shader. When this method returns true, the program should * be provided with a modulation color. */ - bool setAlpha8Color(const float r, const float g, const float b, const float a) { + bool setAlpha8ColorModulate(const float r, const float g, const float b, const float a) { modulate = a < COLOR_COMPONENT_THRESHOLD || r > COLOR_COMPONENT_INV_THRESHOLD || g > COLOR_COMPONENT_INV_THRESHOLD || b > COLOR_COMPONENT_INV_THRESHOLD; return modulate; @@ -248,9 +251,6 @@ struct ProgramDescription { case kColorMatrix: key |= PROGRAM_KEY_COLOR_MATRIX; break; - case kColorLighting: - key |= PROGRAM_KEY_COLOR_LIGHTING; - break; case kColorBlend: key |= PROGRAM_KEY_COLOR_BLEND; key |= (colorMode & PROGRAM_MAX_XFERMODE) << PROGRAM_XFERMODE_COLOR_OP_SHIFT; @@ -269,6 +269,7 @@ struct ProgramDescription { if (hasColors) key |= programid(0x1) << PROGRAM_HAS_COLORS; if (hasDebugHighlight) key |= programid(0x1) << PROGRAM_HAS_DEBUG_HIGHLIGHT; if (emulateStencil) key |= programid(0x1) << PROGRAM_EMULATE_STENCIL; + if (hasRoundRectClip) key |= programid(0x1) << PROGRAM_HAS_ROUND_RECT_CLIP; return key; } |