From 7c25aab491707f7324f9941b8cfa9bd2b4b97e76 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 18 Oct 2012 15:05:02 -0700 Subject: Defer layer rendering to avoid stalls Bug #7326824 When a layer is taken out of the cache and initialized it gets cleared to prepare it for future rendering. This triggers the following sequence of operations: glBindFramebuffer(layer.fbo) attach texture storage to FBO glClear() glBindFramebuffer(defaultFbo) The clear forces a resolve on tilers which stalls the CPU for a little while, thus producing jank during animations. This change moves the clear to the next frame when we know we will have to execute a resolve anyway. Change-Id: Ic1939c25df20ed65a4c48dc81ee549b2cd8b6ec3 --- libs/hwui/Layer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/hwui/Layer.cpp') diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp index 882e4bbc4bb1..1cdc06306be4 100644 --- a/libs/hwui/Layer.cpp +++ b/libs/hwui/Layer.cpp @@ -31,6 +31,7 @@ Layer::Layer(const uint32_t layerWidth, const uint32_t layerHeight) { meshIndices = NULL; meshElementCount = 0; cacheable = true; + dirty = false; textureLayer = false; renderTarget = GL_TEXTURE_2D; texture.width = layerWidth; -- cgit v1.2.3-59-g8ed1b