Implement blur region in RenderEngine
Blur regions should be be piped through SurfaceFlinger
all the way down to the compositor, in order to render
blurs.
It's also necessary to cache them if multiple regions require
the same blur radius.
Test: manual
Test: atest SurfaceInterceptor_test
Test: atest OutputUpdateAndWriteCompositionStateTest
Bug: 159712515
Change-Id: Id4759f65eb2522a80e9328062fe641fe29786a30
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 32f9695..039e900 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1017,6 +1017,18 @@
return *this;
}
+SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBlurRegions(
+ const sp<SurfaceControl>& sc, const std::vector<BlurRegion>& blurRegions) {
+ layer_state_t* s = getLayerState(sc);
+ if (!s) {
+ mStatus = BAD_INDEX;
+ return *this;
+ }
+ s->what |= layer_state_t::eBlurRegionsChanged;
+ s->blurRegions = blurRegions;
+ return *this;
+}
+
SurfaceComposerClient::Transaction&
SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(
const sp<SurfaceControl>& sc, const sp<SurfaceControl>& barrierSurfaceControl,