Loading services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #undef LOG_TAG #define LOG_TAG "Planner" // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <android-base/properties.h> #include <compositionengine/impl/OutputCompositionState.h> Loading @@ -25,6 +26,8 @@ #include <renderengine/DisplaySettings.h> #include <renderengine/RenderEngine.h> #include <utils/Trace.h> namespace android::compositionengine::impl::planner { const bool CachedSet::sDebugHighlighLayers = Loading Loading @@ -154,6 +157,7 @@ void CachedSet::updateAge(std::chrono::steady_clock::time_point now) { void CachedSet::render(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); const Rect& viewport = outputState.layerStackSpace.content; const ui::Dataspace& outputDataspace = outputState.dataspace; const ui::Transform::RotationFlags orientation = Loading services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,13 @@ #undef LOG_TAG #define LOG_TAG "Planner" // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <compositionengine/impl/planner/Flattener.h> #include <compositionengine/impl/planner/LayerState.h> #include <utils/Trace.h> using time_point = std::chrono::steady_clock::time_point; using namespace std::chrono_literals; Loading Loading @@ -58,6 +61,7 @@ bool isSameStack(const std::vector<const LayerState*>& incomingLayers, NonBufferHash Flattener::flattenLayers(const std::vector<const LayerState*>& layers, NonBufferHash hash, time_point now) { ATRACE_CALL(); const size_t unflattenedDisplayCost = calculateDisplayCost(layers); mUnflattenedDisplayCost += unflattenedDisplayCost; Loading Loading @@ -91,6 +95,7 @@ NonBufferHash Flattener::flattenLayers(const std::vector<const LayerState*>& lay void Flattener::renderCachedSets(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); if (!mNewCachedSet || mNewCachedSet->hasRenderedBuffer()) { return; } Loading Loading @@ -213,6 +218,7 @@ NonBufferHash Flattener::computeLayersHash() const{ // was already populated with these layers, i.e. on the second and following // calls with the same geometry. bool Flattener::mergeWithCachedSets(const std::vector<const LayerState*>& layers, time_point now) { ATRACE_CALL(); std::vector<CachedSet> merged; if (mLayers.empty()) { Loading Loading @@ -328,6 +334,7 @@ bool Flattener::mergeWithCachedSets(const std::vector<const LayerState*>& layers } std::vector<Flattener::Run> Flattener::findCandidateRuns(time_point now) const { ATRACE_CALL(); std::vector<Run> runs; bool isPartOfRun = false; Run::Builder builder; Loading Loading @@ -388,6 +395,7 @@ std::optional<Flattener::Run> Flattener::findBestRun(std::vector<Flattener::Run> } void Flattener::buildCachedSets(time_point now) { ATRACE_CALL(); if (mLayers.empty()) { ALOGV("[%s] No layers found, returning", __func__); return; Loading services/surfaceflinger/CompositionEngine/src/planner/Planner.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -18,12 +18,15 @@ #undef LOG_TAG #define LOG_TAG "Planner" #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <android-base/properties.h> #include <compositionengine/LayerFECompositionState.h> #include <compositionengine/impl/OutputLayerCompositionState.h> #include <compositionengine/impl/planner/Planner.h> #include <utils/Trace.h> namespace android::compositionengine::impl::planner { Planner::Planner() Loading @@ -41,6 +44,7 @@ void Planner::setDisplaySize(ui::Size size) { void Planner::plan( compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers) { ATRACE_CALL(); std::unordered_set<LayerId> removedLayers; removedLayers.reserve(mPreviousLayers.size()); Loading Loading @@ -119,6 +123,7 @@ void Planner::plan( void Planner::reportFinalPlan( compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers) { ATRACE_CALL(); if (!mPredictorEnabled) { return; } Loading Loading @@ -156,6 +161,7 @@ void Planner::reportFinalPlan( void Planner::renderCachedSets(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); mFlattener.renderCachedSets(renderEngine, outputState); } Loading Loading
services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #undef LOG_TAG #define LOG_TAG "Planner" // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <android-base/properties.h> #include <compositionengine/impl/OutputCompositionState.h> Loading @@ -25,6 +26,8 @@ #include <renderengine/DisplaySettings.h> #include <renderengine/RenderEngine.h> #include <utils/Trace.h> namespace android::compositionengine::impl::planner { const bool CachedSet::sDebugHighlighLayers = Loading Loading @@ -154,6 +157,7 @@ void CachedSet::updateAge(std::chrono::steady_clock::time_point now) { void CachedSet::render(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); const Rect& viewport = outputState.layerStackSpace.content; const ui::Dataspace& outputDataspace = outputState.dataspace; const ui::Transform::RotationFlags orientation = Loading
services/surfaceflinger/CompositionEngine/src/planner/Flattener.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,13 @@ #undef LOG_TAG #define LOG_TAG "Planner" // #define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <compositionengine/impl/planner/Flattener.h> #include <compositionengine/impl/planner/LayerState.h> #include <utils/Trace.h> using time_point = std::chrono::steady_clock::time_point; using namespace std::chrono_literals; Loading Loading @@ -58,6 +61,7 @@ bool isSameStack(const std::vector<const LayerState*>& incomingLayers, NonBufferHash Flattener::flattenLayers(const std::vector<const LayerState*>& layers, NonBufferHash hash, time_point now) { ATRACE_CALL(); const size_t unflattenedDisplayCost = calculateDisplayCost(layers); mUnflattenedDisplayCost += unflattenedDisplayCost; Loading Loading @@ -91,6 +95,7 @@ NonBufferHash Flattener::flattenLayers(const std::vector<const LayerState*>& lay void Flattener::renderCachedSets(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); if (!mNewCachedSet || mNewCachedSet->hasRenderedBuffer()) { return; } Loading Loading @@ -213,6 +218,7 @@ NonBufferHash Flattener::computeLayersHash() const{ // was already populated with these layers, i.e. on the second and following // calls with the same geometry. bool Flattener::mergeWithCachedSets(const std::vector<const LayerState*>& layers, time_point now) { ATRACE_CALL(); std::vector<CachedSet> merged; if (mLayers.empty()) { Loading Loading @@ -328,6 +334,7 @@ bool Flattener::mergeWithCachedSets(const std::vector<const LayerState*>& layers } std::vector<Flattener::Run> Flattener::findCandidateRuns(time_point now) const { ATRACE_CALL(); std::vector<Run> runs; bool isPartOfRun = false; Run::Builder builder; Loading Loading @@ -388,6 +395,7 @@ std::optional<Flattener::Run> Flattener::findBestRun(std::vector<Flattener::Run> } void Flattener::buildCachedSets(time_point now) { ATRACE_CALL(); if (mLayers.empty()) { ALOGV("[%s] No layers found, returning", __func__); return; Loading
services/surfaceflinger/CompositionEngine/src/planner/Planner.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -18,12 +18,15 @@ #undef LOG_TAG #define LOG_TAG "Planner" #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <android-base/properties.h> #include <compositionengine/LayerFECompositionState.h> #include <compositionengine/impl/OutputLayerCompositionState.h> #include <compositionengine/impl/planner/Planner.h> #include <utils/Trace.h> namespace android::compositionengine::impl::planner { Planner::Planner() Loading @@ -41,6 +44,7 @@ void Planner::setDisplaySize(ui::Size size) { void Planner::plan( compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers) { ATRACE_CALL(); std::unordered_set<LayerId> removedLayers; removedLayers.reserve(mPreviousLayers.size()); Loading Loading @@ -119,6 +123,7 @@ void Planner::plan( void Planner::reportFinalPlan( compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers) { ATRACE_CALL(); if (!mPredictorEnabled) { return; } Loading Loading @@ -156,6 +161,7 @@ void Planner::reportFinalPlan( void Planner::renderCachedSets(renderengine::RenderEngine& renderEngine, const OutputCompositionState& outputState) { ATRACE_CALL(); mFlattener.renderCachedSets(renderEngine, outputState); } Loading