summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListRenderer.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-03-14 18:05:08 -0700
committerRomain Guy <romainguy@google.com>2011-03-14 18:05:08 -0700
commit7b5b6abf852c039983eded25ebe43a70fef5a4ab (patch)
tree918c9bd4b35e0790a9d01fdf88bafd90b952101e /libs/hwui/DisplayListRenderer.cpp
parentc7fcc5076fb2988fba699a2167d19475fd58ed0b (diff)
downloadframeworks_base-7b5b6abf852c039983eded25ebe43a70fef5a4ab.zip
frameworks_base-7b5b6abf852c039983eded25ebe43a70fef5a4ab.tar.gz
frameworks_base-7b5b6abf852c039983eded25ebe43a70fef5a4ab.tar.bz2
Fix rendering artifact in edge fades.
Bug #4092053 The problem always existed but was made visible by partial invalidation. When saving a layer, the renderer would try to postpone glClear() operations until the next drawing command. This however does not work since the clip might have changed. The fix is rather simple and simply gets rid of this "optimization" (that turned out to be usless anyway given how View issues saveLayer() calls.) This change also fixes an issue with gradients (color stops where not properly computed when using a null stops array) and optimizes display lists rendering (quickly rejects larger portions of the tree to avoid executing unnecessary code.) Change-Id: I0f5b5f6e1220d41a09cc2fa84c212b0b4afd9c46
Diffstat (limited to 'libs/hwui/DisplayListRenderer.cpp')
-rw-r--r--libs/hwui/DisplayListRenderer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 737fa02..868290b 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -285,9 +285,12 @@ bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level)
break;
case DrawDisplayList: {
DisplayList* displayList = getDisplayList();
- DISPLAY_LIST_LOGD("%s%s %p, %d", (char*) indent, OP_NAMES[op],
- displayList, level + 1);
- needsInvalidate |= renderer.drawDisplayList(displayList, dirty, level + 1);
+ uint32_t width = getUInt();
+ uint32_t height = getUInt();
+ DISPLAY_LIST_LOGD("%s%s %p, %dx%d, %d", (char*) indent, OP_NAMES[op],
+ displayList, width, height, level + 1);
+ needsInvalidate |= renderer.drawDisplayList(displayList, width, height,
+ dirty, level + 1);
}
break;
case DrawLayer: {
@@ -674,11 +677,13 @@ bool DisplayListRenderer::clipRect(float left, float top, float right, float bot
return OpenGLRenderer::clipRect(left, top, right, bottom, op);
}
-bool DisplayListRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, uint32_t level) {
+bool DisplayListRenderer::drawDisplayList(DisplayList* displayList,
+ uint32_t width, uint32_t height, Rect& dirty, uint32_t level) {
// dirty is an out parameter and should not be recorded,
// it matters only when replaying the display list
addOp(DisplayList::DrawDisplayList);
addDisplayList(displayList);
+ addSize(width, height);
return false;
}