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

Commit 7905c2cb authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "Add output dataspace to CachedSet rendering" into sc-dev

parents 2cdc76b8 9c8fce0b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -89,6 +89,7 @@ struct OutputLayerCompositionState {
        sp<GraphicBuffer> buffer = nullptr;
        sp<GraphicBuffer> buffer = nullptr;
        sp<Fence> acquireFence = nullptr;
        sp<Fence> acquireFence = nullptr;
        Rect displayFrame = {};
        Rect displayFrame = {};
        ui::Dataspace dataspace{ui::Dataspace::UNKNOWN};
    } overrideInfo;
    } overrideInfo;


    /*
    /*
+5 −1
Original line number Original line Diff line number Diff line
@@ -62,6 +62,7 @@ public:
    size_t getAge() const { return mAge; }
    size_t getAge() const { return mAge; }
    const sp<GraphicBuffer>& getBuffer() const { return mTexture.getBuffer(); }
    const sp<GraphicBuffer>& getBuffer() const { return mTexture.getBuffer(); }
    const sp<Fence>& getDrawFence() const { return mDrawFence; }
    const sp<Fence>& getDrawFence() const { return mDrawFence; }
    ui::Dataspace getOutputDataspace() const { return mOutputDataspace; }


    NonBufferHash getNonBufferHash() const;
    NonBufferHash getNonBufferHash() const;


@@ -80,6 +81,7 @@ public:
    void setLastUpdate(std::chrono::steady_clock::time_point now) { mLastUpdate = now; }
    void setLastUpdate(std::chrono::steady_clock::time_point now) { mLastUpdate = now; }
    void append(const CachedSet& other) {
    void append(const CachedSet& other) {
        mTexture.setBuffer(nullptr, nullptr);
        mTexture.setBuffer(nullptr, nullptr);
        mOutputDataspace = ui::Dataspace::UNKNOWN;
        mDrawFence = nullptr;
        mDrawFence = nullptr;


        mLayers.insert(mLayers.end(), other.mLayers.cbegin(), other.mLayers.cend());
        mLayers.insert(mLayers.end(), other.mLayers.cbegin(), other.mLayers.cend());
@@ -90,7 +92,8 @@ public:
    }
    }
    void incrementAge() { ++mAge; }
    void incrementAge() { ++mAge; }


    void render(renderengine::RenderEngine&);
    // Renders the cached set with the supplied output dataspace.
    void render(renderengine::RenderEngine&, ui::Dataspace outputDataspace);


    void dump(std::string& result) const;
    void dump(std::string& result) const;


@@ -129,6 +132,7 @@ private:


    Texture mTexture;
    Texture mTexture;
    sp<Fence> mDrawFence;
    sp<Fence> mDrawFence;
    ui::Dataspace mOutputDataspace;


    static const bool sDebugHighlighLayers;
    static const bool sDebugHighlighLayers;
};
};
+2 −1
Original line number Original line Diff line number Diff line
@@ -42,7 +42,8 @@ public:
    NonBufferHash flattenLayers(const std::vector<const LayerState*>& layers, NonBufferHash,
    NonBufferHash flattenLayers(const std::vector<const LayerState*>& layers, NonBufferHash,
                                std::chrono::steady_clock::time_point now);
                                std::chrono::steady_clock::time_point now);


    void renderCachedSets(renderengine::RenderEngine&);
    // Renders the newest cached sets with the supplied output dataspace
    void renderCachedSets(renderengine::RenderEngine&, ui::Dataspace outputDataspace);


    void reset();
    void reset();


+3 −3
Original line number Original line Diff line number Diff line
@@ -278,7 +278,7 @@ private:
                           }};
                           }};


    using DataspaceState = OutputLayerState<ui::Dataspace, LayerStateField::Dataspace>;
    using DataspaceState = OutputLayerState<ui::Dataspace, LayerStateField::Dataspace>;
    DataspaceState mDataspace{[](auto layer) { return layer->getState().dataspace; },
    DataspaceState mOutputDataspace{[](auto layer) { return layer->getState().dataspace; },
                                    DataspaceState::getHalToStrings()};
                                    DataspaceState::getHalToStrings()};


    // TODO(b/180638831): Buffer format
    // TODO(b/180638831): Buffer format
@@ -341,7 +341,7 @@ private:
    std::array<const StateInterface*, 13> getNonUniqueFields() const {
    std::array<const StateInterface*, 13> getNonUniqueFields() const {
        return {
        return {
                &mDisplayFrame,   &mSourceCrop,      &mZOrder,         &mBufferTransform,
                &mDisplayFrame,   &mSourceCrop,      &mZOrder,         &mBufferTransform,
                &mBlendMode,      &mAlpha,           &mVisibleRegion,  &mDataspace,
                &mBlendMode,      &mAlpha,           &mVisibleRegion,  &mOutputDataspace,
                &mColorTransform, &mCompositionType, &mSidebandStream, &mBuffer,
                &mColorTransform, &mCompositionType, &mSidebandStream, &mBuffer,
                &mSolidColor,
                &mSolidColor,
        };
        };
+1 −1
Original line number Original line Diff line number Diff line
@@ -59,7 +59,7 @@ public:
            compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers);
            compositionengine::Output::OutputLayersEnumerator<compositionengine::Output>&& layers);


    // The planner will call to the Flattener to render any pending cached set
    // The planner will call to the Flattener to render any pending cached set
    void renderCachedSets(renderengine::RenderEngine&);
    void renderCachedSets(renderengine::RenderEngine&, ui::Dataspace outputDataspace);


    void dump(const Vector<String16>& args, std::string&);
    void dump(const Vector<String16>& args, std::string&);


Loading