summaryrefslogtreecommitdiffstats
path: root/libs/hwui/SpotShadow.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/SpotShadow.h')
-rw-r--r--libs/hwui/SpotShadow.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/libs/hwui/SpotShadow.h b/libs/hwui/SpotShadow.h
index d65ea89..355be8d 100644
--- a/libs/hwui/SpotShadow.h
+++ b/libs/hwui/SpotShadow.h
@@ -26,16 +26,22 @@ namespace uirenderer {
class SpotShadow {
public:
- static void createSpotShadow(bool isCasterOpaque, const Vector3* poly,
+ static void createSpotShadow_old(bool isCasterOpaque, const Vector3* poly,
int polyLength, const Vector3& lightCenter, float lightSize,
int lightVertexCount, VertexBuffer& retStrips);
+ static void createSpotShadow(bool isCasterOpaque, const Vector3& lightCenter,
+ float lightSize, const Vector3* poly, int polyLength,
+ const Vector3& polyCentroid, VertexBuffer& retstrips);
private:
+ static float projectCasterToOutline(Vector2& outline,
+ const Vector3& lightCenter, const Vector3& polyVertex);
static int calculateOccludedUmbra(const Vector2* umbra, int umbraLength,
const Vector3* poly, int polyLength, Vector2* occludedUmbra);
- static void computeSpotShadow(bool isCasterOpaque, const Vector3* lightPoly,
+
+ static void computeSpotShadow_old(bool isCasterOpaque, const Vector3* lightPoly,
int lightPolyLength, const Vector3& lightCenter, const Vector3* poly,
- int polyLength, VertexBuffer& retstrips);
+ int polyLength, VertexBuffer& shadowTriangleStrip);
static void computeLightPolygon(int points, const Vector3& lightCenter,
float size, Vector3* ret);
@@ -60,8 +66,8 @@ private:
static inline bool lineIntersection(double x1, double y1, double x2, double y2,
double x3, double y3, double x4, double y4, Vector2& ret);
- static void generateTriangleStrip(bool isCasterOpaque, const Vector2* penumbra,
- int penumbraLength, const Vector2* umbra, int umbraLength,
+ static void generateTriangleStrip(bool isCasterOpaque, float shadowStrengthScale,
+ const Vector2* penumbra, int penumbraLength, const Vector2* umbra, int umbraLength,
const Vector3* poly, int polyLength, VertexBuffer& retstrips);
#if DEBUG_SHADOW
@@ -72,6 +78,8 @@ private:
const Vector2* poly2, int poly2Length,
const Vector2* intersection, int intersectionLength);
static void updateBound(const Vector2 inVector, Vector2& lowerBound, Vector2& upperBound );
+ static void dumpPolygon(const Vector2* poly, int polyLength, const char* polyName);
+ static void dumpPolygon(const Vector3* poly, int polyLength, const char* polyName);
#endif
}; // SpotShadow