From cc262b2b7b517a633c2c5936b71c1ab2551d5b2b Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 16 Sep 2011 16:59:52 -0700 Subject: [PATCH 1/2] work around a problem where fp registers get corrupted (DO NOT MERGE) Bug: 5331198 Change-Id: I1f9b4a79d34d63f8adb0555909998664ea2ea9ca --- libs/hwui/LayerRenderer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index 349b9e32268d2..a3986733a64ef 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -31,16 +31,20 @@ namespace uirenderer { // Rendering /////////////////////////////////////////////////////////////////////////////// +Rect* gHackDontCorruptRegisters; + void LayerRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) { LAYER_RENDERER_LOGD("Rendering into layer, fbo = %d", mLayer->getFbo()); + Rect dirty(left, top, right, bottom); + gHackDontCorruptRegisters = &dirty; + glBindFramebuffer(GL_FRAMEBUFFER, mLayer->getFbo()); const float width = mLayer->layer.getWidth(); const float height = mLayer->layer.getHeight(); #if RENDER_LAYERS_AS_REGIONS - Rect dirty(left, top, right, bottom); if (dirty.isEmpty() || (dirty.left <= 0 && dirty.top <= 0 && dirty.right >= width && dirty.bottom >= height)) { mLayer->region.clear(); From c31a448972fda0f5c223f80477956692ea5008f2 Mon Sep 17 00:00:00 2001 From: The Android Automerger Date: Sat, 17 Sep 2011 08:25:18 -0700 Subject: [PATCH 2/2] Revert "work around a problem where fp registers get corrupted (DO NOT MERGE)" This reverts commit cc262b2b7b517a633c2c5936b71c1ab2551d5b2b. --- libs/hwui/LayerRenderer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index a3986733a64ef..349b9e32268d2 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -31,20 +31,16 @@ namespace uirenderer { // Rendering /////////////////////////////////////////////////////////////////////////////// -Rect* gHackDontCorruptRegisters; - void LayerRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) { LAYER_RENDERER_LOGD("Rendering into layer, fbo = %d", mLayer->getFbo()); - Rect dirty(left, top, right, bottom); - gHackDontCorruptRegisters = &dirty; - glBindFramebuffer(GL_FRAMEBUFFER, mLayer->getFbo()); const float width = mLayer->layer.getWidth(); const float height = mLayer->layer.getHeight(); #if RENDER_LAYERS_AS_REGIONS + Rect dirty(left, top, right, bottom); if (dirty.isEmpty() || (dirty.left <= 0 && dirty.top <= 0 && dirty.right >= width && dirty.bottom >= height)) { mLayer->region.clear();