Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect
tessellation tasks.
Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index 2f714a1..30c6f5d 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -34,7 +34,7 @@
return a > b ? a : b;
}
-VertexBufferMode ShadowTessellator::tessellateAmbientShadow(bool isCasterOpaque,
+void ShadowTessellator::tessellateAmbientShadow(bool isCasterOpaque,
const Vector3* casterPolygon, int casterVertexCount,
const Vector3& centroid3d, const Rect& casterBounds,
const Rect& localClip, float maxZ, VertexBuffer& shadowVertexBuffer) {
@@ -57,16 +57,15 @@
#if DEBUG_SHADOW
ALOGD("Ambient shadow is out of clip rect!");
#endif
- return kVertexBufferMode_OnePolyRingShadow;
+ return;
}
- return AmbientShadow::createAmbientShadow(isCasterOpaque, casterPolygon,
+ AmbientShadow::createAmbientShadow(isCasterOpaque, casterPolygon,
casterVertexCount, centroid3d, heightFactor, geomFactor,
shadowVertexBuffer);
-
}
-VertexBufferMode ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
+void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
const Vector3* casterPolygon, int casterVertexCount,
const mat4& receiverTransform, const Vector3& lightCenter, int lightRadius,
const Rect& casterBounds, const Rect& localClip, VertexBuffer& shadowVertexBuffer) {
@@ -107,19 +106,17 @@
#if DEBUG_SHADOW
ALOGD("Spot shadow is out of clip rect!");
#endif
- return kVertexBufferMode_OnePolyRingShadow;
+ return;
}
- VertexBufferMode mode = SpotShadow::createSpotShadow(isCasterOpaque,
+ SpotShadow::createSpotShadow(isCasterOpaque,
casterPolygon, casterVertexCount, adjustedLightCenter, lightRadius,
lightVertexCount, shadowVertexBuffer);
-
#if DEBUG_SHADOW
if(shadowVertexBuffer.getVertexCount() <= 0) {
ALOGD("Spot shadow generation failed %d", shadowVertexBuffer.getVertexCount());
}
#endif
- return mode;
}
void ShadowTessellator::generateShadowIndices(uint16_t* shadowIndices) {