From 19c8f0e4fe37ffa86a7cbc879c23e4da2ff97e1c Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 25 Nov 2019 17:55:44 -0800 Subject: Add support for background blurs Bug: 141640413 Fixes: 146384234 Test: adb shell setprop debug.sf.disableBlurs 1 Test: adb shell setprop debug.sf.gaussianBlur 0 Test: adb shell setprop ro.surface_flinger.supports_background_blur 1 Test: ./SurfaceFlinger_test --gtest_filter=Layer*Tests/Layer*Test.SetBackgroundBlur* Test: ./librenderengine_test --gtest_filter=*BlurBackground*" Test: atest SurfaceFlinger_test:SurfaceInterceptorTest#InterceptBackgroundBlurRadiusUpdateWorks Change-Id: I5194c910fe7062f33e70943867012539e6c6626a --- libs/gui/LayerState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 39b4d4bbb6..5547efc3ad 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -86,6 +86,7 @@ status_t layer_state_t::write(Parcel& output) const memcpy(output.writeInplace(16 * sizeof(float)), colorTransform.asArray(), 16 * sizeof(float)); output.writeFloat(cornerRadius); + output.writeUint32(backgroundBlurRadius); output.writeStrongBinder(cachedBuffer.token.promote()); output.writeUint64(cachedBuffer.id); output.writeParcelable(metadata); @@ -173,6 +174,7 @@ status_t layer_state_t::read(const Parcel& input) colorTransform = mat4(static_cast(input.readInplace(16 * sizeof(float)))); cornerRadius = input.readFloat(); + backgroundBlurRadius = input.readUint32(); cachedBuffer.token = input.readStrongBinder(); cachedBuffer.id = input.readUint64(); input.readParcelable(&metadata); @@ -307,6 +309,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eCornerRadiusChanged; cornerRadius = other.cornerRadius; } + if (other.what & eBackgroundBlurRadiusChanged) { + what |= eBackgroundBlurRadiusChanged; + backgroundBlurRadius = other.backgroundBlurRadius; + } if (other.what & eDeferTransaction_legacy) { what |= eDeferTransaction_legacy; barrierHandle_legacy = other.barrierHandle_legacy; -- cgit v1.2.3-59-g8ed1b