From b0a9477c8e07d4530f07c78a5d20b4cde0fe8d60 Mon Sep 17 00:00:00 2001 From: Arun Date: Mon, 23 Jan 2017 11:41:06 +0000 Subject: Reduce hwui CPU time by using glDrawRangeElements The CPU overhead of glDrawElements in the GPU driver is significant with client-side vertex data (unique per draw call) as the driver has to calculate the mininimum and maximum indices from the index buffer in order to evaluate the range of vertex data required. This can be avoided by keeping track of the min-max in hwui and passing it with glDrawRangeElements. This requires OpenGL ES3.0 support (which is already checked for elsewhere in hwui). Test: manual - visual inspection on fugu (nexus player) Change-Id: I57bb1ddd239a1032f74f1cd2683bbe0970e84bd9 --- libs/hwui/GlopBuilder.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/hwui/GlopBuilder.cpp') diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp index e502725ddb09..8fcd1ea1f9fc 100644 --- a/libs/hwui/GlopBuilder.cpp +++ b/libs/hwui/GlopBuilder.cpp @@ -210,6 +210,7 @@ GlopBuilder& GlopBuilder::setMeshVertexBuffer(const VertexBuffer& vertexBuffer) alphaVertex ? kAlphaVertexStride : kVertexStride }; mOutGlop->mesh.elementCount = indices ? vertexBuffer.getIndexCount() : vertexBuffer.getVertexCount(); + mOutGlop->mesh.vertexCount = vertexBuffer.getVertexCount(); // used for glDrawRangeElements() return *this; } -- cgit v1.2.3-59-g8ed1b