Loading core/java/android/view/ThreadedRenderer.java +6 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,12 @@ public final class ThreadedRenderer { private static final int SYNC_INVALIDATE_REQUIRED = 1 << 0; // Spoiler: the reward is GPU-accelerated drawing, better find that Surface! private static final int SYNC_LOST_SURFACE_REWARD_IF_FOUND = 1 << 1; // setStopped is true, drawing is false // TODO: Remove this and SYNC_LOST_SURFACE_REWARD_IF_FOUND? // This flag isn't really used as there's nothing that we care to do // in response, so it really just exists to differentiate from LOST_SURFACE // but possibly both can just be deleted. private static final int SYNC_CONTEXT_IS_STOPPED = 1 << 2; private static final String[] VISUALIZERS = { PROFILE_PROPERTY_VISUALIZE_BARS, Loading libs/hwui/renderthread/DrawFrameTask.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ namespace renderthread { DrawFrameTask::DrawFrameTask() : mRenderThread(nullptr) , mContext(nullptr) , mSyncResult(kSync_OK) { , mSyncResult(SyncResult::OK) { } DrawFrameTask::~DrawFrameTask() { Loading Loading @@ -68,7 +68,7 @@ void DrawFrameTask::removeLayerUpdate(DeferredLayerUpdater* layer) { int DrawFrameTask::drawFrame(TreeObserver* observer) { LOG_ALWAYS_FATAL_IF(!mContext, "Cannot drawFrame with no CanvasContext!"); mSyncResult = kSync_OK; mSyncResult = SyncResult::OK; mSyncQueued = systemTime(CLOCK_MONOTONIC); mObserver = observer; postAndWait(); Loading Loading @@ -127,13 +127,18 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) { // This is after the prepareTree so that any pending operations // (RenderNode tree state, prefetched layers, etc...) will be flushed. if (CC_UNLIKELY(!mContext->hasSurface() || !canDraw)) { mSyncResult |= kSync_LostSurfaceRewardIfFound; if (!mContext->hasSurface()) { mSyncResult |= SyncResult::LostSurfaceRewardIfFound; } else { // If we have a surface but can't draw we must be stopped mSyncResult |= SyncResult::ContextIsStopped; } info.out.canDrawThisFrame = false; } if (info.out.hasAnimations) { if (info.out.requiresUiRedraw) { mSyncResult |= kSync_UIRedrawRequired; mSyncResult |= SyncResult::UIRedrawRequired; } } // If prepareTextures is false, we ran out of texture cache space Loading libs/hwui/renderthread/DrawFrameTask.h +7 −4 Original line number Diff line number Diff line Loading @@ -40,11 +40,14 @@ namespace renderthread { class CanvasContext; class RenderThread; enum SyncResult { kSync_OK = 0, kSync_UIRedrawRequired = 1 << 0, kSync_LostSurfaceRewardIfFound = 1 << 1, namespace SyncResult { enum { OK = 0, UIRedrawRequired = 1 << 0, LostSurfaceRewardIfFound = 1 << 1, ContextIsStopped = 1 << 2, }; } /* * This is a special Super Task. It is re-used multiple times by RenderProxy, Loading Loading
core/java/android/view/ThreadedRenderer.java +6 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,12 @@ public final class ThreadedRenderer { private static final int SYNC_INVALIDATE_REQUIRED = 1 << 0; // Spoiler: the reward is GPU-accelerated drawing, better find that Surface! private static final int SYNC_LOST_SURFACE_REWARD_IF_FOUND = 1 << 1; // setStopped is true, drawing is false // TODO: Remove this and SYNC_LOST_SURFACE_REWARD_IF_FOUND? // This flag isn't really used as there's nothing that we care to do // in response, so it really just exists to differentiate from LOST_SURFACE // but possibly both can just be deleted. private static final int SYNC_CONTEXT_IS_STOPPED = 1 << 2; private static final String[] VISUALIZERS = { PROFILE_PROPERTY_VISUALIZE_BARS, Loading
libs/hwui/renderthread/DrawFrameTask.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ namespace renderthread { DrawFrameTask::DrawFrameTask() : mRenderThread(nullptr) , mContext(nullptr) , mSyncResult(kSync_OK) { , mSyncResult(SyncResult::OK) { } DrawFrameTask::~DrawFrameTask() { Loading Loading @@ -68,7 +68,7 @@ void DrawFrameTask::removeLayerUpdate(DeferredLayerUpdater* layer) { int DrawFrameTask::drawFrame(TreeObserver* observer) { LOG_ALWAYS_FATAL_IF(!mContext, "Cannot drawFrame with no CanvasContext!"); mSyncResult = kSync_OK; mSyncResult = SyncResult::OK; mSyncQueued = systemTime(CLOCK_MONOTONIC); mObserver = observer; postAndWait(); Loading Loading @@ -127,13 +127,18 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) { // This is after the prepareTree so that any pending operations // (RenderNode tree state, prefetched layers, etc...) will be flushed. if (CC_UNLIKELY(!mContext->hasSurface() || !canDraw)) { mSyncResult |= kSync_LostSurfaceRewardIfFound; if (!mContext->hasSurface()) { mSyncResult |= SyncResult::LostSurfaceRewardIfFound; } else { // If we have a surface but can't draw we must be stopped mSyncResult |= SyncResult::ContextIsStopped; } info.out.canDrawThisFrame = false; } if (info.out.hasAnimations) { if (info.out.requiresUiRedraw) { mSyncResult |= kSync_UIRedrawRequired; mSyncResult |= SyncResult::UIRedrawRequired; } } // If prepareTextures is false, we ran out of texture cache space Loading
libs/hwui/renderthread/DrawFrameTask.h +7 −4 Original line number Diff line number Diff line Loading @@ -40,11 +40,14 @@ namespace renderthread { class CanvasContext; class RenderThread; enum SyncResult { kSync_OK = 0, kSync_UIRedrawRequired = 1 << 0, kSync_LostSurfaceRewardIfFound = 1 << 1, namespace SyncResult { enum { OK = 0, UIRedrawRequired = 1 << 0, LostSurfaceRewardIfFound = 1 << 1, ContextIsStopped = 1 << 2, }; } /* * This is a special Super Task. It is re-used multiple times by RenderProxy, Loading