MCPcopy Create free account
hub / github.com/Tencent/tgfx / Serialize

Method Serialize

src/inspect/serialization/LayerFilterSerialization.cpp:104–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104std::shared_ptr<Data> LayerFilterSerialization::Serialize(const LayerFilter* layerFilter,
105 SerializeUtils::ComplexObjSerMap* map) {
106 DEBUG_ASSERT(layerFilter != nullptr)
107 flexbuffers::Builder fbb;
108 size_t startMap;
109 size_t contentMap;
110 SerializeUtils::SerializeBegin(fbb, tgfx::inspect::LayerTreeMessage::LayerSubAttribute, startMap,
111 contentMap);
112 auto type = Types::Get(layerFilter);
113 switch (type) {
114 case Types::LayerFilterType::LayerFilter:
115 SerializeBasicLayerFilterImpl(fbb, layerFilter);
116 break;
117 case Types::LayerFilterType::BlendFilter:
118 SerializeBlendFilterImpl(fbb, layerFilter, map);
119 break;
120 case Types::LayerFilterType::BlurFilter:
121 SerializeBlurFilterImpl(fbb, layerFilter);
122 break;
123 case Types::LayerFilterType::ColorMatrixFilter:
124 SerializeColorMatrixFilterImpl(fbb, layerFilter, map);
125 break;
126 case Types::LayerFilterType::DropShadowFilter:
127 SerializeDropShadowFilterImpl(fbb, layerFilter, map);
128 break;
129 case Types::LayerFilterType::InnerShadowFilter:
130 SerializeInnerShadowFilterImpl(fbb, layerFilter, map);
131 break;
132 }
133 SerializeUtils::SerializeEnd(fbb, startMap, contentMap);
134 return Data::MakeWithCopy(fbb.GetBuffer().data(), fbb.GetBuffer().size());
135}
136} // namespace tgfx

Callers

nothing calls this directly

Calls 8

SerializeBlendFilterImplFunction · 0.85
SerializeBlurFilterImplFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected