diff options
author | 2024-02-06 20:14:06 +0000 | |
---|---|---|
committer | 2024-02-06 20:14:06 +0000 | |
commit | 9a4c4ed69fe705a7a5dff7e33a2499d37a7390bb (patch) | |
tree | bbbbe434b628ae183fa59092b7e88e1e01ad5cf0 | |
parent | 8f43aee723210447e4441f56bc9e33b4556652b0 (diff) | |
parent | 48a60cc3d9d6bd4f0872f87240a5c89740582d96 (diff) |
Merge "Revert "Skip a step when blurring"" into main
4 files changed, 19 insertions, 4 deletions
diff --git a/libs/renderengine/skia/SkiaRenderEngine.cpp b/libs/renderengine/skia/SkiaRenderEngine.cpp index 47a95a71bc..6e393f03fa 100644 --- a/libs/renderengine/skia/SkiaRenderEngine.cpp +++ b/libs/renderengine/skia/SkiaRenderEngine.cpp @@ -764,10 +764,11 @@ void SkiaRenderEngine::drawLayersInternal( // save a snapshot of the activeSurface to use as input to the blur shaders blurInput = activeSurface->makeImageSnapshot(); - // blit the offscreen framebuffer into the destination AHB, but only - // if there are blur regions. backgroundBlurRadius blurs the entire - // image below, so it can skip this step. - if (layer.blurRegions.size()) { + // blit the offscreen framebuffer into the destination AHB. This ensures that + // even if the blurred image does not cover the screen (for example, during + // a rotation animation, or if blur regions are used), the entire screen is + // initialized. + if (layer.blurRegions.size() || FlagManager::getInstance().restore_blur_step()) { SkPaint paint; paint.setBlendMode(SkBlendMode::kSrc); if (CC_UNLIKELY(mCapture->isCaptureRunning())) { diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp index d6ebdac320..425d2dac3e 100644 --- a/services/surfaceflinger/common/FlagManager.cpp +++ b/services/surfaceflinger/common/FlagManager.cpp @@ -131,6 +131,7 @@ void FlagManager::dump(std::string& result) const { DUMP_READ_ONLY_FLAG(screenshot_fence_preservation); DUMP_READ_ONLY_FLAG(vulkan_renderengine); DUMP_READ_ONLY_FLAG(renderable_buffer_usage); + DUMP_READ_ONLY_FLAG(restore_blur_step); #undef DUMP_READ_ONLY_FLAG #undef DUMP_SERVER_FLAG #undef DUMP_FLAG_INTERVAL @@ -208,6 +209,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(enable_layer_command_batching, "") FLAG_MANAGER_READ_ONLY_FLAG(screenshot_fence_preservation, "debug.sf.screenshot_fence_preservation") FLAG_MANAGER_READ_ONLY_FLAG(vulkan_renderengine, "debug.renderengine.vulkan") FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "") +FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step") /// Trunk stable server flags /// FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "") diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h index 7d26c66903..86efd306a0 100644 --- a/services/surfaceflinger/common/include/common/FlagManager.h +++ b/services/surfaceflinger/common/include/common/FlagManager.h @@ -71,6 +71,7 @@ public: bool screenshot_fence_preservation() const; bool vulkan_renderengine() const; bool renderable_buffer_usage() const; + bool restore_blur_step() const; protected: // overridden for unit tests diff --git a/services/surfaceflinger/surfaceflinger_flags.aconfig b/services/surfaceflinger/surfaceflinger_flags.aconfig index c723a0f71f..0ebc41be7c 100644 --- a/services/surfaceflinger/surfaceflinger_flags.aconfig +++ b/services/surfaceflinger/surfaceflinger_flags.aconfig @@ -185,3 +185,14 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "restore_blur_step" + namespace: "core_graphics" + description: "Restore drawing the blur input prior to drawing blurred content." + bug: "255921628" + is_fixed_read_only: true + metadata { + purpose: PURPOSE_BUGFIX + } +} |