| 38 | } |
| 39 | |
| 40 | void BitmapComposition::updateStaticTimeRanges() { |
| 41 | staticTimeRanges = {}; |
| 42 | if (duration <= 1) { |
| 43 | return; |
| 44 | } |
| 45 | if (!sequences.empty()) { |
| 46 | Frame start = 0; |
| 47 | Frame end = 0; |
| 48 | auto sequence = sequences[0]; |
| 49 | for (size_t i = 1; i < sequences.size(); i++) { |
| 50 | auto item = sequences[i]; |
| 51 | if (item->frameRate > sequence->frameRate) { |
| 52 | sequence = item; |
| 53 | } |
| 54 | } |
| 55 | float timeScale = frameRate / sequence->frameRate; |
| 56 | for (size_t index = 0; index < sequence->frames.size(); index++) { |
| 57 | if (sequence->isEmptyBitmapFrame(index)) { |
| 58 | end = index; |
| 59 | } else { |
| 60 | if (end > start) { |
| 61 | auto range = MakeTimeRange(start, end, timeScale); |
| 62 | staticTimeRanges.push_back(range); |
| 63 | } |
| 64 | start = end = index; |
| 65 | } |
| 66 | } |
| 67 | if (end > start) { |
| 68 | auto range = MakeTimeRange(start, end, timeScale); |
| 69 | staticTimeRanges.push_back(range); |
| 70 | } |
| 71 | } else { |
| 72 | TimeRange range = {0, duration - 1}; |
| 73 | staticTimeRanges.push_back(range); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | bool BitmapComposition::hasImageContent() const { |
| 78 | return true; |
nothing calls this directly
no test coverage detected