Skip to content

Commit 9a4c4ed

Browse files
LeonScrogginsAndroid (Google) Code Review
authored andcommitted
Merge "Revert "Skip a step when blurring"" into main
2 parents 8f43aee + 48a60cc commit 9a4c4ed

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

libs/renderengine/skia/SkiaRenderEngine.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,11 @@ void SkiaRenderEngine::drawLayersInternal(
764764
// save a snapshot of the activeSurface to use as input to the blur shaders
765765
blurInput = activeSurface->makeImageSnapshot();
766766

767-
// blit the offscreen framebuffer into the destination AHB, but only
768-
// if there are blur regions. backgroundBlurRadius blurs the entire
769-
// image below, so it can skip this step.
770-
if (layer.blurRegions.size()) {
767+
// blit the offscreen framebuffer into the destination AHB. This ensures that
768+
// even if the blurred image does not cover the screen (for example, during
769+
// a rotation animation, or if blur regions are used), the entire screen is
770+
// initialized.
771+
if (layer.blurRegions.size() || FlagManager::getInstance().restore_blur_step()) {
771772
SkPaint paint;
772773
paint.setBlendMode(SkBlendMode::kSrc);
773774
if (CC_UNLIKELY(mCapture->isCaptureRunning())) {

services/surfaceflinger/common/FlagManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ void FlagManager::dump(std::string& result) const {
131131
DUMP_READ_ONLY_FLAG(screenshot_fence_preservation);
132132
DUMP_READ_ONLY_FLAG(vulkan_renderengine);
133133
DUMP_READ_ONLY_FLAG(renderable_buffer_usage);
134+
DUMP_READ_ONLY_FLAG(restore_blur_step);
134135
#undef DUMP_READ_ONLY_FLAG
135136
#undef DUMP_SERVER_FLAG
136137
#undef DUMP_FLAG_INTERVAL
@@ -208,6 +209,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(enable_layer_command_batching, "")
208209
FLAG_MANAGER_READ_ONLY_FLAG(screenshot_fence_preservation, "debug.sf.screenshot_fence_preservation")
209210
FLAG_MANAGER_READ_ONLY_FLAG(vulkan_renderengine, "debug.renderengine.vulkan")
210211
FLAG_MANAGER_READ_ONLY_FLAG(renderable_buffer_usage, "")
212+
FLAG_MANAGER_READ_ONLY_FLAG(restore_blur_step, "debug.renderengine.restore_blur_step")
211213

212214
/// Trunk stable server flags ///
213215
FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")

services/surfaceflinger/common/include/common/FlagManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class FlagManager {
7171
bool screenshot_fence_preservation() const;
7272
bool vulkan_renderengine() const;
7373
bool renderable_buffer_usage() const;
74+
bool restore_blur_step() const;
7475

7576
protected:
7677
// overridden for unit tests

services/surfaceflinger/surfaceflinger_flags.aconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,14 @@ flag {
185185
purpose: PURPOSE_BUGFIX
186186
}
187187
}
188+
189+
flag {
190+
name: "restore_blur_step"
191+
namespace: "core_graphics"
192+
description: "Restore drawing the blur input prior to drawing blurred content."
193+
bug: "255921628"
194+
is_fixed_read_only: true
195+
metadata {
196+
purpose: PURPOSE_BUGFIX
197+
}
198+
}

0 commit comments

Comments
 (0)