Loading libs/gui/LayerMetadata.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -100,27 +100,31 @@ bool LayerMetadata::has(uint32_t key) const { int32_t LayerMetadata::getInt32(uint32_t key, int32_t fallback) const { if (!has(key)) return fallback; const std::vector<uint8_t>& data = mMap.at(key); if (data.size() < sizeof(uint32_t)) return fallback; Parcel p; p.setData(data.data(), data.size()); return p.readInt32(); // TODO: should handle when not equal? if (data.size() < sizeof(int32_t)) return fallback; int32_t result; memcpy(&result, data.data(), sizeof(result)); return result; } void LayerMetadata::setInt32(uint32_t key, int32_t value) { std::vector<uint8_t>& data = mMap[key]; Parcel p; p.writeInt32(value); data.resize(p.dataSize()); memcpy(data.data(), p.data(), p.dataSize()); data.resize(sizeof(value)); memcpy(data.data(), &value, sizeof(value)); } std::optional<int64_t> LayerMetadata::getInt64(uint32_t key) const { if (!has(key)) return std::nullopt; const std::vector<uint8_t>& data = mMap.at(key); // TODO: should handle when not equal? if (data.size() < sizeof(int64_t)) return std::nullopt; Parcel p; p.setData(data.data(), data.size()); return p.readInt64(); int64_t result; memcpy(&result, data.data(), sizeof(result)); return result; } std::string LayerMetadata::itemToString(uint32_t key, const char* separator) const { Loading libs/gui/LayerState.cpp +0 −25 Original line number Diff line number Diff line Loading @@ -90,7 +90,6 @@ 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 @@ -122,12 +121,6 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.write, transparentRegion); SAFE_PARCEL(output.writeUint32, bufferTransform); 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 @@ -238,17 +231,6 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, transparentRegion); SAFE_PARCEL(input.readUint32, &bufferTransform); 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 @@ -659,12 +641,6 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; borderWidth = other.borderWidth; borderColor = other.borderColor; } if (other.what & eDefaultFrameRateCompatibilityChanged) { what |= eDefaultFrameRateCompatibilityChanged; defaultFrameRateCompatibility = other.defaultFrameRateCompatibility; Loading Loading @@ -794,7 +770,6 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace); if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor); CHECK_DIFF(diff, eDefaultFrameRateCompatibilityChanged, other, defaultFrameRateCompatibility); CHECK_DIFF(diff, eFrameRateSelectionPriority, other, frameRateSelectionPriority); CHECK_DIFF3(diff, eFrameRateChanged, other, frameRate, frameRateCompatibility, Loading libs/gui/SurfaceComposerClient.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -2250,23 +2250,6 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; s->borderWidth = width; s->borderColor = color; registerSurfaceControlForCallback(sc); return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading libs/gui/include/gui/LayerState.h +2 −8 Original line number Diff line number Diff line Loading @@ -179,7 +179,6 @@ struct layer_state_t { eCachingHintChanged = 0x00000200, eDimmingEnabledChanged = 0x00000400, eShadowRadiusChanged = 0x00000800, eRenderBorderChanged = 0x00001000, eBufferCropChanged = 0x00002000, eRelativeLayerChanged = 0x00004000, eReparent = 0x00008000, Loading Loading @@ -258,8 +257,8 @@ struct layer_state_t { layer_state_t::eBlurRegionsChanged | layer_state_t::eColorChanged | layer_state_t::eColorSpaceAgnosticChanged | layer_state_t::eColorTransformChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eDimmingEnabledChanged | layer_state_t::eHdrMetadataChanged | layer_state_t::eRenderBorderChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged; layer_state_t::eHdrMetadataChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged; // Changes which invalidates the layer's visible region in CE. static constexpr uint64_t CONTENT_DIRTY = layer_state_t::CONTENT_CHANGES | Loading Loading @@ -388,11 +387,6 @@ 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; float borderWidth; half4 borderColor; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading libs/gui/include/gui/SurfaceComposerClient.h +0 −3 Original line number Diff line number Diff line Loading @@ -744,9 +744,6 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); 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 Loading
libs/gui/LayerMetadata.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -100,27 +100,31 @@ bool LayerMetadata::has(uint32_t key) const { int32_t LayerMetadata::getInt32(uint32_t key, int32_t fallback) const { if (!has(key)) return fallback; const std::vector<uint8_t>& data = mMap.at(key); if (data.size() < sizeof(uint32_t)) return fallback; Parcel p; p.setData(data.data(), data.size()); return p.readInt32(); // TODO: should handle when not equal? if (data.size() < sizeof(int32_t)) return fallback; int32_t result; memcpy(&result, data.data(), sizeof(result)); return result; } void LayerMetadata::setInt32(uint32_t key, int32_t value) { std::vector<uint8_t>& data = mMap[key]; Parcel p; p.writeInt32(value); data.resize(p.dataSize()); memcpy(data.data(), p.data(), p.dataSize()); data.resize(sizeof(value)); memcpy(data.data(), &value, sizeof(value)); } std::optional<int64_t> LayerMetadata::getInt64(uint32_t key) const { if (!has(key)) return std::nullopt; const std::vector<uint8_t>& data = mMap.at(key); // TODO: should handle when not equal? if (data.size() < sizeof(int64_t)) return std::nullopt; Parcel p; p.setData(data.data(), data.size()); return p.readInt64(); int64_t result; memcpy(&result, data.data(), sizeof(result)); return result; } std::string LayerMetadata::itemToString(uint32_t key, const char* separator) const { Loading
libs/gui/LayerState.cpp +0 −25 Original line number Diff line number Diff line Loading @@ -90,7 +90,6 @@ 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 @@ -122,12 +121,6 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.write, transparentRegion); SAFE_PARCEL(output.writeUint32, bufferTransform); 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 @@ -238,17 +231,6 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, transparentRegion); SAFE_PARCEL(input.readUint32, &bufferTransform); 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 @@ -659,12 +641,6 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } if (other.what & eRenderBorderChanged) { what |= eRenderBorderChanged; borderEnabled = other.borderEnabled; borderWidth = other.borderWidth; borderColor = other.borderColor; } if (other.what & eDefaultFrameRateCompatibilityChanged) { what |= eDefaultFrameRateCompatibilityChanged; defaultFrameRateCompatibility = other.defaultFrameRateCompatibility; Loading Loading @@ -794,7 +770,6 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace); if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor); CHECK_DIFF(diff, eDefaultFrameRateCompatibilityChanged, other, defaultFrameRateCompatibility); CHECK_DIFF(diff, eFrameRateSelectionPriority, other, frameRateSelectionPriority); CHECK_DIFF3(diff, eFrameRateChanged, other, frameRate, frameRateCompatibility, Loading
libs/gui/SurfaceComposerClient.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -2250,23 +2250,6 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder( const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eRenderBorderChanged; s->borderEnabled = shouldEnable; s->borderWidth = width; s->borderColor = color; registerSurfaceControlForCallback(sc); return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading
libs/gui/include/gui/LayerState.h +2 −8 Original line number Diff line number Diff line Loading @@ -179,7 +179,6 @@ struct layer_state_t { eCachingHintChanged = 0x00000200, eDimmingEnabledChanged = 0x00000400, eShadowRadiusChanged = 0x00000800, eRenderBorderChanged = 0x00001000, eBufferCropChanged = 0x00002000, eRelativeLayerChanged = 0x00004000, eReparent = 0x00008000, Loading Loading @@ -258,8 +257,8 @@ struct layer_state_t { layer_state_t::eBlurRegionsChanged | layer_state_t::eColorChanged | layer_state_t::eColorSpaceAgnosticChanged | layer_state_t::eColorTransformChanged | layer_state_t::eCornerRadiusChanged | layer_state_t::eDimmingEnabledChanged | layer_state_t::eHdrMetadataChanged | layer_state_t::eRenderBorderChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged; layer_state_t::eHdrMetadataChanged | layer_state_t::eShadowRadiusChanged | layer_state_t::eStretchChanged; // Changes which invalidates the layer's visible region in CE. static constexpr uint64_t CONTENT_DIRTY = layer_state_t::CONTENT_CHANGES | Loading Loading @@ -388,11 +387,6 @@ 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; float borderWidth; half4 borderColor; // Stretch effect to be applied to this layer StretchEffect stretchEffect; Loading
libs/gui/include/gui/SurfaceComposerClient.h +0 −3 Original line number Diff line number Diff line Loading @@ -744,9 +744,6 @@ public: const Rect& destinationFrame); Transaction& setDropInputMode(const sp<SurfaceControl>& sc, gui::DropInputMode mode); 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