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

Method renderFrame

src/rendering/PAGDecoder.cpp:213–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213bool PAGDecoder::renderFrame(std::shared_ptr<PAGComposition> composition, int index,
214 std::shared_ptr<BitmapBuffer> bitmap) {
215 if (composition == nullptr) {
216 reader = nullptr;
217 LOGE(
218 "PAGDecoder: Failed to get PAGComposition! the associated PAGComposition "
219 "may be added to another parent after the PAGDecoder was created.");
220 return false;
221 }
222 if (reader == nullptr) {
223 reader = CompositionReader::Make(_width, _height, sharedContext);
224 if (reader == nullptr) {
225 LOGE("PAGDecoder::renderFrame() Failed to create a CompositionReader!");
226 return false;
227 }
228 reader->setComposition(composition);
229 }
230 auto progress = FrameToProgress(static_cast<Frame>(index), _numFrames);
231 return reader->readFrame(progress, bitmap);
232}
233
234bool PAGDecoder::checkSequenceFile(std::shared_ptr<PAGComposition> composition,
235 const tgfx::ImageInfo& info) {

Callers

nothing calls this directly

Calls 4

FrameToProgressFunction · 0.85
MakeFunction · 0.50
setCompositionMethod · 0.45
readFrameMethod · 0.45

Tested by

no test coverage detected