summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author ztenghui <ztenghui@google.com> 2014-08-13 15:48:02 -0700
committer ztenghui <ztenghui@google.com> 2014-08-29 13:40:42 -0700
commitd5e8ade498b41b42874273cbfa375aed7b4d6a08 (patch)
treebb2a44cdafde4f5a350e1531f276765f5b8bd18d /libs/hwui/OpenGLRenderer.cpp
parentc50a03d78aaedd0003377e98710e7038bda330e9 (diff)
Ambient shadow tessellation improvement.
Using the vertices, instead of ray casting for the triangulation. This request a dynamic index buffer associated with vertex buffer, so we update the VertexBuffer to support it. The ambient shadow could be 3x-6x times faster for circle and rect now. b/16712006 b/14257173 Change-Id: I2f22a8fe19bc59acee5c18e4a3a395acd5042a66
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rwxr-xr-xlibs/hwui/OpenGLRenderer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index bbf055116752..0f36c0658dd0 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2417,6 +2417,10 @@ status_t OpenGLRenderer::drawVertexBuffer(float translateX, float translateY,
} else if (mode == VertexBuffer::kTwoPolyRingShadow) {
mCaches.bindShadowIndicesBuffer();
glDrawElements(GL_TRIANGLE_STRIP, TWO_POLY_RING_SHADOW_INDEX_COUNT, GL_UNSIGNED_SHORT, 0);
+ } else if (mode == VertexBuffer::kIndices) {
+ mCaches.unbindIndicesBuffer();
+ glDrawElements(GL_TRIANGLE_STRIP, vertexBuffer.getIndexCount(), GL_UNSIGNED_SHORT,
+ vertexBuffer.getIndices());
}
if (isAA) {