33 fImageInfo = fCodec->getInfo();
34 fFrameInfos = fCodec->getFrameInfo();
35 fImages.resize(fFrameInfos.size());
39 for (
auto&
f : fFrameInfos) {
45 if (!fTotalDuration) {
58 auto image = fImages.front();
68 SkASSERT((
unsigned)index < fFrameInfos.size());
71 return fImages[index];
81 const auto origin = fCodec->getOrigin();
84 orientedDims.height());
89 auto imageInfo = fImageInfo;
93 const int requiredFrame = fFrameInfos[index].fRequiredFrame;
95 auto requiredImage = fImages[requiredFrame];
107 canvas->concat(inverse);
119 imageInfo = imageInfo.makeDimensions(orientedDims);
120 rb = imageInfo.minRowBytes();
121 size = imageInfo.computeByteSize(rb);
124 canvas->concat(originMatrix);
128 return fImages[index] =
image;
132 SkASSERT(fTotalDuration > 0 || fImages.size() == 1);
134 return fTotalDuration > 0
135 ? this->getFrameAt(fCurrIndex)
140 if (!fTotalDuration) {
144 msec %= fTotalDuration;
146 auto lower = std::lower_bound(fFrameInfos.begin(), fFrameInfos.end(), msec,
148 return (uint32_t)info.fDuration <= msec;
150 int prevIndex = fCurrIndex;
151 fCurrIndex =
lower - fFrameInfos.begin();
152 return fCurrIndex != prevIndex;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kDefault_SkEncodedOrigin
static bool SkEncodedOriginSwapsWidthHeight(SkEncodedOrigin origin)
static SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h)
sk_sp< SkImage > getFrame()
SkAnimCodecPlayer(std::unique_ptr< SkCodec > codec)
SkISize dimensions() const
static std::unique_ptr< SkCanvas > MakeRasterDirect(const SkImageInfo &info, void *pixels, size_t rowBytes, const SkSurfaceProps *props=nullptr)
static std::unique_ptr< SkImageGenerator > MakeFromCodec(std::unique_ptr< SkCodec >, std::optional< SkAlphaType >=std::nullopt)
static constexpr int kNoFrame
static sk_sp< SkData > MakeUninitialized(size_t length)
SkISize dimensions() const
SK_API sk_sp< SkImage > RasterFromData(const SkImageInfo &info, sk_sp< SkData > pixels, size_t rowBytes)
SK_API sk_sp< SkImage > DeferredFromGenerator(std::unique_ptr< SkImageGenerator > imageGenerator)
sk_sp< const SkImage > image
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize MakeEmpty()
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
size_t minRowBytes() const
size_t computeByteSize(size_t rowBytes) const
std::shared_ptr< const fml::Mapping > data