Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
36#include "src/gpu/Swizzle.h"
50#include "src/gpu/ganesh/SkGr.h"
55
56#include <algorithm>
57#include <utility>
58
59enum class SkTileMode;
60struct SkRect;
61
63
65 uint32_t uniqueID,
67 sk_sp<SkColorSpace> imageColorSpace)
68 : INHERITED(std::move(context),
69 SkImageInfo::Make(proxies.yuvaInfo().dimensions(),
71 // If an alpha channel is present we always use kPremul. This
72 // is because, although the planar data is always un-premul,
73 // the final interleaved RGBA sample produced in the shader
74 // is premul (and similar if flattened via asView).
75 proxies.yuvaInfo().hasAlpha() ? kPremul_SkAlphaType
77 std::move(imageColorSpace)),
78 uniqueID)
79 , fYUVAProxies(std::move(proxies)) {
80 // The caller should have checked this, just verifying.
81 SkASSERT(fYUVAProxies.isValid());
82}
83
84// For onMakeColorTypeAndColorSpace() / onReinterpretColorSpace()
87 sk_sp<SkColorSpace> targetCS,
88 ColorSpaceMode csMode)
89 : INHERITED(std::move(context),
90 image->imageInfo().makeColorSpace(std::move(targetCS)),
92 , fYUVAProxies(image->fYUVAProxies)
93 // If we're *reinterpreting* in a new color space, leave fFromColorSpace null.
94 // If we're *converting* to a new color space, it must be non-null, so turn null into sRGB.
95 , fFromColorSpace(csMode == ColorSpaceMode::kReinterpret
96 ? nullptr
97 : (image->colorSpace() ? image->refColorSpace()
98 : SkColorSpace::MakeSRGB())) {}
99
101 if (!context || !fContext->priv().matches(context)) {
102 return false;
103 }
104 if (!context->priv().caps()->mipmapSupport()) {
105 // We succeed in this case by doing nothing.
106 return true;
107 }
108 int n = fYUVAProxies.yuvaInfo().numPlanes();
109 sk_sp<GrSurfaceProxy> newProxies[4];
110 for (int i = 0; i < n; ++i) {
111 auto* t = fYUVAProxies.proxy(i)->asTextureProxy();
112 if (t->mipmapped() == skgpu::Mipmapped::kNo && (t->width() > 1 || t->height() > 1)) {
113 auto newView = GrCopyBaseMipMapToView(context, fYUVAProxies.makeView(i));
114 if (!newView) {
115 return false;
116 }
117 SkASSERT(newView.swizzle() == fYUVAProxies.makeView(i).swizzle());
118 newProxies[i] = newView.detachProxy();
119 } else {
120 newProxies[i] = fYUVAProxies.refProxy(i);
121 }
122 }
123 fYUVAProxies =
124 GrYUVATextureProxies(fYUVAProxies.yuvaInfo(), newProxies, fYUVAProxies.textureOrigin());
125 SkASSERT(fYUVAProxies.isValid());
126 return true;
127}
128
129//////////////////////////////////////////////////////////////////////////////////////////////////
130
132 const GrFlushInfo& info) const {
133 if (!fContext->priv().matches(dContext) || dContext->abandoned()) {
134 if (info.fSubmittedProc) {
135 info.fSubmittedProc(info.fSubmittedContext, false);
136 }
137 if (info.fFinishedProc) {
138 info.fFinishedProc(info.fFinishedContext);
139 }
141 }
142
144 size_t numProxies = fYUVAProxies.numPlanes();
145 for (size_t i = 0; i < numProxies; ++i) {
146 proxies[i] = fYUVAProxies.proxy(i);
147 }
148 return dContext->priv().flushSurfaces(
149 {proxies, numProxies}, SkSurfaces::BackendSurfaceAccess::kNoAccess, info);
150}
151
153 return fYUVAProxies.mipmapped() == skgpu::Mipmapped::kYes;
154}
155
157 skgpu::Protected isProtected = fYUVAProxies.proxy(0)->isProtected();
158
159#if defined(SK_DEBUG)
160 for (int i = 1; i < fYUVAProxies.numPlanes(); ++i) {
161 SkASSERT(isProtected == fYUVAProxies.proxy(i)->isProtected());
162 }
163#endif
164
165 return isProtected == skgpu::Protected::kYes;
166}
167
168
170 size_t size = 0;
171 for (int i = 0; i < fYUVAProxies.numPlanes(); ++i) {
172 size += fYUVAProxies.proxy(i)->gpuMemorySize();
173 }
174 return size;
175}
176
178 sk_sp<SkColorSpace> targetCS,
179 GrDirectContext* direct) const {
180 // We explicitly ignore color type changes, for now.
181
182 // we may need a mutex here but for now we expect usage to be in a single thread
183 if (fOnMakeColorSpaceTarget &&
184 SkColorSpace::Equals(targetCS.get(), fOnMakeColorSpaceTarget.get())) {
185 return fOnMakeColorSpaceResult;
186 }
188 new SkImage_GaneshYUVA(sk_ref_sp(direct), this, targetCS, ColorSpaceMode::kConvert));
189 if (result) {
190 fOnMakeColorSpaceTarget = targetCS;
191 fOnMakeColorSpaceResult = result;
192 }
193 return result;
194}
195
197 return sk_sp<SkImage>(
198 new SkImage_GaneshYUVA(fContext, this, std::move(newCS), ColorSpaceMode::kReinterpret));
199}
200
201std::tuple<GrSurfaceProxyView, GrColorType> SkImage_GaneshYUVA::asView(GrRecordingContext* rContext,
202 skgpu::Mipmapped mipmapped,
203 GrImageTexGenPolicy) const {
204 if (!fContext->priv().matches(rContext)) {
205 return {};
206 }
207 auto sfc = rContext->priv().makeSFC(this->imageInfo(),
208 "Image_GpuYUVA_ReinterpretColorSpace",
210 /*sample count*/ 1,
211 mipmapped,
212 GrProtected::kNo,
213 fYUVAProxies.textureOrigin(),
215 if (!sfc) {
216 return {};
217 }
218
219 const GrCaps& caps = *rContext->priv().caps();
220 auto fp = GrYUVtoRGBEffect::Make(fYUVAProxies, GrSamplerState::Filter::kNearest, caps);
221 if (fFromColorSpace) {
222 fp = GrColorSpaceXformEffect::Make(std::move(fp),
223 fFromColorSpace.get(),
224 this->alphaType(),
225 this->colorSpace(),
226 this->alphaType());
227 }
228 sfc->fillWithFP(std::move(fp));
229
230 return {sfc->readSurfaceView(), sfc->colorInfo().colorType()};
231}
232
233std::unique_ptr<GrFragmentProcessor> SkImage_GaneshYUVA::asFragmentProcessor(
234 GrRecordingContext* context,
235 SkSamplingOptions sampling,
236 const SkTileMode tileModes[2],
237 const SkMatrix& m,
238 const SkRect* subset,
239 const SkRect* domain) const {
240 if (!fContext->priv().matches(context)) {
241 return {};
242 }
243 // At least for now we do not attempt aniso filtering on YUVA images.
244 if (sampling.isAniso()) {
245 sampling =
246 SkSamplingPriv::AnisoFallback(fYUVAProxies.mipmapped() == skgpu::Mipmapped::kYes);
247 }
248
249 auto wmx = SkTileModeToWrapMode(tileModes[0]);
250 auto wmy = SkTileModeToWrapMode(tileModes[1]);
251 GrSamplerState sampler(wmx, wmy, sampling.filter, sampling.mipmap);
252 if (sampler.mipmapped() == skgpu::Mipmapped::kYes && !this->setupMipmapsForPlanes(context)) {
253 sampler = GrSamplerState(sampler.wrapModeX(),
254 sampler.wrapModeY(),
255 sampler.filter(),
256 GrSamplerState::MipmapMode::kNone);
257 }
258
259 const auto& yuvM = sampling.useCubic ? SkMatrix::I() : m;
260 auto fp = GrYUVtoRGBEffect::Make(
261 fYUVAProxies, sampler, *context->priv().caps(), yuvM, subset, domain);
262 if (sampling.useCubic) {
263 fp = GrBicubicEffect::Make(std::move(fp),
264 this->alphaType(),
265 m,
266 sampling.cubic,
268 }
269 if (fFromColorSpace) {
270 fp = GrColorSpaceXformEffect::Make(std::move(fp),
271 fFromColorSpace.get(),
272 this->alphaType(),
273 this->colorSpace(),
274 this->alphaType());
275 }
276 return fp;
277}
278
279//////////////////////////////////////////////////////////////////////////////////////////////////
280namespace SkImages {
282 const GrYUVABackendTextures& yuvaTextures) {
283 return TextureFromYUVATextures(context, yuvaTextures, nullptr, nullptr, nullptr);
284}
285
287 const GrYUVABackendTextures& yuvaTextures,
288 sk_sp<SkColorSpace> imageColorSpace,
289 TextureReleaseProc textureReleaseProc,
290 ReleaseContext releaseContext) {
291 auto releaseHelper = skgpu::RefCntedCallback::Make(textureReleaseProc, releaseContext);
292
293 GrProxyProvider* proxyProvider = context->priv().proxyProvider();
294 int numPlanes = yuvaTextures.yuvaInfo().numPlanes();
296 for (int plane = 0; plane < numPlanes; ++plane) {
297 proxies[plane] = proxyProvider->wrapBackendTexture(yuvaTextures.texture(plane),
301 releaseHelper);
302 if (!proxies[plane]) {
303 return {};
304 }
305 }
306 GrYUVATextureProxies yuvaProxies(
307 yuvaTextures.yuvaInfo(), proxies, yuvaTextures.textureOrigin());
308
309 if (!yuvaProxies.isValid()) {
310 return nullptr;
311 }
312
313 return sk_make_sp<SkImage_GaneshYUVA>(
314 sk_ref_sp(context), kNeedNewImageUniqueID, yuvaProxies, imageColorSpace);
315}
316
318 const SkYUVAPixmaps& pixmaps,
319 skgpu::Mipmapped buildMips,
320 bool limitToMaxTextureSize) {
321 return TextureFromYUVAPixmaps(context, pixmaps, buildMips, limitToMaxTextureSize, nullptr);
322}
323
325 const SkYUVAPixmaps& pixmaps,
326 skgpu::Mipmapped buildMips,
327 bool limitToMaxTextureSize,
328 sk_sp<SkColorSpace> imageColorSpace) {
329 if (!context) {
330 return nullptr;
331 }
332
333 if (!pixmaps.isValid()) {
334 return nullptr;
335 }
336
337 if (!context->priv().caps()->mipmapSupport()) {
338 buildMips = skgpu::Mipmapped::kNo;
339 }
340
341 // Resize the pixmaps if necessary.
342 int numPlanes = pixmaps.numPlanes();
343 int maxTextureSize = context->priv().caps()->maxTextureSize();
344 int maxDim = std::max(pixmaps.yuvaInfo().width(), pixmaps.yuvaInfo().height());
345
346 SkYUVAPixmaps tempPixmaps;
347 const SkYUVAPixmaps* pixmapsToUpload = &pixmaps;
348 // We assume no plane is larger than the image size (and at least one plane is as big).
349 if (maxDim > maxTextureSize) {
350 if (!limitToMaxTextureSize) {
351 return nullptr;
352 }
353 float scale = static_cast<float>(maxTextureSize) / maxDim;
354 SkISize newDimensions = {
355 std::min(static_cast<int>(pixmaps.yuvaInfo().width() * scale), maxTextureSize),
356 std::min(static_cast<int>(pixmaps.yuvaInfo().height() * scale), maxTextureSize)};
357 SkYUVAInfo newInfo = pixmaps.yuvaInfo().makeDimensions(newDimensions);
358 SkYUVAPixmapInfo newPixmapInfo(newInfo, pixmaps.dataType(), /*row bytes*/ nullptr);
359 tempPixmaps = SkYUVAPixmaps::Allocate(newPixmapInfo);
361 if (!tempPixmaps.isValid()) {
362 return nullptr;
363 }
364 for (int i = 0; i < numPlanes; ++i) {
365 if (!pixmaps.plane(i).scalePixels(tempPixmaps.plane(i), sampling)) {
366 return nullptr;
367 }
368 }
369 pixmapsToUpload = &tempPixmaps;
370 }
371
372 // Convert to texture proxies.
374 GrColorType pixmapColorTypes[SkYUVAInfo::kMaxPlanes];
375 for (int i = 0; i < numPlanes; ++i) {
376 // Turn the pixmap into a GrTextureProxy
377 SkBitmap bmp;
378 bmp.installPixels(pixmapsToUpload->plane(i));
379 std::tie(views[i], std::ignore) = GrMakeUncachedBitmapProxyView(context, bmp, buildMips);
380 if (!views[i]) {
381 return nullptr;
382 }
383 pixmapColorTypes[i] = SkColorTypeToGrColorType(bmp.colorType());
384 }
385
386 GrYUVATextureProxies yuvaProxies(pixmapsToUpload->yuvaInfo(), views, pixmapColorTypes);
387 SkASSERT(yuvaProxies.isValid());
388 return sk_make_sp<SkImage_GaneshYUVA>(sk_ref_sp(context),
390 std::move(yuvaProxies),
391 std::move(imageColorSpace));
392}
393
395 const GrYUVABackendTextureInfo& backendTextureInfo,
396 sk_sp<SkColorSpace> imageColorSpace,
397 PromiseImageTextureFulfillProc textureFulfillProc,
398 PromiseImageTextureReleaseProc textureReleaseProc,
399 PromiseImageTextureContext textureContexts[]) {
400 if (!backendTextureInfo.isValid()) {
401 return nullptr;
402 }
403
404 SkISize planeDimensions[SkYUVAInfo::kMaxPlanes];
405 int n = backendTextureInfo.yuvaInfo().planeDimensions(planeDimensions);
406
407 // Our contract is that we will always call the release proc even on failure.
408 // We use the helper to convey the context, so we need to ensure make doesn't fail.
409 textureReleaseProc = textureReleaseProc ? textureReleaseProc : [](void*) {};
410 sk_sp<skgpu::RefCntedCallback> releaseHelpers[4];
411 for (int i = 0; i < n; ++i) {
412 releaseHelpers[i] = skgpu::RefCntedCallback::Make(textureReleaseProc, textureContexts[i]);
413 }
414
415 if (!threadSafeProxy) {
416 return nullptr;
417 }
418
419 SkAlphaType at =
420 backendTextureInfo.yuvaInfo().hasAlpha() ? kPremul_SkAlphaType : kOpaque_SkAlphaType;
422 backendTextureInfo.yuvaInfo().dimensions(), kAssumedColorType, at, imageColorSpace);
423 if (!SkImageInfoIsValid(info)) {
424 return nullptr;
425 }
426
427 // Make a lazy proxy for each plane
428 sk_sp<GrSurfaceProxy> proxies[4];
429 for (int i = 0; i < n; ++i) {
430 proxies[i] =
432 planeDimensions[i],
433 backendTextureInfo.planeFormat(i),
434 skgpu::Mipmapped::kNo,
435 textureFulfillProc,
436 std::move(releaseHelpers[i]));
437 if (!proxies[i]) {
438 return nullptr;
439 }
440 }
441 GrYUVATextureProxies yuvaTextureProxies(
442 backendTextureInfo.yuvaInfo(), proxies, backendTextureInfo.textureOrigin());
443 SkASSERT(yuvaTextureProxies.isValid());
444 sk_sp<GrImageContext> ctx(GrImageContextPriv::MakeForPromiseImage(std::move(threadSafeProxy)));
445 return sk_make_sp<SkImage_GaneshYUVA>(std::move(ctx),
447 std::move(yuvaTextureProxies),
448 std::move(imageColorSpace));
449}
450} // namespace SkImages
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
@ kRead_GrIOType
@ kBorrow_GrWrapOwnership
Definition GrTypesPriv.h:78
GrColorType
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
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
static constexpr auto kAssumedColorType
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
#define INHERITED(method,...)
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)
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()
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
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)
sk_sp< SkImage > image
Definition examples.cpp:29
GAsyncResult * result
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[])
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
@ kNoAccess
back-end surface will not be used by client
Mipmapped
Definition GpuTypes.h:53
Protected
Definition GpuTypes.h:61
Definition ref_ptr.h:256
const Scalar scale
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
const SkCubicResampler cubic
const SkFilterMode filter
const SkMipmapMode mipmap