Loading libs/hwui/DeferredDisplayList.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -525,7 +525,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 Loading Loading @@ -677,12 +677,13 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) { DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers(); renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); 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 status |= replayBatchList(mBatches, renderer, dirty); Loading libs/hwui/DeferredDisplayList.h +3 −2 Original line number Diff line number Diff line Loading @@ -81,8 +81,8 @@ public: class DeferredDisplayList { friend class 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(); } Loading Loading @@ -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 Loading libs/hwui/OpenGLRenderer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -1912,7 +1912,10 @@ status_t OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int return status | replayStruct.mDrawGlStatus; } DeferredDisplayList deferredList(*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(*currentClipRect(), avoidOverdraw); DeferStateStruct deferStruct(deferredList, *this, replayFlags); renderNode->defer(deferStruct, 0); Loading Loading
libs/hwui/DeferredDisplayList.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -525,7 +525,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 Loading Loading @@ -677,12 +677,13 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) { DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers(); renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); 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 status |= replayBatchList(mBatches, renderer, dirty); Loading
libs/hwui/DeferredDisplayList.h +3 −2 Original line number Diff line number Diff line Loading @@ -81,8 +81,8 @@ public: class DeferredDisplayList { friend class 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(); } Loading Loading @@ -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 Loading
libs/hwui/OpenGLRenderer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -1912,7 +1912,10 @@ status_t OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int return status | replayStruct.mDrawGlStatus; } DeferredDisplayList deferredList(*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(*currentClipRect(), avoidOverdraw); DeferStateStruct deferStruct(deferredList, *this, replayFlags); renderNode->defer(deferStruct, 0); Loading