MCPcopy Create free account
hub / github.com/Tencent/libpag / CheckContinuousSequenceComposition

Function CheckContinuousSequenceComposition

exporter/src/export/ExportVerify.cpp:201–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static void CheckContinuousSequenceComposition(std::shared_ptr<PAGExportSession> session,
202 pag::Composition* composition) {
203 if (composition->type() != pag::CompositionType::Vector) {
204 return;
205 }
206
207 bool lastIsSequence = false;
208 auto lastBlendMode = pag::BlendMode::Normal;
209 auto lastCompostionId = pag::ZeroID;
210 ScopedAssign<pag::ID> compID(session->compID, composition->id);
211
212 for (auto layer : static_cast<pag::VectorComposition*>(composition)->layers) {
213 if (layer->type() == pag::LayerType::PreCompose) {
214 ScopedAssign<pag::ID> layerID(session->layerID, layer->id);
215 auto subCompostion = static_cast<pag::PreComposeLayer*>(layer)->composition;
216 if (lastCompostionId != subCompostion->id) {
217 lastCompostionId = subCompostion->id;
218 if (subCompostion->type() != pag::CompositionType::Vector) {
219 if (lastIsSequence && layer->blendMode == lastBlendMode) {
220 session->pushWarning(AlertInfoType::ContinuousSequence);
221 }
222 lastIsSequence = true;
223 lastBlendMode = layer->blendMode;
224 } else {
225 CheckContinuousSequenceComposition(session, subCompostion);
226 lastIsSequence = false;
227 }
228 }
229 } else {
230 lastIsSequence = false;
231 }
232 }
233}
234
235static void CheckBmpSuffix(std::shared_ptr<PAGExportSession> session,
236 pag::Composition* composition) {

Callers 1

CheckBeforeExportFunction · 0.85

Calls 2

typeMethod · 0.45
pushWarningMethod · 0.45

Tested by

no test coverage detected