Loading libs/gui/LayerState.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ layer_state_t::layer_state_t() fixedTransformHint(ui::Transform::ROT_INVALID), autoRefresh(false), isTrustedOverlay(false), borderEnabled(false), bufferCrop(Rect::INVALID_RECT), destinationFrame(Rect::INVALID_RECT), dropInputMode(gui::DropInputMode::NONE) { Loading Loading @@ -100,7 +101,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.write, transparentRegion); SAFE_PARCEL(output.writeUint32, transform); SAFE_PARCEL(output.writeBool, transformToDisplayInverse); SAFE_PARCEL(output.writeBool, borderEnabled); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(dataspace)); SAFE_PARCEL(output.write, hdrMetadata); SAFE_PARCEL(output.write, surfaceDamageRegion); Loading Loading @@ -200,6 +201,7 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, transparentRegion); SAFE_PARCEL(input.readUint32, &transform); SAFE_PARCEL(input.readBool, &transformToDisplayInverse); SAFE_PARCEL(input.readBool, &borderEnabled); uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); Loading Loading @@ -550,6 +552,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; } if (other.what & eFrameRateSelectionPriority) { what |= eFrameRateSelectionPriority; frameRateSelectionPriority = other.frameRateSelectionPriority; Loading libs/gui/SurfaceComposerClient.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1939,6 +1939,21 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; registerSurfaceControlForCallback(sc); return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading libs/gui/include/gui/LayerState.h +3 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ struct layer_state_t { eLayerStackChanged = 0x00000080, eDimmingEnabledChanged = 0x00000400, eShadowRadiusChanged = 0x00000800, /* unused 0x00001000, */ eRenderBorderChanged = 0x00001000, eBufferCropChanged = 0x00002000, eRelativeLayerChanged = 0x00004000, eReparent = 0x00008000, Loading Loading @@ -293,6 +293,8 @@ struct layer_state_t { // should be trusted for input occlusion detection purposes bool isTrustedOverlay; // Flag to indicate if border needs to be enabled on the layer bool borderEnabled; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -625,6 +625,8 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading libs/renderengine/include/renderengine/BorderRenderInfo.h 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright 2022 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. */ #pragma once #include <math/mat4.h> #include <ui/Region.h> namespace android { namespace renderengine { struct BorderRenderInfo { Region combinedRegion; bool operator==(const BorderRenderInfo& rhs) const { return (combinedRegion.hasSameRects(rhs.combinedRegion)); } }; } // namespace renderengine } // namespace android No newline at end of file Loading
libs/gui/LayerState.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ layer_state_t::layer_state_t() fixedTransformHint(ui::Transform::ROT_INVALID), autoRefresh(false), isTrustedOverlay(false), borderEnabled(false), bufferCrop(Rect::INVALID_RECT), destinationFrame(Rect::INVALID_RECT), dropInputMode(gui::DropInputMode::NONE) { Loading Loading @@ -100,7 +101,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.write, transparentRegion); SAFE_PARCEL(output.writeUint32, transform); SAFE_PARCEL(output.writeBool, transformToDisplayInverse); SAFE_PARCEL(output.writeBool, borderEnabled); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(dataspace)); SAFE_PARCEL(output.write, hdrMetadata); SAFE_PARCEL(output.write, surfaceDamageRegion); Loading Loading @@ -200,6 +201,7 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, transparentRegion); SAFE_PARCEL(input.readUint32, &transform); SAFE_PARCEL(input.readBool, &transformToDisplayInverse); SAFE_PARCEL(input.readBool, &borderEnabled); uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); Loading Loading @@ -550,6 +552,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; } if (other.what & eFrameRateSelectionPriority) { what |= eFrameRateSelectionPriority; frameRateSelectionPriority = other.frameRateSelectionPriority; Loading
libs/gui/SurfaceComposerClient.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1939,6 +1939,21 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; registerSurfaceControlForCallback(sc); return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading
libs/gui/include/gui/LayerState.h +3 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ struct layer_state_t { eLayerStackChanged = 0x00000080, eDimmingEnabledChanged = 0x00000400, eShadowRadiusChanged = 0x00000800, /* unused 0x00001000, */ eRenderBorderChanged = 0x00001000, eBufferCropChanged = 0x00002000, eRelativeLayerChanged = 0x00004000, eReparent = 0x00008000, Loading Loading @@ -293,6 +293,8 @@ struct layer_state_t { // should be trusted for input occlusion detection purposes bool isTrustedOverlay; // Flag to indicate if border needs to be enabled on the layer bool borderEnabled; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading
libs/gui/include/gui/SurfaceComposerClient.h +2 −0 Original line number Diff line number Diff line Loading @@ -625,6 +625,8 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading
libs/renderengine/include/renderengine/BorderRenderInfo.h 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright 2022 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. */ #pragma once #include <math/mat4.h> #include <ui/Region.h> namespace android { namespace renderengine { struct BorderRenderInfo { Region combinedRegion; bool operator==(const BorderRenderInfo& rhs) const { return (combinedRegion.hasSameRects(rhs.combinedRegion)); } }; } // namespace renderengine } // namespace android No newline at end of file