From 987034b5633d0eb7fca806acfe00ddbe3305b159 Mon Sep 17 00:00:00 2001 From: Byunghun Jeon Date: Fri, 5 Dec 2014 18:28:32 -0800 Subject: SurfaceFlinger: Native changes to add blur effect Native changes to add blur-behind and blur mask effect Change-Id: I54faf82d750e8299de6d261f6a893ab26d08df84 SurfaceFlinger: Adding template for LayerBlur files Change-Id: I444009113b7bdd6c5284863fd1f56358e67d9fe6 SurfaceFlinger: Featurize libuiblur module for OSS build Change-Id: Ifdc176e699434125d17b111c044b8ba954cf717c --- include/gui/ISurfaceComposerClient.h | 1 + include/gui/SurfaceComposerClient.h | 5 +++++ include/gui/SurfaceControl.h | 5 +++++ include/private/gui/LayerState.h | 12 ++++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/gui/ISurfaceComposerClient.h b/include/gui/ISurfaceComposerClient.h index bb79bd0..d3e8b8b 100644 --- a/include/gui/ISurfaceComposerClient.h +++ b/include/gui/ISurfaceComposerClient.h @@ -50,6 +50,7 @@ public: eCursorWindow = 0x00002000, eFXSurfaceNormal = 0x00000000, + eFXSurfaceBlur = 0x00010000, eFXSurfaceDim = 0x00020000, eFXSurfaceMask = 0x000F0000, }; diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index 37d953e..9ec3f23 100644 --- a/include/gui/SurfaceComposerClient.h +++ b/include/gui/SurfaceComposerClient.h @@ -163,6 +163,11 @@ public: const Rect& layerStackRect, const Rect& displayRect); + status_t setBlur(const sp& id, float blur); + status_t setBlurMaskSurface(const sp& id, const sp& maskSurfaceId); + status_t setBlurMaskSampling(const sp& id, uint32_t blurMaskSampling); + status_t setBlurMaskAlphaThreshold(const sp& id, float alpha); + private: virtual void onFirstRef(); Composer& getComposer(); diff --git a/include/gui/SurfaceControl.h b/include/gui/SurfaceControl.h index 9f62f7c..5fa45d1 100644 --- a/include/gui/SurfaceControl.h +++ b/include/gui/SurfaceControl.h @@ -77,6 +77,11 @@ public: status_t clearLayerFrameStats() const; status_t getLayerFrameStats(FrameStats* outStats) const; + status_t setBlur(float blur = 0); + status_t setBlurMaskSurface(const sp& maskSurface); + status_t setBlurMaskSampling(uint32_t blurMaskSampling); + status_t setBlurMaskAlphaThreshold(float alpha); + private: // can't be copied SurfaceControl& operator = (SurfaceControl& rhs); diff --git a/include/private/gui/LayerState.h b/include/private/gui/LayerState.h index cbe8733..9ff8409 100644 --- a/include/private/gui/LayerState.h +++ b/include/private/gui/LayerState.h @@ -52,12 +52,16 @@ struct layer_state_t { eFlagsChanged = 0x00000040, eLayerStackChanged = 0x00000080, eCropChanged = 0x00000100, + eBlurChanged = 0x00400000, + eBlurMaskSurfaceChanged = 0x00800000, + eBlurMaskSamplingChanged = 0x01000000, + eBlurMaskAlphaThresholdChanged = 0x02000000, }; layer_state_t() : what(0), - x(0), y(0), z(0), w(0), h(0), layerStack(0), - alpha(0), flags(0), mask(0), + x(0), y(0), z(0), w(0), h(0), layerStack(0), blur(0), + blurMaskSampling(0), blurMaskAlphaThreshold(0), alpha(0), flags(0), mask(0), reserved(0) { matrix.dsdx = matrix.dtdy = 1.0f; @@ -82,6 +86,10 @@ struct layer_state_t { uint32_t w; uint32_t h; uint32_t layerStack; + float blur; + sp blurMaskSurface; + uint32_t blurMaskSampling; + float blurMaskAlphaThreshold; float alpha; uint8_t flags; uint8_t mask; -- cgit v1.1