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

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

Merge "Provide a default pixel snap matrix if Surface has been destroyed when...

Merge "Provide a default pixel snap matrix if Surface has been destroyed when executing buildLayer." into main
parents a9a3db0b ee6eeb39
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -214,8 +214,12 @@ void SkiaVulkanPipeline::onContextDestroyed() {
}
}


const SkM44& SkiaVulkanPipeline::getPixelSnapMatrix() const {
const SkM44& SkiaVulkanPipeline::getPixelSnapMatrix() const {
    if (mVkSurface) {
        return mVkSurface->getPixelSnapMatrix();
        return mVkSurface->getPixelSnapMatrix();
    }
    }
    static const SkM44 sSnapMatrix = VulkanSurface::GetPixelSnapMatrix(SkISize::MakeEmpty(), 0);
    return sSnapMatrix;
}


} /* namespace skiapipeline */
} /* namespace skiapipeline */
} /* namespace uirenderer */
} /* namespace uirenderer */
+1 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ static SkMatrix GetPreTransformMatrix(SkISize windowSize, int transform) {
    return SkMatrix::I();
    return SkMatrix::I();
}
}


static SkM44 GetPixelSnapMatrix(SkISize windowSize, int transform) {
SkM44 VulkanSurface::GetPixelSnapMatrix(SkISize windowSize, int transform) {
    // Small (~1/16th) nudge to ensure that pixel-aligned non-AA'd draws fill the
    // Small (~1/16th) nudge to ensure that pixel-aligned non-AA'd draws fill the
    // desired fragment
    // desired fragment
    static const SkScalar kOffset = 0.063f;
    static const SkScalar kOffset = 0.063f;
+1 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@ public:


    void setColorSpace(sk_sp<SkColorSpace> colorSpace);
    void setColorSpace(sk_sp<SkColorSpace> colorSpace);
    const SkM44& getPixelSnapMatrix() const { return mWindowInfo.pixelSnapMatrix; }
    const SkM44& getPixelSnapMatrix() const { return mWindowInfo.pixelSnapMatrix; }
    static SkM44 GetPixelSnapMatrix(SkISize windowSize, int transform);


private:
private:
    /*
    /*