Loading services/surfaceflinger/FrontEnd/LayerSnapshot.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,14 @@ FloatRect LayerSnapshot::sourceBounds() const { return geomBufferSize.toFloatRect(); } bool LayerSnapshot::isFrontBuffered() const { if (!externalTexture) { return false; } return externalTexture->getUsage() & AHARDWAREBUFFER_USAGE_FRONT_BUFFER; } Hwc2::IComposerClient::BlendMode LayerSnapshot::getBlendMode( const RequestedLayerState& requested) const { auto blendMode = Hwc2::IComposerClient::BlendMode::NONE; Loading services/surfaceflinger/FrontEnd/LayerSnapshot.h +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ struct LayerSnapshot : public compositionengine::LayerFECompositionState { std::string getIsVisibleReason() const; bool hasInputInfo() const; FloatRect sourceBounds() const; bool isFrontBuffered() const; Hwc2::IComposerClient::BlendMode getBlendMode(const RequestedLayerState& requested) const; friend std::ostream& operator<<(std::ostream& os, const LayerSnapshot& obj); void merge(const RequestedLayerState& requested, bool forceUpdate, bool displayChanges, Loading services/surfaceflinger/Layer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -4230,6 +4230,14 @@ ui::Dataspace Layer::getDataSpace() const { return hasBufferOrSidebandStream() ? mBufferInfo.mDataspace : mDrawingState.dataspace; } bool Layer::isFrontBuffered() const { if (mBufferInfo.mBuffer == nullptr) { return false; } return mBufferInfo.mBuffer->getUsage() & AHARDWAREBUFFER_USAGE_FRONT_BUFFER; } ui::Dataspace Layer::translateDataspace(ui::Dataspace dataspace) { ui::Dataspace updatedDataspace = dataspace; // translate legacy dataspaces to modern dataspaces Loading services/surfaceflinger/Layer.h +9 −8 Original line number Diff line number Diff line Loading @@ -342,6 +342,8 @@ public: // ui::Dataspace getDataSpace() const; virtual bool isFrontBuffered() const; virtual sp<LayerFE> getCompositionEngineLayerFE() const; virtual sp<LayerFE> copyCompositionEngineLayerFE() const; sp<LayerFE> getCompositionEngineLayerFE(const frontend::LayerHierarchy::TraversalPath&); Loading Loading @@ -915,14 +917,13 @@ public: void recordLayerHistoryBufferUpdate(const scheduler::LayerProps&, nsecs_t now); void recordLayerHistoryAnimationTx(const scheduler::LayerProps&, nsecs_t now); auto getLayerProps() const { return scheduler::LayerProps{ .visible = isVisible(), return scheduler::LayerProps{.visible = isVisible(), .bounds = getBounds(), .transform = getTransform(), .setFrameRateVote = getFrameRateForLayerTree(), .frameRateSelectionPriority = getFrameRateSelectionPriority(), .isSmallDirty = mSmallDirty, }; .isFrontBuffered = isFrontBuffered()}; }; bool hasBuffer() const { return mBufferInfo.mBuffer != nullptr; } void setTransformHint(std::optional<ui::Transform::RotationFlags> transformHint) { Loading services/surfaceflinger/Scheduler/LayerHistory.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,11 @@ bool isLayerActive(const LayerInfo& info, nsecs_t threshold) { return true; } // Make all front buffered layers active if (FlagManager::getInstance().vrr_config() && info.isFrontBuffered() && info.isVisible()) { return true; } return info.isVisible() && info.getLastUpdatedTime() >= threshold; } Loading Loading
services/surfaceflinger/FrontEnd/LayerSnapshot.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,14 @@ FloatRect LayerSnapshot::sourceBounds() const { return geomBufferSize.toFloatRect(); } bool LayerSnapshot::isFrontBuffered() const { if (!externalTexture) { return false; } return externalTexture->getUsage() & AHARDWAREBUFFER_USAGE_FRONT_BUFFER; } Hwc2::IComposerClient::BlendMode LayerSnapshot::getBlendMode( const RequestedLayerState& requested) const { auto blendMode = Hwc2::IComposerClient::BlendMode::NONE; Loading
services/surfaceflinger/FrontEnd/LayerSnapshot.h +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ struct LayerSnapshot : public compositionengine::LayerFECompositionState { std::string getIsVisibleReason() const; bool hasInputInfo() const; FloatRect sourceBounds() const; bool isFrontBuffered() const; Hwc2::IComposerClient::BlendMode getBlendMode(const RequestedLayerState& requested) const; friend std::ostream& operator<<(std::ostream& os, const LayerSnapshot& obj); void merge(const RequestedLayerState& requested, bool forceUpdate, bool displayChanges, Loading
services/surfaceflinger/Layer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -4230,6 +4230,14 @@ ui::Dataspace Layer::getDataSpace() const { return hasBufferOrSidebandStream() ? mBufferInfo.mDataspace : mDrawingState.dataspace; } bool Layer::isFrontBuffered() const { if (mBufferInfo.mBuffer == nullptr) { return false; } return mBufferInfo.mBuffer->getUsage() & AHARDWAREBUFFER_USAGE_FRONT_BUFFER; } ui::Dataspace Layer::translateDataspace(ui::Dataspace dataspace) { ui::Dataspace updatedDataspace = dataspace; // translate legacy dataspaces to modern dataspaces Loading
services/surfaceflinger/Layer.h +9 −8 Original line number Diff line number Diff line Loading @@ -342,6 +342,8 @@ public: // ui::Dataspace getDataSpace() const; virtual bool isFrontBuffered() const; virtual sp<LayerFE> getCompositionEngineLayerFE() const; virtual sp<LayerFE> copyCompositionEngineLayerFE() const; sp<LayerFE> getCompositionEngineLayerFE(const frontend::LayerHierarchy::TraversalPath&); Loading Loading @@ -915,14 +917,13 @@ public: void recordLayerHistoryBufferUpdate(const scheduler::LayerProps&, nsecs_t now); void recordLayerHistoryAnimationTx(const scheduler::LayerProps&, nsecs_t now); auto getLayerProps() const { return scheduler::LayerProps{ .visible = isVisible(), return scheduler::LayerProps{.visible = isVisible(), .bounds = getBounds(), .transform = getTransform(), .setFrameRateVote = getFrameRateForLayerTree(), .frameRateSelectionPriority = getFrameRateSelectionPriority(), .isSmallDirty = mSmallDirty, }; .isFrontBuffered = isFrontBuffered()}; }; bool hasBuffer() const { return mBufferInfo.mBuffer != nullptr; } void setTransformHint(std::optional<ui::Transform::RotationFlags> transformHint) { Loading
services/surfaceflinger/Scheduler/LayerHistory.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,11 @@ bool isLayerActive(const LayerInfo& info, nsecs_t threshold) { return true; } // Make all front buffered layers active if (FlagManager::getInstance().vrr_config() && info.isFrontBuffered() && info.isVisible()) { return true; } return info.isVisible() && info.getLastUpdatedTime() >= threshold; } Loading