From 6217a71cd281003a376d998269d577d26a61c206 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 15 Mar 2011 16:32:28 -0700 Subject: Fix performance issue in Launcher Bug #3515248 The problem is caused by the fast path when compositing layers on screen. The fast path draws a single quad using glDrawArrays() whereas the general path draws an arbitrary mesh using glDrawElements(). It looks like there's an issue in the driver since glDrawArrays() is significantly slower than glDrawElements() for a quad (6 vertices!) This change just gets rid of the fast path. Change-Id: Ib2361253ec67f44a988270f76c183422f12ce537 --- libs/hwui/LayerRenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs/hwui/LayerRenderer.cpp') diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index b1eb164..f92e20b 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -92,7 +92,11 @@ Region* LayerRenderer::getRegion() { void LayerRenderer::generateMesh() { #if RENDER_LAYERS_AS_REGIONS +#if RENDER_LAYERS_RECT_AS_RECT if (mLayer->region.isRect() || mLayer->region.isEmpty()) { +#else + if (mLayer->region.isEmpty()) { +#endif if (mLayer->mesh) { delete mLayer->mesh; delete mLayer->meshIndices; -- cgit v1.1