| 211 | } |
| 212 | |
| 213 | bool 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 | |
| 234 | bool PAGDecoder::checkSequenceFile(std::shared_ptr<PAGComposition> composition, |
| 235 | const tgfx::ImageInfo& info) { |
nothing calls this directly
no test coverage detected