Loading libs/hwui/renderthread/CanvasContext.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -401,11 +401,11 @@ void CanvasContext::draw() { SkRect dirty; mDamageAccumulator.finish(&dirty); // TODO: Re-enable after figuring out cause of b/22592975 // if (dirty.isEmpty() && Properties::skipEmptyFrames) { // mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); // return; // } if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) { mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); return; } mCurrentFrameInfo->markIssueDrawCommandsStart(); Loading Loading @@ -638,6 +638,19 @@ int64_t CanvasContext::getFrameNumber() { return mFrameNumber; } bool CanvasContext::surfaceRequiresRedraw() { if (!mNativeSurface) return false; if (mHaveNewSurface) return true; int width = -1; int height = -1; ReliableSurface* surface = mNativeSurface.get(); surface->query(NATIVE_WINDOW_WIDTH, &width); surface->query(NATIVE_WINDOW_HEIGHT, &height); return width == mLastFrameWidth && height == mLastFrameHeight; } SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) { if (frame.width() != mLastFrameWidth || frame.height() != mLastFrameHeight) { // can't rely on prior content of window if viewport size changes Loading libs/hwui/renderthread/CanvasContext.h +1 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ private: void freePrefetchedLayers(); bool isSwapChainStuffed(); bool surfaceRequiresRedraw(); SkRect computeDirtyRect(const Frame& frame, SkRect* dirty); Loading Loading
libs/hwui/renderthread/CanvasContext.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -401,11 +401,11 @@ void CanvasContext::draw() { SkRect dirty; mDamageAccumulator.finish(&dirty); // TODO: Re-enable after figuring out cause of b/22592975 // if (dirty.isEmpty() && Properties::skipEmptyFrames) { // mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); // return; // } if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) { mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); return; } mCurrentFrameInfo->markIssueDrawCommandsStart(); Loading Loading @@ -638,6 +638,19 @@ int64_t CanvasContext::getFrameNumber() { return mFrameNumber; } bool CanvasContext::surfaceRequiresRedraw() { if (!mNativeSurface) return false; if (mHaveNewSurface) return true; int width = -1; int height = -1; ReliableSurface* surface = mNativeSurface.get(); surface->query(NATIVE_WINDOW_WIDTH, &width); surface->query(NATIVE_WINDOW_HEIGHT, &height); return width == mLastFrameWidth && height == mLastFrameHeight; } SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) { if (frame.width() != mLastFrameWidth || frame.height() != mLastFrameHeight) { // can't rely on prior content of window if viewport size changes Loading
libs/hwui/renderthread/CanvasContext.h +1 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ private: void freePrefetchedLayers(); bool isSwapChainStuffed(); bool surfaceRequiresRedraw(); SkRect computeDirtyRect(const Frame& frame, SkRect* dirty); Loading