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

Commit 90da84b8 authored by Peiyong Lin's avatar Peiyong Lin Committed by Android (Google) Code Review
Browse files

Merge "[SurfaceFlinger] Turn on Filtering when scaling."

parents 0693e716 c2020cac
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ void BufferLayer::onDraw(const RenderArea& renderArea, const Region& clip,

    if (!blackOutLayer) {
        // TODO: we could be more subtle with isFixedSize()
        const bool useFiltering = needsFiltering(renderArea) || isFixedSize();
        const bool useFiltering = needsFiltering() || renderArea.needsFiltering() || isFixedSize();

        // Query the texture matrix given our current filtering mode.
        float textureMatrix[16];
@@ -597,8 +597,11 @@ bool BufferLayer::getOpacityForFormat(uint32_t format) {
    return true;
}

bool BufferLayer::needsFiltering(const RenderArea& renderArea) const {
    return mNeedsFiltering || renderArea.needsFiltering();
bool BufferLayer::needsFiltering() const {
    const auto displayFrame = getBE().compositionInfo.hwc.displayFrame;
    const auto sourceCrop = getBE().compositionInfo.hwc.sourceCrop;
    return mNeedsFiltering || sourceCrop.getHeight() != displayFrame.getHeight() ||
            sourceCrop.getWidth() != displayFrame.getWidth();
}

void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityTransform) const {
@@ -623,7 +626,6 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT
     */
    const Rect bounds{computeBounds()}; // Rounds from FloatRect

    ui::Transform t = getTransform();
    Rect win = bounds;
    const int bufferWidth = getBufferSize(s).getWidth();
    const int bufferHeight = getBufferSize(s).getHeight();
+2 −2
Original line number Diff line number Diff line
@@ -168,8 +168,8 @@ protected:
    const uint32_t mTextureName;

private:
    // needsLinearFiltering - true if this surface's state requires filtering
    bool needsFiltering(const RenderArea& renderArea) const;
    // Returns true if this layer requires filtering
    bool needsFiltering() const;

    // drawing
    void drawWithOpenGL(const RenderArea& renderArea, bool useIdentityTransform) const;