Loading libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ filegroup { "android/**/TouchOcclusionMode.aidl", "android/gui/TrustedOverlay.aidl", "android/gui/BorderSettings.aidl", "android/gui/BoxShadowSettings.aidl", ], } Loading libs/gui/LayerState.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ status_t layer_state_t::write(Parcel& output) const } SAFE_PARCEL(output.writeFloat, shadowRadius); SAFE_PARCEL(output.writeParcelable, borderSettings); SAFE_PARCEL(output.writeParcelable, boxShadowSettings); SAFE_PARCEL(output.writeInt32, frameRateSelectionPriority); SAFE_PARCEL(output.writeFloat, frameRate); SAFE_PARCEL(output.writeByte, frameRateCompatibility); Loading Loading @@ -330,6 +331,7 @@ status_t layer_state_t::read(const Parcel& input) } SAFE_PARCEL(input.readFloat, &shadowRadius); SAFE_PARCEL(input.readParcelable, &borderSettings); SAFE_PARCEL(input.readParcelable, &boxShadowSettings); SAFE_PARCEL(input.readInt32, &frameRateSelectionPriority); SAFE_PARCEL(input.readFloat, &frameRate); Loading Loading @@ -734,6 +736,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eBorderSettingsChanged; borderSettings = other.borderSettings; } if (other.what & eBoxShadowSettingsChanged) { what |= eBoxShadowSettingsChanged; boxShadowSettings = other.boxShadowSettings; } if (other.what & eLutsChanged) { what |= eLutsChanged; luts = other.luts; Loading Loading @@ -889,6 +895,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF(diff, eBorderSettingsChanged, other, borderSettings); CHECK_DIFF(diff, eBoxShadowSettingsChanged, other, boxShadowSettings); CHECK_DIFF(diff, eDefaultFrameRateCompatibilityChanged, other, defaultFrameRateCompatibility); CHECK_DIFF(diff, eFrameRateSelectionPriority, other, frameRateSelectionPriority); CHECK_DIFF3(diff, eFrameRateChanged, other, frameRate, frameRateCompatibility, Loading libs/gui/SurfaceComposerClient.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -2038,6 +2038,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBorde return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBoxShadowSettings( const sp<SurfaceControl>& sc, gui::BoxShadowSettings settings) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eBoxShadowSettingsChanged; s->boxShadowSettings = settings; return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameRate( const sp<SurfaceControl>& sc, float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy) { Loading libs/gui/android/gui/BoxShadowSettings.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /** * Copyright (c) 2025, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.gui; /** @hide */ parcelable BoxShadowSettings { parcelable BoxShadowParams { float blurRadius; float spreadRadius; // Space is sRGB, not premultiplied, bit pattern is 0xAARRGGBB. int color; float offsetX; float offsetY; } BoxShadowParams []boxShadows = {}; } libs/gui/include/gui/LayerState.h +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <span> #include <android/gui/BorderSettings.h> #include <android/gui/BoxShadowSettings.h> #include <android/gui/DisplayCaptureArgs.h> #include <android/gui/IWindowInfosReportedListener.h> #include <android/gui/LayerCaptureArgs.h> Loading Loading @@ -252,6 +253,7 @@ struct layer_state_t { eAppContentPriorityChanged = 0x100000'00000000, eClientDrawnCornerRadiusChanged = 0x200000'00000000, eBorderSettingsChanged = 0x400000'00000000, eBoxShadowSettingsChanged = 0x800000'00000000, }; layer_state_t(); Loading Loading @@ -296,7 +298,8 @@ struct layer_state_t { layer_state_t::eCornerRadiusChanged | layer_state_t::eDimmingEnabledChanged | layer_state_t::eHdrMetadataChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged | layer_state_t::ePictureProfileHandleChanged | layer_state_t::eAppContentPriorityChanged | layer_state_t::eBorderSettingsChanged; layer_state_t::eAppContentPriorityChanged | layer_state_t::eBorderSettingsChanged | layer_state_t::eBoxShadowSettingsChanged; // Changes which invalidates the layer's visible region in CE. static constexpr uint64_t CONTENT_DIRTY = layer_state_t::CONTENT_CHANGES | Loading Loading @@ -325,7 +328,7 @@ struct layer_state_t { static constexpr uint64_t COMPOSITION_EFFECTS = layer_state_t::eBackgroundBlurRadiusChanged | layer_state_t::eBlurRegionsChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged | layer_state_t::eBorderSettingsChanged; layer_state_t::eBorderSettingsChanged | layer_state_t::eBoxShadowSettingsChanged; bool hasValidBuffer() const; void sanitize(int32_t permissions); Loading Loading @@ -417,6 +420,9 @@ struct layer_state_t { // Draws an outline around the layer. gui::BorderSettings borderSettings; // Draws a sequence of box shadows under the layer. gui::BoxShadowSettings boxShadowSettings; // Priority of the layer assigned by Window Manager. int32_t frameRateSelectionPriority; Loading Loading
libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ filegroup { "android/**/TouchOcclusionMode.aidl", "android/gui/TrustedOverlay.aidl", "android/gui/BorderSettings.aidl", "android/gui/BoxShadowSettings.aidl", ], } Loading
libs/gui/LayerState.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ status_t layer_state_t::write(Parcel& output) const } SAFE_PARCEL(output.writeFloat, shadowRadius); SAFE_PARCEL(output.writeParcelable, borderSettings); SAFE_PARCEL(output.writeParcelable, boxShadowSettings); SAFE_PARCEL(output.writeInt32, frameRateSelectionPriority); SAFE_PARCEL(output.writeFloat, frameRate); SAFE_PARCEL(output.writeByte, frameRateCompatibility); Loading Loading @@ -330,6 +331,7 @@ status_t layer_state_t::read(const Parcel& input) } SAFE_PARCEL(input.readFloat, &shadowRadius); SAFE_PARCEL(input.readParcelable, &borderSettings); SAFE_PARCEL(input.readParcelable, &boxShadowSettings); SAFE_PARCEL(input.readInt32, &frameRateSelectionPriority); SAFE_PARCEL(input.readFloat, &frameRate); Loading Loading @@ -734,6 +736,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eBorderSettingsChanged; borderSettings = other.borderSettings; } if (other.what & eBoxShadowSettingsChanged) { what |= eBoxShadowSettingsChanged; boxShadowSettings = other.boxShadowSettings; } if (other.what & eLutsChanged) { what |= eLutsChanged; luts = other.luts; Loading Loading @@ -889,6 +895,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF(diff, eBorderSettingsChanged, other, borderSettings); CHECK_DIFF(diff, eBoxShadowSettingsChanged, other, boxShadowSettings); CHECK_DIFF(diff, eDefaultFrameRateCompatibilityChanged, other, defaultFrameRateCompatibility); CHECK_DIFF(diff, eFrameRateSelectionPriority, other, frameRateSelectionPriority); CHECK_DIFF3(diff, eFrameRateChanged, other, frameRate, frameRateCompatibility, Loading
libs/gui/SurfaceComposerClient.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -2038,6 +2038,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBorde return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBoxShadowSettings( const sp<SurfaceControl>& sc, gui::BoxShadowSettings settings) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eBoxShadowSettingsChanged; s->boxShadowSettings = settings; return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameRate( const sp<SurfaceControl>& sc, float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy) { Loading
libs/gui/android/gui/BoxShadowSettings.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /** * Copyright (c) 2025, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.gui; /** @hide */ parcelable BoxShadowSettings { parcelable BoxShadowParams { float blurRadius; float spreadRadius; // Space is sRGB, not premultiplied, bit pattern is 0xAARRGGBB. int color; float offsetX; float offsetY; } BoxShadowParams []boxShadows = {}; }
libs/gui/include/gui/LayerState.h +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <span> #include <android/gui/BorderSettings.h> #include <android/gui/BoxShadowSettings.h> #include <android/gui/DisplayCaptureArgs.h> #include <android/gui/IWindowInfosReportedListener.h> #include <android/gui/LayerCaptureArgs.h> Loading Loading @@ -252,6 +253,7 @@ struct layer_state_t { eAppContentPriorityChanged = 0x100000'00000000, eClientDrawnCornerRadiusChanged = 0x200000'00000000, eBorderSettingsChanged = 0x400000'00000000, eBoxShadowSettingsChanged = 0x800000'00000000, }; layer_state_t(); Loading Loading @@ -296,7 +298,8 @@ struct layer_state_t { layer_state_t::eCornerRadiusChanged | layer_state_t::eDimmingEnabledChanged | layer_state_t::eHdrMetadataChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged | layer_state_t::ePictureProfileHandleChanged | layer_state_t::eAppContentPriorityChanged | layer_state_t::eBorderSettingsChanged; layer_state_t::eAppContentPriorityChanged | layer_state_t::eBorderSettingsChanged | layer_state_t::eBoxShadowSettingsChanged; // Changes which invalidates the layer's visible region in CE. static constexpr uint64_t CONTENT_DIRTY = layer_state_t::CONTENT_CHANGES | Loading Loading @@ -325,7 +328,7 @@ struct layer_state_t { static constexpr uint64_t COMPOSITION_EFFECTS = layer_state_t::eBackgroundBlurRadiusChanged | layer_state_t::eBlurRegionsChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged | layer_state_t::eBorderSettingsChanged; layer_state_t::eBorderSettingsChanged | layer_state_t::eBoxShadowSettingsChanged; bool hasValidBuffer() const; void sanitize(int32_t permissions); Loading Loading @@ -417,6 +420,9 @@ struct layer_state_t { // Draws an outline around the layer. gui::BorderSettings borderSettings; // Draws a sequence of box shadows under the layer. gui::BoxShadowSettings boxShadowSettings; // Priority of the layer assigned by Window Manager. int32_t frameRateSelectionPriority; Loading