summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2014-12-17 15:11:30 -0800
committer Chris Craik <ccraik@google.com> 2014-12-17 15:11:30 -0800
commita5f0918ec1931ee6c784f068e07d0aaa04525932 (patch)
tree6dfdc323590fee08e3beca2ef0f1dac8d0c248e4 /libs
parent4ff7aaf1a2d34b22e442a920c932fd552c17afc9 (diff)
parentfd461edee007a654dc163b397445cd071f04caf9 (diff)
resolved conflicts for merge of fd461ede to master
Change-Id: I36f263c7e6d96355dd8a2c3565581b9a983ae481
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/DeferredDisplayList.cpp11
-rw-r--r--libs/hwui/DeferredDisplayList.h5
-rwxr-xr-xlibs/hwui/OpenGLRenderer.cpp5
3 files changed, 13 insertions, 8 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index ea1d7149e456..7355baaebbe6 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -499,7 +499,7 @@ void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
deferInfo.mergeable &= !recordingComplexClip();
deferInfo.opaqueOverBounds &= !recordingComplexClip() && mSaveStack.isEmpty();
- if (mBatches.size() &&
+ if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
state->mClipSideFlags != kClipSide_ConservativeFull &&
deferInfo.opaqueOverBounds && state->mBounds.contains(mBounds)) {
// avoid overdraw by resetting drawing state + discarding drawing ops
@@ -647,12 +647,13 @@ void DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers();
renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
- for (unsigned int i = 1; i < mBatches.size(); i++) {
- if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
- discardDrawingBatches(i - 1);
+ if (CC_LIKELY(mAvoidOverdraw)) {
+ for (unsigned int i = 1; i < mBatches.size(); i++) {
+ if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
+ discardDrawingBatches(i - 1);
+ }
}
}
-
// NOTE: depth of the save stack at this point, before playback, should be reflected in
// FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
replayBatchList(mBatches, renderer, dirty);
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index fe70ec21c506..b6309ff525c9 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -81,8 +81,8 @@ public:
class DeferredDisplayList {
friend struct DeferStateStruct; // used to give access to allocator
public:
- DeferredDisplayList(const Rect& bounds) :
- mBounds(bounds) {
+ DeferredDisplayList(const Rect& bounds, bool avoidOverdraw = true) :
+ mBounds(bounds), mAvoidOverdraw(avoidOverdraw) {
clear();
}
~DeferredDisplayList() { clear(); }
@@ -150,6 +150,7 @@ private:
// layer space bounds of rendering
Rect mBounds;
+ const bool mAvoidOverdraw;
/**
* At defer time, stores the *defer time* savecount of save/saveLayer ops that were deferred, so
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 0150ac092a43..3f67f54a1c6f 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1919,7 +1919,10 @@ void OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t
return;
}
- DeferredDisplayList deferredList(*mState.currentClipRect());
+ // Don't avoid overdraw when visualizing, since that makes it harder to
+ // debug where it's coming from, and when the problem occurs.
+ bool avoidOverdraw = !mCaches.debugOverdraw;
+ DeferredDisplayList deferredList(*mState.currentClipRect(), avoidOverdraw);
DeferStateStruct deferStruct(deferredList, *this, replayFlags);
renderNode->defer(deferStruct, 0);