Flutter Engine
The Flutter Engine
SkImage_GaneshYUVA.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
16#include "include/core/SkSize.h"
21#include "include/gpu/GrBackendSurface.h" // IWYU pragma: keep
25#include "include/gpu/GrTypes.h"
37#include "src/gpu/Swizzle.h"
51#include "src/gpu/ganesh/SkGr.h"
56
57#include <algorithm>
58#include <utility>
59
60enum class SkTileMode;
61struct SkRect;
62
64
66 uint32_t uniqueID,
68 sk_sp<SkColorSpace> imageColorSpace)
69 : INHERITED(std::move(context),
70 SkImageInfo::Make(proxies.yuvaInfo().dimensions(),
72 // If an alpha channel is present we always use kPremul. This
73 // is because, although the planar data is always un-premul,
74 // the final interleaved RGBA sample produced in the shader
75 // is premul (and similar if flattened via asView).
76 proxies.yuvaInfo().hasAlpha() ? kPremul_SkAlphaType
78 std::move(imageColorSpace)),
79 uniqueID)
80 , fYUVAProxies(std::move(proxies)) {
81 // The caller should have checked this, just verifying.
82 SkASSERT(fYUVAProxies.isValid());
83}
84
85// For onMakeColorTypeAndColorSpace() / onReinterpretColorSpace()
88 sk_sp<SkColorSpace> targetCS,
89 ColorSpaceMode csMode)
90 : INHERITED(std::move(context),
91 image->imageInfo().makeColorSpace(std::move(targetCS)),
93 , fYUVAProxies(image->fYUVAProxies)
94 // If we're *reinterpreting* in a new color space, leave fFromColorSpace null.
95 // If we're *converting* to a new color space, it must be non-null, so turn null into sRGB.
96 , fFromColorSpace(csMode == ColorSpaceMode::kReinterpret
97 ? nullptr
98 : (image->colorSpace() ? image->refColorSpace()
99 : SkColorSpace::MakeSRGB())) {}
100
102 if (!context || !fContext->priv().matches(context)) {
103 return false;
104 }
105 if (!context->priv().caps()->mipmapSupport()) {
106 // We succeed in this case by doing nothing.
107 return true;
108 }
109 int n = fYUVAProxies.yuvaInfo().numPlanes();
110 sk_sp<GrSurfaceProxy> newProxies[4];
111 for (int i = 0; i < n; ++i) {
112 auto* t = fYUVAProxies.proxy(i)->asTextureProxy();
113 if (t->mipmapped() == skgpu::Mipmapped::kNo && (t->width() > 1 || t->height() > 1)) {
114 auto newView = GrCopyBaseMipMapToView(context, fYUVAProxies.makeView(i));
115 if (!newView) {
116 return false;
117 }
118 SkASSERT(newView.swizzle() == fYUVAProxies.makeView(i).swizzle());
119 newProxies[i] = newView.detachProxy();
120 } else {
121 newProxies[i] = fYUVAProxies.refProxy(i);
122 }
123 }
124 fYUVAProxies =
125 GrYUVATextureProxies(fYUVAProxies.yuvaInfo(), newProxies, fYUVAProxies.textureOrigin());
126 SkASSERT(fYUVAProxies.isValid());
127 return true;
128}
129
130//////////////////////////////////////////////////////////////////////////////////////////////////
131
133 const GrFlushInfo& info) const {
134 if (!fContext->priv().matches(dContext) || dContext->abandoned()) {
135 if (info.fSubmittedProc) {
136 info.fSubmittedProc(info.fSubmittedContext, false);
137 }
138 if (info.fFinishedProc) {
139 info.fFinishedProc(info.fFinishedContext);
140 }
142 }
143
145 size_t numProxies = fYUVAProxies.numPlanes();
146 for (size_t i = 0; i < numProxies; ++i) {
147 proxies[i] = fYUVAProxies.proxy(i);
148 }
149 return dContext->priv().flushSurfaces(
150 {proxies, numProxies}, SkSurfaces::BackendSurfaceAccess::kNoAccess, info);
151}
152
154 return fYUVAProxies.mipmapped() == skgpu::Mipmapped::kYes;
155}
156
158 skgpu::Protected isProtected = fYUVAProxies.proxy(0)->isProtected();
159
160#if defined(SK_DEBUG)
161 for (int i = 1; i < fYUVAProxies.numPlanes(); ++i) {
162 SkASSERT(isProtected == fYUVAProxies.proxy(i)->isProtected());
163 }
164#endif
165
167}
168
169
171 size_t size = 0;
172 for (int i = 0; i < fYUVAProxies.numPlanes(); ++i) {
173 size += fYUVAProxies.proxy(i)->gpuMemorySize();
174 }
175 return size;
176}
177
179 sk_sp<SkColorSpace> targetCS,
180 GrDirectContext* direct) const {
181 // We explicitly ignore color type changes, for now.
182
183 // we may need a mutex here but for now we expect usage to be in a single thread
184 if (fOnMakeColorSpaceTarget &&
185 SkColorSpace::Equals(targetCS.get(), fOnMakeColorSpaceTarget.get())) {
186 return fOnMakeColorSpaceResult;
187 }
189 new SkImage_GaneshYUVA(sk_ref_sp(direct), this, targetCS, ColorSpaceMode::kConvert));
190 if (result) {
191 fOnMakeColorSpaceTarget = targetCS;
192 fOnMakeColorSpaceResult = result;
193 }
194 return result;
195}
196
198 return sk_sp<SkImage>(
199 new SkImage_GaneshYUVA(fContext, this, std::move(newCS), ColorSpaceMode::kReinterpret));
200}
201
202std::tuple<GrSurfaceProxyView, GrColorType> SkImage_GaneshYUVA::asView(GrRecordingContext* rContext,
203 skgpu::Mipmapped mipmapped,
204 GrImageTexGenPolicy) const {
205 if (!fContext->priv().matches(rContext)) {
206 return {};
207 }
208 auto sfc = rContext->priv().makeSFC(this->imageInfo(),
209 "Image_GpuYUVA_ReinterpretColorSpace",
211 /*sample count*/ 1,
212 mipmapped,
214 fYUVAProxies.textureOrigin(),
216 if (!sfc) {
217 return {};
218 }
219
220 const GrCaps& caps = *rContext->priv().caps();
222 if (fFromColorSpace) {
224 fFromColorSpace.get(),
225 this->alphaType(),
226 this->colorSpace(),
227 this->alphaType());
228 }
229 sfc->fillWithFP(std::move(fp));
230
231 return {sfc->readSurfaceView(), sfc->colorInfo().colorType()};
232}
233
234std::unique_ptr<GrFragmentProcessor> SkImage_GaneshYUVA::asFragmentProcessor(
235 GrRecordingContext* context,
237 const SkTileMode tileModes[2],
238 const SkMatrix& m,
239 const SkRect* subset,
240 const SkRect* domain) const {
241 if (!fContext->priv().matches(context)) {
242 return {};
243 }
244 // At least for now we do not attempt aniso filtering on YUVA images.
245 if (sampling.isAniso()) {
246 sampling =
248 }
249
250 auto wmx = SkTileModeToWrapMode(tileModes[0]);
251 auto wmy = SkTileModeToWrapMode(tileModes[1]);
252 GrSamplerState sampler(wmx, wmy, sampling.filter, sampling.mipmap);
253 if (sampler.mipmapped() == skgpu::Mipmapped::kYes && !this->setupMipmapsForPlanes(context)) {
254 sampler = GrSamplerState(sampler.wrapModeX(),
255 sampler.wrapModeY(),
256 sampler.filter(),
258 }
259
260 const auto& yuvM = sampling.useCubic ? SkMatrix::I() : m;
262 fYUVAProxies, sampler, *context->priv().caps(), yuvM, subset, domain);
263 if (sampling.useCubic) {
264 fp = GrBicubicEffect::Make(std::move(fp),
265 this->alphaType(),
266 m,
269 }
270 if (fFromColorSpace) {
272 fFromColorSpace.get(),
273 this->alphaType(),
274 this->colorSpace(),
275 this->alphaType());
276 }
277 return fp;
278}
279
280//////////////////////////////////////////////////////////////////////////////////////////////////
281namespace SkImages {
283 const GrYUVABackendTextures& yuvaTextures) {
284 return TextureFromYUVATextures(context, yuvaTextures, nullptr, nullptr, nullptr);
285}
286
288 const GrYUVABackendTextures& yuvaTextures,
289 sk_sp<SkColorSpace> imageColorSpace,
290 TextureReleaseProc textureReleaseProc,
291 ReleaseContext releaseContext) {
292 auto releaseHelper = skgpu::RefCntedCallback::Make(textureReleaseProc, releaseContext);
293
294 GrProxyProvider* proxyProvider = context->priv().proxyProvider();
295 int numPlanes = yuvaTextures.yuvaInfo().numPlanes();
297 for (int plane = 0; plane < numPlanes; ++plane) {
298 proxies[plane] = proxyProvider->wrapBackendTexture(yuvaTextures.texture(plane),
302 releaseHelper);
303 if (!proxies[plane]) {
304 return {};
305 }
306 }
307 GrYUVATextureProxies yuvaProxies(
308 yuvaTextures.yuvaInfo(), proxies, yuvaTextures.textureOrigin());
309
310 if (!yuvaProxies.isValid()) {
311 return nullptr;
312 }
313
314 return sk_make_sp<SkImage_GaneshYUVA>(
315 sk_ref_sp(context), kNeedNewImageUniqueID, yuvaProxies, imageColorSpace);
316}
317
319 const SkYUVAPixmaps& pixmaps,
320 skgpu::Mipmapped buildMips,
321 bool limitToMaxTextureSize) {
322 return TextureFromYUVAPixmaps(context, pixmaps, buildMips, limitToMaxTextureSize, nullptr);
323}
324
326 const SkYUVAPixmaps& pixmaps,
327 skgpu::Mipmapped buildMips,
328 bool limitToMaxTextureSize,
329 sk_sp<SkColorSpace> imageColorSpace) {
330 if (!context) {
331 return nullptr;
332 }
333
334 if (!pixmaps.isValid()) {
335 return nullptr;
336 }
337
338 if (!context->priv().caps()->mipmapSupport()) {
339 buildMips = skgpu::Mipmapped::kNo;
340 }
341
342 // Resize the pixmaps if necessary.
343 int numPlanes = pixmaps.numPlanes();
344 int maxTextureSize = context->priv().caps()->maxTextureSize();
345 int maxDim = std::max(pixmaps.yuvaInfo().width(), pixmaps.yuvaInfo().height());
346
347 SkYUVAPixmaps tempPixmaps;
348 const SkYUVAPixmaps* pixmapsToUpload = &pixmaps;
349 // We assume no plane is larger than the image size (and at least one plane is as big).
350 if (maxDim > maxTextureSize) {
351 if (!limitToMaxTextureSize) {
352 return nullptr;
353 }
354 float scale = static_cast<float>(maxTextureSize) / maxDim;
355 SkISize newDimensions = {
356 std::min(static_cast<int>(pixmaps.yuvaInfo().width() * scale), maxTextureSize),
357 std::min(static_cast<int>(pixmaps.yuvaInfo().height() * scale), maxTextureSize)};
358 SkYUVAInfo newInfo = pixmaps.yuvaInfo().makeDimensions(newDimensions);
359 SkYUVAPixmapInfo newPixmapInfo(newInfo, pixmaps.dataType(), /*row bytes*/ nullptr);
360 tempPixmaps = SkYUVAPixmaps::Allocate(newPixmapInfo);
362 if (!tempPixmaps.isValid()) {
363 return nullptr;
364 }
365 for (int i = 0; i < numPlanes; ++i) {
366 if (!pixmaps.plane(i).scalePixels(tempPixmaps.plane(i), sampling)) {
367 return nullptr;
368 }
369 }
370 pixmapsToUpload = &tempPixmaps;
371 }
372
373 // Convert to texture proxies.
375 GrColorType pixmapColorTypes[SkYUVAInfo::kMaxPlanes];
376 for (int i = 0; i < numPlanes; ++i) {
377 // Turn the pixmap into a GrTextureProxy
378 SkBitmap bmp;
379 bmp.installPixels(pixmapsToUpload->plane(i));
380 std::tie(views[i], std::ignore) = GrMakeUncachedBitmapProxyView(context, bmp, buildMips);
381 if (!views[i]) {
382 return nullptr;
383 }
384 pixmapColorTypes[i] = SkColorTypeToGrColorType(bmp.colorType());
385 }
386
387 GrYUVATextureProxies yuvaProxies(pixmapsToUpload->yuvaInfo(), views, pixmapColorTypes);
388 SkASSERT(yuvaProxies.isValid());
389 return sk_make_sp<SkImage_GaneshYUVA>(sk_ref_sp(context),
391 std::move(yuvaProxies),
392 std::move(imageColorSpace));
393}
394
396 const GrYUVABackendTextureInfo& backendTextureInfo,
397 sk_sp<SkColorSpace> imageColorSpace,
398 PromiseImageTextureFulfillProc textureFulfillProc,
399 PromiseImageTextureReleaseProc textureReleaseProc,
400 PromiseImageTextureContext textureContexts[]) {
401 if (!backendTextureInfo.isValid()) {
402 return nullptr;
403 }
404
405 SkISize planeDimensions[SkYUVAInfo::kMaxPlanes];
406 int n = backendTextureInfo.yuvaInfo().planeDimensions(planeDimensions);
407
408 // Our contract is that we will always call the release proc even on failure.
409 // We use the helper to convey the context, so we need to ensure make doesn't fail.
410 textureReleaseProc = textureReleaseProc ? textureReleaseProc : [](void*) {};
411 sk_sp<skgpu::RefCntedCallback> releaseHelpers[4];
412 for (int i = 0; i < n; ++i) {
413 releaseHelpers[i] = skgpu::RefCntedCallback::Make(textureReleaseProc, textureContexts[i]);
414 }
415
416 if (!threadSafeProxy) {
417 return nullptr;
418 }
419
420 SkAlphaType at =
421 backendTextureInfo.yuvaInfo().hasAlpha() ? kPremul_SkAlphaType : kOpaque_SkAlphaType;
423 backendTextureInfo.yuvaInfo().dimensions(), kAssumedColorType, at, imageColorSpace);
424 if (!SkImageInfoIsValid(info)) {
425 return nullptr;
426 }
427
428 // Make a lazy proxy for each plane
429 sk_sp<GrSurfaceProxy> proxies[4];
430 for (int i = 0; i < n; ++i) {
431 proxies[i] =
433 planeDimensions[i],
434 backendTextureInfo.planeFormat(i),
436 textureFulfillProc,
437 std::move(releaseHelpers[i]));
438 if (!proxies[i]) {
439 return nullptr;
440 }
441 }
442 GrYUVATextureProxies yuvaTextureProxies(
443 backendTextureInfo.yuvaInfo(), proxies, backendTextureInfo.textureOrigin());
444 SkASSERT(yuvaTextureProxies.isValid());
445 sk_sp<GrImageContext> ctx(GrImageContextPriv::MakeForPromiseImage(std::move(threadSafeProxy)));
446 return sk_make_sp<SkImage_GaneshYUVA>(std::move(ctx),
448 std::move(yuvaTextureProxies),
449 std::move(imageColorSpace));
450}
451} // namespace SkImages
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
@ kRead_GrIOType
Definition: GrTypesPriv.h:403
@ kBorrow_GrWrapOwnership
Definition: GrTypesPriv.h:79
GrColorType
Definition: GrTypesPriv.h:540
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
Definition: GrTypesPriv.h:629
GrSemaphoresSubmitted
Definition: GrTypes.h:229
SkAlphaType
Definition: SkAlphaType.h:26
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkColorType
Definition: SkColorType.h:19
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
GrSurfaceProxyView GrCopyBaseMipMapToView(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Budgeted budgeted)
Definition: SkGr.cpp:136
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeUncachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, skgpu::Mipmapped mipmapped, SkBackingFit fit, skgpu::Budgeted budgeted)
Definition: SkGr.cpp:253
GrImageTexGenPolicy
Definition: SkGr.h:141
static constexpr GrSamplerState::WrapMode SkTileModeToWrapMode(SkTileMode tileMode)
Definition: SkGr.h:77
static bool SkImageInfoIsValid(const SkImageInfo &info)
@ kNeedNewImageUniqueID
Definition: SkImage_Base.h:33
static constexpr auto kAssumedColorType
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
SkTileMode
Definition: SkTileMode.h:13
bool matches(GrContext_Base *candidate) const
const GrCaps * caps() const
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView view, SkAlphaType, const SkMatrix &, SkCubicResampler, Direction)
Definition: GrCaps.h:57
bool mipmapSupport() const
Definition: GrCaps.h:72
int maxTextureSize() const
Definition: GrCaps.h:229
static std::unique_ptr< GrFragmentProcessor > Make(std::unique_ptr< GrFragmentProcessor > child, SkColorSpace *src, SkAlphaType srcAT, SkColorSpace *dst, SkAlphaType dstAT)
GrSemaphoresSubmitted flushSurfaces(SkSpan< GrSurfaceProxy * >, SkSurfaces::BackendSurfaceAccess=SkSurfaces::BackendSurfaceAccess::kNoAccess, const GrFlushInfo &={}, const skgpu::MutableTextureState *newState=nullptr)
bool abandoned() override
GrDirectContextPriv priv()
static sk_sp< GrImageContext > MakeForPromiseImage(sk_sp< GrContextThreadSafeProxy > tsp)
GrImageContextPriv priv()
sk_sp< GrTextureProxy > wrapBackendTexture(const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable, GrIOType, sk_sp< skgpu::RefCntedCallback >=nullptr)
GrProxyProvider * proxyProvider()
std::unique_ptr< skgpu::ganesh::SurfaceFillContext > makeSFC(GrImageInfo, std::string_view label, SkBackingFit=SkBackingFit::kExact, int sampleCount=1, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Protected=skgpu::Protected::kNo, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
GrRecordingContextPriv priv()
constexpr skgpu::Mipmapped mipmapped() const
constexpr WrapMode wrapModeX() const
constexpr Filter filter() const
constexpr WrapMode wrapModeY() const
skgpu::Swizzle swizzle() const
GrProtected isProtected() const
size_t gpuMemorySize() const
virtual GrTextureProxy * asTextureProxy()
const SkYUVAInfo & yuvaInfo() const
GrSurfaceOrigin textureOrigin() const
const GrBackendFormat & planeFormat(int i) const
const SkYUVAInfo & yuvaInfo() const
GrBackendTexture texture(int i) const
GrSurfaceOrigin textureOrigin() const
GrSurfaceProxy * proxy(int i) const
const SkYUVAInfo & yuvaInfo() const
skgpu::Mipmapped mipmapped() const
GrSurfaceProxyView makeView(int i) const
sk_sp< GrSurfaceProxy > refProxy(int i) const
GrSurfaceOrigin textureOrigin() const
static std::unique_ptr< GrFragmentProcessor > Make(const GrYUVATextureProxies &yuvaProxies, GrSamplerState samplerState, const GrCaps &, const SkMatrix &localMatrix=SkMatrix::I(), const SkRect *subset=nullptr, const SkRect *domain=nullptr)
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
Definition: SkBitmap.cpp:323
SkColorType colorType() const
Definition: SkBitmap.h:160
static bool Equals(const SkColorSpace *, const SkColorSpace *)
sk_sp< GrImageContext > fContext
GrImageContext * context() const final
static sk_sp< GrTextureProxy > MakePromiseImageLazyProxy(GrContextThreadSafeProxy *, SkISize dimensions, const GrBackendFormat &, skgpu::Mipmapped, SkImages::PromiseImageTextureFulfillProc, sk_sp< skgpu::RefCntedCallback > releaseHelper)
std::unique_ptr< GrFragmentProcessor > asFragmentProcessor(GrRecordingContext *, SkSamplingOptions, const SkTileMode[2], const SkMatrix &, const SkRect *, const SkRect *) const override
bool onIsProtected() const override
SkImage_GaneshYUVA(sk_sp< GrImageContext >, uint32_t uniqueID, GrYUVATextureProxies proxies, sk_sp< SkColorSpace >)
sk_sp< SkImage > onReinterpretColorSpace(sk_sp< SkColorSpace >) const final
GrSemaphoresSubmitted flush(GrDirectContext *, const GrFlushInfo &) const override
size_t textureSize() const override
std::tuple< GrSurfaceProxyView, GrColorType > asView(GrRecordingContext *, skgpu::Mipmapped, GrImageTexGenPolicy) const override
sk_sp< SkImage > onMakeColorTypeAndColorSpace(SkColorType, sk_sp< SkColorSpace >, GrDirectContext *) const final
bool setupMipmapsForPlanes(GrRecordingContext *) const
bool onHasMipmaps() const override
const SkImageInfo & imageInfo() const
Definition: SkImage.h:279
SkAlphaType alphaType() const
Definition: SkImage.cpp:154
bool isProtected() const
Definition: SkImage.cpp:294
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
bool scalePixels(const SkPixmap &dst, const SkSamplingOptions &) const
static SkSamplingOptions AnisoFallback(bool imageIsMipped)
int width() const
Definition: SkYUVAInfo.h:172
int numPlanes() const
Definition: SkYUVAInfo.h:204
static constexpr int kMaxPlanes
Definition: SkYUVAInfo.h:98
bool hasAlpha() const
Definition: SkYUVAInfo.h:185
SkYUVAInfo makeDimensions(SkISize) const
Definition: SkYUVAInfo.cpp:366
int height() const
Definition: SkYUVAInfo.h:173
int planeDimensions(SkISize planeDimensions[kMaxPlanes]) const
Definition: SkYUVAInfo.h:192
SkISize dimensions() const
Definition: SkYUVAInfo.h:171
DataType dataType() const
const SkYUVAInfo & yuvaInfo() const
const SkPixmap & plane(int i) const
static SkYUVAPixmaps Allocate(const SkYUVAPixmapInfo &yuvaPixmapInfo)
int numPlanes() const
bool isValid() const
T * get() const
Definition: SkRefCnt.h:303
static sk_sp< RefCntedCallback > Make(Callback proc, Context ctx)
GAsyncResult * result
static float max(float r, float g, float b)
Definition: hsl.cpp:49
static float min(float r, float g, float b)
Definition: hsl.cpp:48
SK_API sk_sp< SkImage > TextureFromYUVAPixmaps(GrRecordingContext *context, const SkYUVAPixmaps &pixmaps, skgpu::Mipmapped buildMips, bool limitToMaxTextureSize, sk_sp< SkColorSpace > imageColorSpace)
void * PromiseImageTextureContext
SK_API sk_sp< SkImage > PromiseTextureFromYUVA(skgpu::graphite::Recorder *, const skgpu::graphite::YUVABackendTextureInfo &, sk_sp< SkColorSpace > imageColorSpace, skgpu::graphite::Volatile, GraphitePromiseTextureFulfillProc, GraphitePromiseImageReleaseProc, GraphitePromiseTextureReleaseProc, GraphitePromiseImageContext imageContext, GraphitePromiseTextureFulfillContext planeContexts[], std::string_view label={})
SK_API sk_sp< SkImage > TextureFromYUVATextures(GrRecordingContext *context, const GrYUVABackendTextures &yuvaTextures, sk_sp< SkColorSpace > imageColorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
void * ReleaseContext
Definition: SkImage.h:50
void(*)(PromiseImageTextureContext) PromiseImageTextureReleaseProc
void(*)(ReleaseContext) TextureReleaseProc
Definition: SkImageGanesh.h:45
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SkSamplingOptions sampling
Definition: SkRecords.h:337
@ kNoAccess
back-end surface will not be used by client
const uint32_t fp
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
Definition: switches.h:259
Mipmapped
Definition: GpuTypes.h:53
Protected
Definition: GpuTypes.h:61
Definition: ref_ptr.h:256
const Scalar scale
Definition: SkSize.h:16
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
const SkCubicResampler cubic
const SkFilterMode filter
const SkMipmapMode mipmap