summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.h
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2014-08-11 16:00:44 -0700
committer Chris Craik <ccraik@google.com> 2014-08-12 12:44:59 -0700
commitbf75945e7a1ae7c1000682716643c942c1e19ba6 (patch)
tree5be8c8acfb85bb0a6077691e2c0255232cace2ae /libs/hwui/Program.h
parentc28aceb11e736382bc7ee749483ea5f23299ad78 (diff)
Rework shadow interpolation
bug:16852257 Use pow(alpha, 1.5) to avoid harsh edges on shadow alpha ramps. Also adjusts shadow constants to compensate. Change-Id: I5869956d7d292db2a8e496bc320084b6d64c3fb7
Diffstat (limited to 'libs/hwui/Program.h')
-rw-r--r--libs/hwui/Program.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index 3e191d0a0186..1d95c40b6233 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -72,19 +72,20 @@ namespace uirenderer {
#define PROGRAM_MODULATE_SHIFT 35
#define PROGRAM_HAS_AA_SHIFT 36
+#define PROGRAM_HAS_SHADOW_AA_SHIFT 37
-#define PROGRAM_HAS_EXTERNAL_TEXTURE_SHIFT 37
-#define PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT 38
+#define PROGRAM_HAS_EXTERNAL_TEXTURE_SHIFT 38
+#define PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT 39
-#define PROGRAM_HAS_GAMMA_CORRECTION 39
+#define PROGRAM_HAS_GAMMA_CORRECTION 40
-#define PROGRAM_IS_SIMPLE_GRADIENT 40
+#define PROGRAM_IS_SIMPLE_GRADIENT 41
-#define PROGRAM_HAS_COLORS 41
+#define PROGRAM_HAS_COLORS 42
-#define PROGRAM_HAS_DEBUG_HIGHLIGHT 42
-#define PROGRAM_EMULATE_STENCIL 43
-#define PROGRAM_HAS_ROUND_RECT_CLIP 44
+#define PROGRAM_HAS_DEBUG_HIGHLIGHT 43
+#define PROGRAM_EMULATE_STENCIL 44
+#define PROGRAM_HAS_ROUND_RECT_CLIP 45
///////////////////////////////////////////////////////////////////////////////
// Types
@@ -135,6 +136,7 @@ struct ProgramDescription {
bool isBitmapNpot;
bool isAA; // drawing with a per-vertex alpha
+ bool isShadowAA; // drawing per vertex alpha with shadow interpolation
bool hasGradient;
Gradient gradientType;
@@ -175,6 +177,7 @@ struct ProgramDescription {
hasColors = false;
isAA = false;
+ isShadowAA = false;
modulate = false;
@@ -262,6 +265,7 @@ struct ProgramDescription {
if (swapSrcDst) key |= PROGRAM_KEY_SWAP_SRC_DST;
if (modulate) key |= programid(0x1) << PROGRAM_MODULATE_SHIFT;
if (isAA) key |= programid(0x1) << PROGRAM_HAS_AA_SHIFT;
+ if (isShadowAA) key |= programid(0x1) << PROGRAM_HAS_SHADOW_AA_SHIFT;
if (hasExternalTexture) key |= programid(0x1) << PROGRAM_HAS_EXTERNAL_TEXTURE_SHIFT;
if (hasTextureTransform) key |= programid(0x1) << PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT;
if (hasGammaCorrection) key |= programid(0x1) << PROGRAM_HAS_GAMMA_CORRECTION;