Loading libs/gui/LayerState.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeUint32, transform); SAFE_PARCEL(output.writeBool, transformToDisplayInverse); SAFE_PARCEL(output.writeBool, borderEnabled); SAFE_PARCEL(output.writeFloat, borderWidth); SAFE_PARCEL(output.writeFloat, borderColor.r); SAFE_PARCEL(output.writeFloat, borderColor.g); SAFE_PARCEL(output.writeFloat, borderColor.b); SAFE_PARCEL(output.writeFloat, borderColor.a); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(dataspace)); SAFE_PARCEL(output.write, hdrMetadata); SAFE_PARCEL(output.write, surfaceDamageRegion); Loading Loading @@ -202,6 +207,16 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &transform); SAFE_PARCEL(input.readBool, &transformToDisplayInverse); SAFE_PARCEL(input.readBool, &borderEnabled); SAFE_PARCEL(input.readFloat, &tmpFloat); borderWidth = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.g = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.b = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.a = tmpFloat; uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); Loading Loading @@ -555,6 +570,8 @@ void layer_state_t::merge(const layer_state_t& other) { if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; borderWidth = other.borderWidth; borderColor = other.borderColor; } if (other.what & eFrameRateSelectionPriority) { what |= eFrameRateSelectionPriority; Loading libs/gui/SurfaceComposerClient.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1940,7 +1940,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable) { const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; Loading @@ -1949,6 +1949,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBo s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; s->borderWidth = width; s->borderColor = color; registerSurfaceControlForCallback(sc); return *this; Loading libs/gui/include/gui/LayerState.h +3 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,9 @@ struct layer_state_t { // Flag to indicate if border needs to be enabled on the layer bool borderEnabled; float borderWidth; half4 borderColor; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading libs/gui/include/gui/SurfaceComposerClient.h +2 −1 Original line number Diff line number Diff line Loading @@ -625,7 +625,8 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading libs/renderengine/include/renderengine/BorderRenderInfo.h +4 −1 Original line number Diff line number Diff line Loading @@ -22,10 +22,13 @@ namespace android { namespace renderengine { struct BorderRenderInfo { float width = 0; half4 color; Region combinedRegion; bool operator==(const BorderRenderInfo& rhs) const { return (combinedRegion.hasSameRects(rhs.combinedRegion)); return (width == rhs.width && color == rhs.color && combinedRegion.hasSameRects(rhs.combinedRegion)); } }; Loading Loading
libs/gui/LayerState.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeUint32, transform); SAFE_PARCEL(output.writeBool, transformToDisplayInverse); SAFE_PARCEL(output.writeBool, borderEnabled); SAFE_PARCEL(output.writeFloat, borderWidth); SAFE_PARCEL(output.writeFloat, borderColor.r); SAFE_PARCEL(output.writeFloat, borderColor.g); SAFE_PARCEL(output.writeFloat, borderColor.b); SAFE_PARCEL(output.writeFloat, borderColor.a); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(dataspace)); SAFE_PARCEL(output.write, hdrMetadata); SAFE_PARCEL(output.write, surfaceDamageRegion); Loading Loading @@ -202,6 +207,16 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &transform); SAFE_PARCEL(input.readBool, &transformToDisplayInverse); SAFE_PARCEL(input.readBool, &borderEnabled); SAFE_PARCEL(input.readFloat, &tmpFloat); borderWidth = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.g = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.b = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); borderColor.a = tmpFloat; uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); Loading Loading @@ -555,6 +570,8 @@ void layer_state_t::merge(const layer_state_t& other) { if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; borderWidth = other.borderWidth; borderColor = other.borderColor; } if (other.what & eFrameRateSelectionPriority) { what |= eFrameRateSelectionPriority; Loading
libs/gui/SurfaceComposerClient.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1940,7 +1940,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable) { const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; Loading @@ -1949,6 +1949,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBo s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; s->borderWidth = width; s->borderColor = color; registerSurfaceControlForCallback(sc); return *this; Loading
libs/gui/include/gui/LayerState.h +3 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,9 @@ struct layer_state_t { // Flag to indicate if border needs to be enabled on the layer bool borderEnabled; float borderWidth; half4 borderColor; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading
libs/gui/include/gui/SurfaceComposerClient.h +2 −1 Original line number Diff line number Diff line Loading @@ -625,7 +625,8 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable); Transaction& enableBorder(const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading
libs/renderengine/include/renderengine/BorderRenderInfo.h +4 −1 Original line number Diff line number Diff line Loading @@ -22,10 +22,13 @@ namespace android { namespace renderengine { struct BorderRenderInfo { float width = 0; half4 color; Region combinedRegion; bool operator==(const BorderRenderInfo& rhs) const { return (combinedRegion.hasSameRects(rhs.combinedRegion)); return (width == rhs.width && color == rhs.color && combinedRegion.hasSameRects(rhs.combinedRegion)); } }; Loading