Loading libs/gui/LayerState.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ status_t layer_state_t::write(Parcel& output) const } SAFE_PARCEL(output.write, stretchEffect); SAFE_PARCEL(output.writeParcelable, edgeExtensionParameters); SAFE_PARCEL(output.write, bufferCrop); SAFE_PARCEL(output.write, destinationFrame); SAFE_PARCEL(output.writeInt32, static_cast<uint32_t>(trustedOverlay)); Loading Loading @@ -306,6 +307,7 @@ status_t layer_state_t::read(const Parcel& input) } SAFE_PARCEL(input.read, stretchEffect); SAFE_PARCEL(input.readParcelable, &edgeExtensionParameters); SAFE_PARCEL(input.read, bufferCrop); SAFE_PARCEL(input.read, destinationFrame); uint32_t trustedOverlayInt; Loading Loading @@ -682,6 +684,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eStretchChanged; stretchEffect = other.stretchEffect; } if (other.what & eEdgeExtensionChanged) { what |= eEdgeExtensionChanged; edgeExtensionParameters = other.edgeExtensionParameters; } if (other.what & eBufferCropChanged) { what |= eBufferCropChanged; bufferCrop = other.bufferCrop; Loading Loading @@ -783,6 +789,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF(diff, eAutoRefreshChanged, other, autoRefresh); CHECK_DIFF(diff, eTrustedOverlayChanged, other, trustedOverlay); CHECK_DIFF(diff, eStretchChanged, other, stretchEffect); CHECK_DIFF(diff, eEdgeExtensionChanged, other, edgeExtensionParameters); CHECK_DIFF(diff, eBufferCropChanged, other, bufferCrop); CHECK_DIFF(diff, eDestinationFrameChanged, other, destinationFrame); if (other.what & eProducerDisconnect) diff |= eProducerDisconnect; Loading libs/gui/SurfaceComposerClient.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <android/gui/BnWindowInfosReportedListener.h> #include <android/gui/DisplayState.h> #include <android/gui/EdgeExtensionParameters.h> #include <android/gui/ISurfaceComposerClient.h> #include <android/gui/IWindowInfosListener.h> #include <android/gui/TrustedPresentationThresholds.h> Loading Loading @@ -2330,6 +2331,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setStret return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setEdgeExtensionEffect( const sp<SurfaceControl>& sc, const gui::EdgeExtensionParameters& effect) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eEdgeExtensionChanged; s->edgeExtensionParameters = effect; return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBufferCrop( const sp<SurfaceControl>& sc, const Rect& bufferCrop) { layer_state_t* s = getLayerState(sc); Loading libs/gui/aidl/android/gui/EdgeExtensionParameters.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright 2024 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 EdgeExtensionParameters { // These represent the translation of the window as requested by the animation boolean extendRight; boolean extendLeft; boolean extendTop; boolean extendBottom; } No newline at end of file libs/gui/include/gui/LayerState.h +6 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <math/mat4.h> #include <android/gui/DropInputMode.h> #include <android/gui/EdgeExtensionParameters.h> #include <android/gui/FocusRequest.h> #include <android/gui/TrustedOverlay.h> Loading Loading @@ -218,6 +219,7 @@ struct layer_state_t { eTrustedOverlayChanged = 0x4000'00000000, eDropInputModeChanged = 0x8000'00000000, eExtendedRangeBrightnessChanged = 0x10000'00000000, eEdgeExtensionChanged = 0x20000'00000000, }; layer_state_t(); Loading @@ -241,7 +243,7 @@ struct layer_state_t { layer_state_t::eCropChanged | layer_state_t::eDestinationFrameChanged | layer_state_t::eMatrixChanged | layer_state_t::ePositionChanged | layer_state_t::eTransformToDisplayInverseChanged | layer_state_t::eTransparentRegionChanged; layer_state_t::eTransparentRegionChanged | layer_state_t::eEdgeExtensionChanged; // Buffer and related updates. static constexpr uint64_t BUFFER_CHANGES = layer_state_t::eApiChanged | Loading Loading @@ -393,6 +395,9 @@ struct layer_state_t { // Stretch effect to be applied to this layer StretchEffect stretchEffect; // Edge extension effect to be applied to this layer gui::EdgeExtensionParameters edgeExtensionParameters; Rect bufferCrop; Rect destinationFrame; Loading libs/gui/include/gui/SurfaceComposerClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <ui/BlurRegion.h> #include <ui/ConfigStoreTypes.h> #include <ui/DisplayedFrameStats.h> #include <ui/EdgeExtensionEffect.h> #include <ui/FrameStats.h> #include <ui/GraphicTypes.h> #include <ui/PixelFormat.h> Loading Loading @@ -744,6 +745,17 @@ public: Transaction& setStretchEffect(const sp<SurfaceControl>& sc, const StretchEffect& stretchEffect); /** * Provides the edge extension effect configured on a container that the * surface is rendered within. * @param sc target surface the edge extension should be applied to * @param effect the corresponding EdgeExtensionParameters to be applied * to the surface. * @return The transaction being constructed */ Transaction& setEdgeExtensionEffect(const sp<SurfaceControl>& sc, const gui::EdgeExtensionParameters& effect); Transaction& setBufferCrop(const sp<SurfaceControl>& sc, const Rect& bufferCrop); Transaction& setDestinationFrame(const sp<SurfaceControl>& sc, const Rect& destinationFrame); Loading Loading
libs/gui/LayerState.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ status_t layer_state_t::write(Parcel& output) const } SAFE_PARCEL(output.write, stretchEffect); SAFE_PARCEL(output.writeParcelable, edgeExtensionParameters); SAFE_PARCEL(output.write, bufferCrop); SAFE_PARCEL(output.write, destinationFrame); SAFE_PARCEL(output.writeInt32, static_cast<uint32_t>(trustedOverlay)); Loading Loading @@ -306,6 +307,7 @@ status_t layer_state_t::read(const Parcel& input) } SAFE_PARCEL(input.read, stretchEffect); SAFE_PARCEL(input.readParcelable, &edgeExtensionParameters); SAFE_PARCEL(input.read, bufferCrop); SAFE_PARCEL(input.read, destinationFrame); uint32_t trustedOverlayInt; Loading Loading @@ -682,6 +684,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eStretchChanged; stretchEffect = other.stretchEffect; } if (other.what & eEdgeExtensionChanged) { what |= eEdgeExtensionChanged; edgeExtensionParameters = other.edgeExtensionParameters; } if (other.what & eBufferCropChanged) { what |= eBufferCropChanged; bufferCrop = other.bufferCrop; Loading Loading @@ -783,6 +789,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF(diff, eAutoRefreshChanged, other, autoRefresh); CHECK_DIFF(diff, eTrustedOverlayChanged, other, trustedOverlay); CHECK_DIFF(diff, eStretchChanged, other, stretchEffect); CHECK_DIFF(diff, eEdgeExtensionChanged, other, edgeExtensionParameters); CHECK_DIFF(diff, eBufferCropChanged, other, bufferCrop); CHECK_DIFF(diff, eDestinationFrameChanged, other, destinationFrame); if (other.what & eProducerDisconnect) diff |= eProducerDisconnect; Loading
libs/gui/SurfaceComposerClient.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <android/gui/BnWindowInfosReportedListener.h> #include <android/gui/DisplayState.h> #include <android/gui/EdgeExtensionParameters.h> #include <android/gui/ISurfaceComposerClient.h> #include <android/gui/IWindowInfosListener.h> #include <android/gui/TrustedPresentationThresholds.h> Loading Loading @@ -2330,6 +2331,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setStret return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setEdgeExtensionEffect( const sp<SurfaceControl>& sc, const gui::EdgeExtensionParameters& effect) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eEdgeExtensionChanged; s->edgeExtensionParameters = effect; return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBufferCrop( const sp<SurfaceControl>& sc, const Rect& bufferCrop) { layer_state_t* s = getLayerState(sc); Loading
libs/gui/aidl/android/gui/EdgeExtensionParameters.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright 2024 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 EdgeExtensionParameters { // These represent the translation of the window as requested by the animation boolean extendRight; boolean extendLeft; boolean extendTop; boolean extendBottom; } No newline at end of file
libs/gui/include/gui/LayerState.h +6 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <math/mat4.h> #include <android/gui/DropInputMode.h> #include <android/gui/EdgeExtensionParameters.h> #include <android/gui/FocusRequest.h> #include <android/gui/TrustedOverlay.h> Loading Loading @@ -218,6 +219,7 @@ struct layer_state_t { eTrustedOverlayChanged = 0x4000'00000000, eDropInputModeChanged = 0x8000'00000000, eExtendedRangeBrightnessChanged = 0x10000'00000000, eEdgeExtensionChanged = 0x20000'00000000, }; layer_state_t(); Loading @@ -241,7 +243,7 @@ struct layer_state_t { layer_state_t::eCropChanged | layer_state_t::eDestinationFrameChanged | layer_state_t::eMatrixChanged | layer_state_t::ePositionChanged | layer_state_t::eTransformToDisplayInverseChanged | layer_state_t::eTransparentRegionChanged; layer_state_t::eTransparentRegionChanged | layer_state_t::eEdgeExtensionChanged; // Buffer and related updates. static constexpr uint64_t BUFFER_CHANGES = layer_state_t::eApiChanged | Loading Loading @@ -393,6 +395,9 @@ struct layer_state_t { // Stretch effect to be applied to this layer StretchEffect stretchEffect; // Edge extension effect to be applied to this layer gui::EdgeExtensionParameters edgeExtensionParameters; Rect bufferCrop; Rect destinationFrame; Loading
libs/gui/include/gui/SurfaceComposerClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <ui/BlurRegion.h> #include <ui/ConfigStoreTypes.h> #include <ui/DisplayedFrameStats.h> #include <ui/EdgeExtensionEffect.h> #include <ui/FrameStats.h> #include <ui/GraphicTypes.h> #include <ui/PixelFormat.h> Loading Loading @@ -744,6 +745,17 @@ public: Transaction& setStretchEffect(const sp<SurfaceControl>& sc, const StretchEffect& stretchEffect); /** * Provides the edge extension effect configured on a container that the * surface is rendered within. * @param sc target surface the edge extension should be applied to * @param effect the corresponding EdgeExtensionParameters to be applied * to the surface. * @return The transaction being constructed */ Transaction& setEdgeExtensionEffect(const sp<SurfaceControl>& sc, const gui::EdgeExtensionParameters& effect); Transaction& setBufferCrop(const sp<SurfaceControl>& sc, const Rect& bufferCrop); Transaction& setDestinationFrame(const sp<SurfaceControl>& sc, const Rect& destinationFrame); Loading