summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-06-17 21:02:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-17 21:02:56 +0000
commit36d38cb904556025b76c6d98f9fe2ccfa1c8a304 (patch)
treece339566cfe52d099f529241460fcac508fdcda6 /libs/hwui
parentf0542ee466372a29ebaa3c1ea1f362c353a28f4a (diff)
parentd72b73cea49f29c41661e55eb6bfdbc04f09d809 (diff)
downloadframeworks_base-36d38cb904556025b76c6d98f9fe2ccfa1c8a304.zip
frameworks_base-36d38cb904556025b76c6d98f9fe2ccfa1c8a304.tar.gz
frameworks_base-36d38cb904556025b76c6d98f9fe2ccfa1c8a304.tar.bz2
Merge "Better handle op size edge cases"
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DeferredDisplayList.cpp1
-rw-r--r--libs/hwui/DisplayListOp.h5
-rw-r--r--libs/hwui/OpenGLRenderer.cpp6
-rw-r--r--libs/hwui/OpenGLRenderer.h3
4 files changed, 10 insertions, 5 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index c21ee1e..887e822 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -491,6 +491,7 @@ void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
deferInfo.mergeable &= !recordingComplexClip();
if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
+ op->state.mClipSideFlags != kClipSide_ConservativeFull &&
deferInfo.opaqueOverBounds && op->state.mBounds.contains(mBounds)) {
// avoid overdraw by resetting drawing state + discarding drawing ops
discardDrawingBatches(mBatches.size() - 1);
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 290e4fa..6b7bac0 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -129,7 +129,10 @@ public:
return;
}
- if (!getLocalBounds(state.mBounds)) {
+ if (getLocalBounds(state.mBounds)) {
+ // valid empty bounds, don't bother deferring
+ if (state.mBounds.isEmpty()) return;
+ } else {
// empty bounds signify bounds can't be calculated
state.mBounds.setEmpty();
}
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 5cf029d..73d458d 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1407,9 +1407,9 @@ bool OpenGLRenderer::storeDisplayState(DeferredDisplayState& state, int stateDef
}
state.mBounds.set(clippedBounds);
} else {
- // If we don't have bounds, let's assume we're clipped
- // to prevent merging
- state.mClipSideFlags = kClipSide_Full;
+ // Empty bounds implies size unknown. Label op as conservatively clipped to disable
+ // overdraw avoidance (since we don't know what it overlaps)
+ state.mClipSideFlags = kClipSide_ConservativeFull;
state.mBounds.set(currentClip);
}
}
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index b9117dd..0760f9c 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -86,7 +86,8 @@ enum ClipSideFlags {
kClipSide_Top = 0x2,
kClipSide_Right = 0x4,
kClipSide_Bottom = 0x8,
- kClipSide_Full = 0xF
+ kClipSide_Full = 0xF,
+ kClipSide_ConservativeFull = 0x1F
};
struct DeferredDisplayState {