diff options
| author | 2015-05-28 22:03:06 +0000 | |
|---|---|---|
| committer | 2015-05-28 22:03:08 +0000 | |
| commit | 1cd7e4c3d0216cfb9a8a685ca8cf6f0d740a9dff (patch) | |
| tree | 2ae1662b8d6a4ff711e6ce621e690e4f6204c0f1 /libs/hwui/TessellationCache.cpp | |
| parent | 5cd795a9094eb02c983751ecabca6f24b0a01c58 (diff) | |
| parent | fca52b7583d1e5f5ff8ed06554875d2a30ef56fa (diff) | |
Merge "Use path intersection instead of saveLayer+mesh to mask projected ripples" into mnc-dev
Diffstat (limited to 'libs/hwui/TessellationCache.cpp')
| -rw-r--r-- | libs/hwui/TessellationCache.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp index fc173f7fb9c1..704a691128d4 100644 --- a/libs/hwui/TessellationCache.cpp +++ b/libs/hwui/TessellationCache.cpp @@ -207,6 +207,16 @@ static void mapPointFakeZ(Vector3& point, const mat4* transformXY, const mat4* t transformXY->mapPoint(point.x, point.y); } +static void reverseVertexArray(Vertex* polygon, int len) { + int n = len / 2; + for (int i = 0; i < n; i++) { + Vertex tmp = polygon[i]; + int k = len - 1 - i; + polygon[i] = polygon[k]; + polygon[k] = tmp; + } +} + static void tessellateShadows( const Matrix4* drawTransform, const Rect* localClip, bool isCasterOpaque, const SkPath* casterPerimeter, @@ -219,10 +229,9 @@ static void tessellateShadows( const float casterRefinementThresholdSquared = 4.0f; PathTessellator::approximatePathOutlineVertices(*casterPerimeter, casterRefinementThresholdSquared, casterVertices2d); - if (!ShadowTessellator::isClockwisePath(*casterPerimeter)) { - ShadowTessellator::reverseVertexArray(casterVertices2d.editArray(), - casterVertices2d.size()); - } + + // Shadow requires CCW for now. TODO: remove potential double-reverse + reverseVertexArray(casterVertices2d.editArray(), casterVertices2d.size()); if (casterVertices2d.size() == 0) return; |