Loading libs/hwui/OpenGLRenderer.cpp +31 −7 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ OpenGLRenderer::OpenGLRenderer(): mFirstSnapshot = new Snapshot; mFrameStarted = false; mCountOverdraw = false; mExtendedTiling = false; mScissorOptimizationDisabled = false; } Loading Loading @@ -203,7 +203,7 @@ void OpenGLRenderer::setupFrameState(float left, float top, mTilingClip.set(left, top, right, bottom); } status_t OpenGLRenderer::startFrame() { status_t OpenGLRenderer::startFrame(bool useExTiling) { if (mFrameStarted) return DrawGlInfo::kStatusDone; mFrameStarted = true; Loading @@ -217,8 +217,12 @@ status_t OpenGLRenderer::startFrame() { // This ensures we don't use tiling when a functor is going to be // invoked during the frame mSuppressTiling = mCaches.hasRegisteredFunctors(); if (!mSuppressTiling) { startTiling(mSnapshot, true); } else if (useExTiling){ startTilingEx(mSnapshot); } debugOverdraw(true, true); Loading Loading @@ -304,10 +308,30 @@ void OpenGLRenderer::startTiling(const Rect& clip, int windowHeight, bool opaque } } void OpenGLRenderer::startTilingEx(const sp<Snapshot>& s) { Rect* clip = &mTilingClip; if (s->flags & Snapshot::kFlagFboTarget) { clip = &(s->layer->clipRect); } mCaches.startTiling(clip->left, s->height - clip->bottom, clip->right - clip->left, clip->bottom - clip->top, true); mExtendedTiling = true; } void OpenGLRenderer::endTiling() { if (!mSuppressTiling) mCaches.endTiling(); if (!mSuppressTiling) mCaches.endTiling(); else endTilingEx(); } void OpenGLRenderer::endTilingEx() { if (mExtendedTiling) { mCaches.endTiling(); mExtendedTiling = false; } } void OpenGLRenderer::finish() { renderOverdraw(); endTiling(); Loading Loading @@ -2043,7 +2067,7 @@ status_t OpenGLRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, // will be performed by the display list itself if (displayList && displayList->isRenderable()) { if (CC_UNLIKELY(mCaches.drawDeferDisabled)) { status = startFrame(); status = startFrame(true); ReplayStateStruct replayStruct(*this, dirty, replayFlags); displayList->replay(replayStruct, 0); return status | replayStruct.mDrawGlStatus; Loading @@ -2055,7 +2079,7 @@ status_t OpenGLRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, displayList->defer(deferStruct, 0); flushLayers(); status = startFrame(); status = startFrame(true); return status | deferredList.flush(*this, dirty); } Loading libs/hwui/OpenGLRenderer.h +6 −1 Original line number Diff line number Diff line Loading @@ -452,7 +452,7 @@ protected: * Indicates the start of rendering. This method will setup the * initial OpenGL state (viewport, clearing the buffer, etc.) */ status_t startFrame(); status_t startFrame(bool useExTiling = false); /** * Clears the underlying surface if needed. Loading Loading @@ -589,6 +589,7 @@ private: */ void startTiling(const sp<Snapshot>& snapshot, bool opaque = false); void startTilingEx(const sp<Snapshot>& snapshot); /** * Tells the GPU what part of the screen is about to be redrawn. * This method needs to be invoked every time getTargetFbo() is Loading @@ -602,6 +603,7 @@ private: */ void endTiling(); void endTilingEx(); /** * Saves the current state of the renderer as a new snapshot. * The new snapshot is saved in mSnapshot and the previous snapshot Loading Loading @@ -1117,6 +1119,9 @@ private: // No-ops start/endTiling when set bool mSuppressTiling; //tiling to avoid unresolves when set bool mExtendedTiling; // If true, this renderer will setup drawing to emulate // an increment stencil buffer in the color buffer bool mCountOverdraw; Loading Loading
libs/hwui/OpenGLRenderer.cpp +31 −7 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ OpenGLRenderer::OpenGLRenderer(): mFirstSnapshot = new Snapshot; mFrameStarted = false; mCountOverdraw = false; mExtendedTiling = false; mScissorOptimizationDisabled = false; } Loading Loading @@ -203,7 +203,7 @@ void OpenGLRenderer::setupFrameState(float left, float top, mTilingClip.set(left, top, right, bottom); } status_t OpenGLRenderer::startFrame() { status_t OpenGLRenderer::startFrame(bool useExTiling) { if (mFrameStarted) return DrawGlInfo::kStatusDone; mFrameStarted = true; Loading @@ -217,8 +217,12 @@ status_t OpenGLRenderer::startFrame() { // This ensures we don't use tiling when a functor is going to be // invoked during the frame mSuppressTiling = mCaches.hasRegisteredFunctors(); if (!mSuppressTiling) { startTiling(mSnapshot, true); } else if (useExTiling){ startTilingEx(mSnapshot); } debugOverdraw(true, true); Loading Loading @@ -304,10 +308,30 @@ void OpenGLRenderer::startTiling(const Rect& clip, int windowHeight, bool opaque } } void OpenGLRenderer::startTilingEx(const sp<Snapshot>& s) { Rect* clip = &mTilingClip; if (s->flags & Snapshot::kFlagFboTarget) { clip = &(s->layer->clipRect); } mCaches.startTiling(clip->left, s->height - clip->bottom, clip->right - clip->left, clip->bottom - clip->top, true); mExtendedTiling = true; } void OpenGLRenderer::endTiling() { if (!mSuppressTiling) mCaches.endTiling(); if (!mSuppressTiling) mCaches.endTiling(); else endTilingEx(); } void OpenGLRenderer::endTilingEx() { if (mExtendedTiling) { mCaches.endTiling(); mExtendedTiling = false; } } void OpenGLRenderer::finish() { renderOverdraw(); endTiling(); Loading Loading @@ -2043,7 +2067,7 @@ status_t OpenGLRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, // will be performed by the display list itself if (displayList && displayList->isRenderable()) { if (CC_UNLIKELY(mCaches.drawDeferDisabled)) { status = startFrame(); status = startFrame(true); ReplayStateStruct replayStruct(*this, dirty, replayFlags); displayList->replay(replayStruct, 0); return status | replayStruct.mDrawGlStatus; Loading @@ -2055,7 +2079,7 @@ status_t OpenGLRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, displayList->defer(deferStruct, 0); flushLayers(); status = startFrame(); status = startFrame(true); return status | deferredList.flush(*this, dirty); } Loading
libs/hwui/OpenGLRenderer.h +6 −1 Original line number Diff line number Diff line Loading @@ -452,7 +452,7 @@ protected: * Indicates the start of rendering. This method will setup the * initial OpenGL state (viewport, clearing the buffer, etc.) */ status_t startFrame(); status_t startFrame(bool useExTiling = false); /** * Clears the underlying surface if needed. Loading Loading @@ -589,6 +589,7 @@ private: */ void startTiling(const sp<Snapshot>& snapshot, bool opaque = false); void startTilingEx(const sp<Snapshot>& snapshot); /** * Tells the GPU what part of the screen is about to be redrawn. * This method needs to be invoked every time getTargetFbo() is Loading @@ -602,6 +603,7 @@ private: */ void endTiling(); void endTilingEx(); /** * Saves the current state of the renderer as a new snapshot. * The new snapshot is saved in mSnapshot and the previous snapshot Loading Loading @@ -1117,6 +1119,9 @@ private: // No-ops start/endTiling when set bool mSuppressTiling; //tiling to avoid unresolves when set bool mExtendedTiling; // If true, this renderer will setup drawing to emulate // an increment stencil buffer in the color buffer bool mCountOverdraw; Loading