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

Commit c92fd973 authored by Shan Huang's avatar Shan Huang Committed by Android (Google) Code Review
Browse files

Merge "Take the ceil() of the width and height of the new render target." into main

parents 8373acb3 c1d9a62f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -118,9 +118,12 @@ sk_sp<SkImage> KawaseBlurDualFilter::generate(SkiaGpuContext* context, const uin
    const int filterPasses = std::min(kMaxSurfaces - 1, static_cast<int>(ceil(filterDepth)));

    auto makeSurface = [&](float scale) -> sk_sp<SkSurface> {
        const auto newW = static_cast<float>(blurRect.width() / scale);
        const auto newH = static_cast<float>(blurRect.height() / scale);
        return context->createRenderTarget(input->imageInfo().makeWH(newW, newH));
        const auto newW = ceil(static_cast<float>(blurRect.width() / scale));
        const auto newH = ceil(static_cast<float>(blurRect.height() / scale));
        sk_sp<SkSurface> surface =
                context->createRenderTarget(input->imageInfo().makeWH(newW, newH));
        LOG_ALWAYS_FATAL_IF(!surface, "%s: Failed to create surface for blurring!", __func__);
        return surface;
    };

    // Render into surfaces downscaled by 1x, 2x, and 4x from the initial downscale.
+2 −0
Original line number Diff line number Diff line
@@ -879,6 +879,8 @@ renderengine::RenderEngine::BlurAlgorithm chooseBlurAlgorithm(bool supportsBlur)
        return renderengine::RenderEngine::BlurAlgorithm::GAUSSIAN;
    } else if (algorithm == "kawase2") {
        return renderengine::RenderEngine::BlurAlgorithm::KAWASE_DUAL_FILTER;
    } else if (algorithm == "kawase") {
        return renderengine::RenderEngine::BlurAlgorithm::KAWASE;
    } else {
        if (FlagManager::getInstance().window_blur_kawase2()) {
            return renderengine::RenderEngine::BlurAlgorithm::KAWASE_DUAL_FILTER;