Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef0a0d7b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Optimize layer history in scheduler"

parents 5cf50456 f7a09ed2
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -107,11 +107,8 @@ bool BufferLayer::isOpaque(const Layer::State& s) const {
}

bool BufferLayer::isVisible() const {
    bool visible = !(isHiddenByPolicy()) && getAlpha() > 0.0f &&
    return !isHiddenByPolicy() && getAlpha() > 0.0f &&
            (mBufferInfo.mBuffer != nullptr || mSidebandStream != nullptr);
    mFlinger->mScheduler->setLayerVisibility(mSchedulerLayerHandle, visible);

    return visible;
}

bool BufferLayer::isFixedSize() const {
+2 −2
Original line number Diff line number Diff line
@@ -389,7 +389,7 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
    { // Autolock scope
        if (mFlinger->mUseSmart90ForVideo) {
            const nsecs_t presentTime = item.mIsAutoTimestamp ? 0 : item.mTimestamp;
            mFlinger->mScheduler->addLayerPresentTimeAndHDR(mSchedulerLayerHandle, presentTime,
            mFlinger->mScheduler->recordLayerHistory(this, presentTime,
                                                     item.mHdrMetadata.validTypes != 0);
        }

+2 −2
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, nsecs_t postTi

    if (mFlinger->mUseSmart90ForVideo) {
        const nsecs_t presentTime = (desiredPresentTime == -1) ? 0 : desiredPresentTime;
        mFlinger->mScheduler->addLayerPresentTimeAndHDR(mSchedulerLayerHandle, presentTime,
        mFlinger->mScheduler->recordLayerHistory(this, presentTime,
                                                 mCurrentState.hdrMetadata.validTypes != 0);
    }

+1 −2
Original line number Diff line number Diff line
@@ -118,10 +118,9 @@ Layer::Layer(const LayerCreationArgs& args)
    mFrameEventHistory.initializeCompositorTiming(compositorTiming);
    mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval);

    mSchedulerLayerHandle = mFlinger->mScheduler->registerLayer(mName.c_str(), mWindowType);
    mCallingPid = args.callingPid;
    mCallingUid = args.callingUid;
    mFlinger->onLayerCreated();
    mFlinger->onLayerCreated(this);
}

Layer::~Layer() {
+2 −3
Original line number Diff line number Diff line
@@ -221,6 +221,8 @@ public:
    explicit Layer(const LayerCreationArgs& args);
    virtual ~Layer();

    int getWindowType() const { return mWindowType; }

    void setPrimaryDisplayOnly() { mPrimaryDisplayOnly = true; }
    bool getPrimaryDisplayOnly() const { return mPrimaryDisplayOnly; }

@@ -886,9 +888,6 @@ protected:
    // Window types from WindowManager.LayoutParams
    const int mWindowType;

    // This is populated if the layer is registered with Scheduler for tracking purposes.
    std::unique_ptr<scheduler::LayerHistory::LayerHandle> mSchedulerLayerHandle;

private:
    /**
     * Returns an unsorted vector of all layers that are part of this tree.
Loading