summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DeferredDisplayList.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-06-13 11:21:22 -0700
committerChris Craik <ccraik@google.com>2013-06-13 11:28:45 -0700
commitf70119cd776f871a82c94be8522dce02e04c73a8 (patch)
tree44663acd78d347dac3712baf69e3f617eb5b52e5 /libs/hwui/DeferredDisplayList.cpp
parent6db1054692495be7413d0fcc49a0f26c179d6fed (diff)
downloadframeworks_base-f70119cd776f871a82c94be8522dce02e04c73a8.zip
frameworks_base-f70119cd776f871a82c94be8522dce02e04c73a8.tar.gz
frameworks_base-f70119cd776f871a82c94be8522dce02e04c73a8.tar.bz2
Reset batching state when overlap batch deletion occurs
Change-Id: Ifdbee9baaa734e27d15d2b54aa3b3abfffbce1e9
Diffstat (limited to 'libs/hwui/DeferredDisplayList.cpp')
-rw-r--r--libs/hwui/DeferredDisplayList.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index 6bb54a7..f19d610 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -471,7 +471,9 @@ void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
deferInfo.opaqueOverBounds && op->state.mBounds.contains(mBounds)) {
+ // avoid overdraw by resetting drawing state + discarding drawing ops
discardDrawingBatches(mBatches.size() - 1);
+ resetBatchingState();
}
if (CC_UNLIKELY(renderer.getCaches().drawReorderDisabled)) {
@@ -551,10 +553,11 @@ void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
} else {
targetBatch = new DrawBatch(deferInfo);
mBatchLookup[deferInfo.batchId] = targetBatch;
- DEFER_LOGD("creating Batch %p, bid %x, at %d",
- targetBatch, deferInfo.batchId, insertBatchIndex);
}
+ DEFER_LOGD("creating %singBatch %p, bid %x, at %d",
+ deferInfo.mergeable ? "Merg" : "Draw",
+ targetBatch, deferInfo.batchId, insertBatchIndex);
mBatches.insertAt(targetBatch, insertBatchIndex);
}
@@ -633,8 +636,9 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
return status;
}
-void DeferredDisplayList::discardDrawingBatches(unsigned int maxIndex) {
+void DeferredDisplayList::discardDrawingBatches(const unsigned int maxIndex) {
for (unsigned int i = mEarliestUnclearedIndex; i <= maxIndex; i++) {
+ // leave deferred state ops alone for simplicity (empty save restore pairs may now exist)
if (mBatches[i] && mBatches[i]->purelyDrawBatch()) {
DrawBatch* b = (DrawBatch*) mBatches[i];
delete mBatches[i];