Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
GrRecordingContextPriv Class Reference

#include <GrRecordingContextPriv.h>

Inheritance diagram for GrRecordingContextPriv:
GrImageContextPriv GrBaseContextPriv GrDirectContextPriv

Public Member Functions

GrRecordingContextcontext ()
 
const GrRecordingContextcontext () const
 
GrProxyProviderproxyProvider ()
 
const GrProxyProviderproxyProvider () const
 
GrDrawingManagerdrawingManager ()
 
SkArenaAllocrecordTimeAllocator ()
 
sktext::gpu::SubRunAllocatorrecordTimeSubRunAllocator ()
 
GrRecordingContext::Arenas arenas ()
 
GrRecordingContext::OwnedArenas && detachArenas ()
 
void recordProgramInfo (const GrProgramInfo *programInfo)
 
void detachProgramData (skia_private::TArray< GrRecordingContext::ProgramData > *dst)
 
sktext::gpu::TextBlobRedrawCoordinatorgetTextBlobCache ()
 
GrThreadSafeCachethreadSafeCache ()
 
void moveRenderTasksToDDL (GrDeferredDisplayList *)
 
void addOnFlushCallbackObject (GrOnFlushCallbackObject *)
 
GrAuditTrailauditTrail ()
 
void printWarningMessage (const char *msg) const
 
GrRecordingContext::Statsstats ()
 
sktext::gpu::SDFTControl getSDFTControl (bool useSDFTForSmallText) const
 
sk_sp< skgpu::ganesh::DevicecreateDevice (GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &, skgpu::ganesh::Device::InitContents)
 
sk_sp< skgpu::ganesh::DevicecreateDevice (skgpu::Budgeted, const SkImageInfo &, SkBackingFit, int sampleCount, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin, const SkSurfaceProps &, skgpu::ganesh::Device::InitContents)
 
std::unique_ptr< skgpu::ganesh::SurfaceContextmakeSC (GrSurfaceProxyView readView, const GrColorInfo &)
 
std::unique_ptr< skgpu::ganesh::SurfaceContextmakeSC (const GrImageInfo &, const GrBackendFormat &, std::string_view label, SkBackingFit=SkBackingFit::kExact, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Renderable=skgpu::Renderable::kNo, int renderTargetSampleCnt=1, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Protected=skgpu::Protected::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
 
std::unique_ptr< skgpu::ganesh::SurfaceFillContextmakeSFC (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)
 
std::unique_ptr< skgpu::ganesh::SurfaceFillContextmakeSFC (SkAlphaType, sk_sp< SkColorSpace >, SkISize dimensions, SkBackingFit, const GrBackendFormat &, int sampleCount, skgpu::Mipmapped, skgpu::Protected, skgpu::Swizzle readSwizzle, skgpu::Swizzle writeSwizzle, GrSurfaceOrigin, skgpu::Budgeted, std::string_view label)
 
std::unique_ptr< skgpu::ganesh::SurfaceFillContextmakeSFCWithFallback (GrImageInfo, SkBackingFit, int sampleCount, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
 
std::unique_ptr< skgpu::ganesh::SurfaceFillContextmakeSFCFromBackendTexture (GrColorInfo, const GrBackendTexture &, int sampleCount, GrSurfaceOrigin, sk_sp< skgpu::RefCntedCallback > releaseHelper)
 
- Public Member Functions inherited from GrImageContextPriv
GrImageContextcontext ()
 
const GrImageContextcontext () const
 
bool abandoned ()
 
 SkDEBUGCODE (skgpu::SingleOwner *singleOwner() const { return this->context() ->singleOwner();}) protected
 
- Public Member Functions inherited from GrBaseContextPriv
GrContext_Basecontext ()
 
const GrContext_Basecontext () const
 
uint32_t contextID () const
 
bool matches (GrContext_Base *candidate) const
 
const GrContextOptionsoptions () const
 
const GrCapscaps () const
 
sk_sp< const GrCapsrefCaps () const
 
GrImageContextasImageContext ()
 
GrRecordingContextasRecordingContext ()
 
GrDirectContextasDirectContext ()
 
GrContextOptions::ShaderErrorHandlergetShaderErrorHandler () const
 

Static Public Member Functions

static sk_sp< GrRecordingContextMakeDDL (sk_sp< GrContextThreadSafeProxy >)
 
- Static Public Member Functions inherited from GrImageContextPriv
static sk_sp< GrImageContextMakeForPromiseImage (sk_sp< GrContextThreadSafeProxy > tsp)
 

Protected Member Functions

 GrRecordingContextPriv (GrRecordingContext *rContext)
 
- Protected Member Functions inherited from GrBaseContextPriv
 GrBaseContextPriv (GrContext_Base *context)
 

Friends

class GrRecordingContext
 

Additional Inherited Members

- Protected Attributes inherited from GrBaseContextPriv
GrContext_BasefContext
 

Detailed Description

Class that exposes methods on GrRecordingContext that are only intended for use internal to Skia. This class is purely a privileged window into GrRecordingContext. It should never have additional data members or virtual methods.

Definition at line 33 of file GrRecordingContextPriv.h.

Constructor & Destructor Documentation

◆ GrRecordingContextPriv()

GrRecordingContextPriv::GrRecordingContextPriv ( GrRecordingContext rContext)
inlineexplicitprotected

Definition at line 216 of file GrRecordingContextPriv.h.

Member Function Documentation

◆ addOnFlushCallbackObject()

void GrRecordingContextPriv::addOnFlushCallbackObject ( GrOnFlushCallbackObject onFlushCBObject)

Registers an object for flush-related callbacks. (See GrOnFlushCallbackObject.)

NOTE: the drawing manager tracks this object as a raw pointer; it is up to the caller to ensure its lifetime is tied to that of the context.

Definition at line 20 of file GrRecordingContextPriv.cpp.

20 {
21 this->context()->addOnFlushCallbackObject(onFlushCBObject);
22}
GrRecordingContext * context()
void addOnFlushCallbackObject(GrOnFlushCallbackObject *)

◆ arenas()

GrRecordingContext::Arenas GrRecordingContextPriv::arenas ( )
inline

Definition at line 49 of file GrRecordingContextPriv.h.

49{ return this->context()->arenas(); }

◆ auditTrail()

GrAuditTrail * GrRecordingContextPriv::auditTrail ( )
inline

Definition at line 77 of file GrRecordingContextPriv.h.

77{ return this->context()->fAuditTrail.get(); }
std::unique_ptr< GrAuditTrail > fAuditTrail

◆ context() [1/2]

GrRecordingContext * GrRecordingContextPriv::context ( )
inline

Definition at line 35 of file GrRecordingContextPriv.h.

35{ return static_cast<GrRecordingContext*>(fContext); }
GrContext_Base * fContext

◆ context() [2/2]

const GrRecordingContext * GrRecordingContextPriv::context ( ) const
inline

Definition at line 36 of file GrRecordingContextPriv.h.

36 {
37 return static_cast<const GrRecordingContext*>(fContext);
38 }

◆ createDevice() [1/2]

sk_sp< skgpu::ganesh::Device > GrRecordingContextPriv::createDevice ( GrColorType  colorType,
sk_sp< GrSurfaceProxy proxy,
sk_sp< SkColorSpace colorSpace,
GrSurfaceOrigin  origin,
const SkSurfaceProps props,
skgpu::ganesh::Device::InitContents  init 
)

Definition at line 24 of file GrRecordingContextPriv.cpp.

30 {
33 std::move(proxy),
34 std::move(colorSpace),
35 origin,
36 props,
37 init);
38}
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static sk_sp< Device > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &, InitContents)
Definition Device.cpp:212

◆ createDevice() [2/2]

sk_sp< skgpu::ganesh::Device > GrRecordingContextPriv::createDevice ( skgpu::Budgeted  budgeted,
const SkImageInfo ii,
SkBackingFit  fit,
int  sampleCount,
skgpu::Mipmapped  mipmapped,
skgpu::Protected  isProtected,
GrSurfaceOrigin  origin,
const SkSurfaceProps props,
skgpu::ganesh::Device::InitContents  init 
)

Definition at line 40 of file GrRecordingContextPriv.cpp.

49 {
51 budgeted,
52 ii,
53 fit,
54 sampleCount,
55 mipmapped,
56 isProtected,
57 origin,
58 props,
59 init);
60}

◆ detachArenas()

GrRecordingContext::OwnedArenas && GrRecordingContextPriv::detachArenas ( )
inline

Definition at line 51 of file GrRecordingContextPriv.h.

51{ return this->context()->detachArenas(); }
OwnedArenas && detachArenas()

◆ detachProgramData()

void GrRecordingContextPriv::detachProgramData ( skia_private::TArray< GrRecordingContext::ProgramData > *  dst)
inline

Definition at line 57 of file GrRecordingContextPriv.h.

57 {
58 this->context()->detachProgramData(dst);
59 }
virtual void detachProgramData(skia_private::TArray< ProgramData > *)

◆ drawingManager()

GrDrawingManager * GrRecordingContextPriv::drawingManager ( )
inline

Definition at line 43 of file GrRecordingContextPriv.h.

43{ return this->context()->drawingManager(); }
GrDrawingManager * drawingManager()

◆ getSDFTControl()

sktext::gpu::SDFTControl GrRecordingContextPriv::getSDFTControl ( bool  useSDFTForSmallText) const

Definition at line 66 of file GrRecordingContextPriv.cpp.

66 {
67#if !defined(SK_DISABLE_SDF_TEXT)
70 useSDFTForSmallText,
74#else
76#endif
77}
const GrContextOptions & options() const
const GrCaps * caps() const
bool disablePerspectiveSDFText() const
Definition GrCaps.h:550
const GrShaderCaps * shaderCaps() const
Definition GrCaps.h:63
bool supportsDistanceFieldText() const
Definition SkSLUtil.h:80

◆ getTextBlobCache()

sktext::gpu::TextBlobRedrawCoordinator * GrRecordingContextPriv::getTextBlobCache ( )
inline

Definition at line 61 of file GrRecordingContextPriv.h.

61 {
62 return this->context()->getTextBlobRedrawCoordinator();
63 }
sktext::gpu::TextBlobRedrawCoordinator * getTextBlobRedrawCoordinator()

◆ MakeDDL()

sk_sp< GrRecordingContext > GrRecordingContextPriv::MakeDDL ( sk_sp< GrContextThreadSafeProxy proxy)
static

Create a GrRecordingContext without a resource cache

Definition at line 114 of file GrDDLContext.cpp.

114 {
115 sk_sp<GrRecordingContext> context(new GrDDLContext(std::move(proxy)));
116
117 if (!context->init()) {
118 return nullptr;
119 }
120 return context;
121}

◆ makeSC() [1/2]

std::unique_ptr< skgpu::ganesh::SurfaceContext > GrRecordingContextPriv::makeSC ( const GrImageInfo info,
const GrBackendFormat format,
std::string_view  label,
SkBackingFit  fit = SkBackingFit::kExact,
GrSurfaceOrigin  origin = kTopLeft_GrSurfaceOrigin,
skgpu::Renderable  renderable = skgpu::Renderable::kNo,
int  renderTargetSampleCnt = 1,
skgpu::Mipmapped  mipmapped = skgpu::Mipmapped::kNo,
skgpu::Protected  isProtected = skgpu::Protected::kNo,
skgpu::Budgeted  budgeted = skgpu::Budgeted::kYes 
)

Definition at line 121 of file GrRecordingContextPriv.cpp.

131 {
132 SkASSERT(renderable == GrRenderable::kYes || sampleCount == 1);
133 if (this->abandoned()) {
134 return nullptr;
135 }
137 this->proxyProvider()->createProxy(format,
138 info.dimensions(),
139 renderable,
140 sampleCount,
141 mipmapped,
142 fit,
143 budgeted,
144 isProtected,
145 label);
146 if (!proxy) {
147 return nullptr;
148 }
149
150 skgpu::Swizzle swizzle;
151 if (info.colorType() != GrColorType::kUnknown &&
152 !this->caps()->isFormatCompressed(format)) {
153 swizzle = this->caps()->getReadSwizzle(format, info.colorType());
154 }
155
156 GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
157 return this->makeSC(std::move(view), info.colorInfo());
158}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
#define SkASSERT(cond)
Definition SkAssert.h:116
skgpu::Swizzle getReadSwizzle(const GrBackendFormat &format, GrColorType colorType) const
Definition GrCaps.cpp:443
sk_sp< GrTextureProxy > createProxy(const GrBackendFormat &, SkISize dimensions, GrRenderable, int renderTargetSampleCnt, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, GrProtected, std::string_view label, GrInternalSurfaceFlags=GrInternalSurfaceFlags::kNone, UseAllocator useAllocator=UseAllocator::kYes)
GrProxyProvider * proxyProvider()
std::unique_ptr< skgpu::ganesh::SurfaceContext > makeSC(GrSurfaceProxyView readView, const GrColorInfo &)
uint32_t uint32_t * format

◆ makeSC() [2/2]

std::unique_ptr< skgpu::ganesh::SurfaceContext > GrRecordingContextPriv::makeSC ( GrSurfaceProxyView  readView,
const GrColorInfo info 
)

Definition at line 79 of file GrRecordingContextPriv.cpp.

80 {
81 // It is probably not necessary to check if the context is abandoned here since uses of the
82 // SurfaceContext which need the context will mostly likely fail later on w/o an issue.
83 // However having this here adds some reassurance in case there is a path that doesn't
84 // handle an abandoned context correctly. It also lets us early out of some extra work.
85 if (this->context()->abandoned()) {
86 return nullptr;
87 }
88 GrSurfaceProxy* proxy = readView.proxy();
89 SkASSERT(proxy && proxy->asTextureProxy());
90
91 std::unique_ptr<skgpu::ganesh::SurfaceContext> sc;
92 if (proxy->asRenderTargetProxy()) {
93 // Will we ever want a swizzle that is not the default write swizzle for the format and
94 // colorType here? If so we will need to manually pass that in.
95 skgpu::Swizzle writeSwizzle;
96 if (info.colorType() != GrColorType::kUnknown) {
97 writeSwizzle = this->caps()->getWriteSwizzle(proxy->backendFormat(),
98 info.colorType());
99 }
100 GrSurfaceProxyView writeView(readView.refProxy(), readView.origin(), writeSwizzle);
101 if (info.alphaType() == kPremul_SkAlphaType ||
102 info.alphaType() == kOpaque_SkAlphaType) {
103 sc = std::make_unique<skgpu::ganesh::SurfaceDrawContext>(this->context(),
104 std::move(readView),
105 std::move(writeView),
106 info.colorType(),
107 info.refColorSpace(),
109 } else {
110 sc = std::make_unique<skgpu::ganesh::SurfaceFillContext>(
111 this->context(), std::move(readView), std::move(writeView), info);
112 }
113 } else {
114 sc = std::make_unique<skgpu::ganesh::SurfaceContext>(
115 this->context(), std::move(readView), info);
116 }
117 SkDEBUGCODE(sc->validate();)
118 return sc;
119}
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
virtual skgpu::Swizzle getWriteSwizzle(const GrBackendFormat &, GrColorType) const =0
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
sk_sp< GrSurfaceProxy > refProxy() const
virtual GrRenderTargetProxy * asRenderTargetProxy()
const GrBackendFormat & backendFormat() const
virtual GrTextureProxy * asTextureProxy()

◆ makeSFC() [1/2]

std::unique_ptr< skgpu::ganesh::SurfaceFillContext > GrRecordingContextPriv::makeSFC ( GrImageInfo  info,
std::string_view  label,
SkBackingFit  fit = SkBackingFit::kExact,
int  sampleCount = 1,
skgpu::Mipmapped  mipmapped = skgpu::Mipmapped::kNo,
skgpu::Protected  isProtected = skgpu::Protected::kNo,
GrSurfaceOrigin  origin = kTopLeft_GrSurfaceOrigin,
skgpu::Budgeted  budgeted = skgpu::Budgeted::kYes 
)

Uses GrImageInfo's color type to pick the default texture format. Will return a SurfaceDrawContext if possible.

Definition at line 160 of file GrRecordingContextPriv.cpp.

168 {
169 if (info.alphaType() == kPremul_SkAlphaType || info.alphaType() == kOpaque_SkAlphaType) {
171 info.colorType(),
172 info.refColorSpace(),
173 fit,
174 info.dimensions(),
176 label,
177 sampleCount,
178 mipmapped,
179 isProtected,
180 origin,
181 budgeted);
182 }
184 GrRenderable::kYes);
186 this->proxyProvider()->createProxy(format,
187 info.dimensions(),
188 GrRenderable::kYes,
189 sampleCount,
190 mipmapped,
191 fit,
192 budgeted,
193 isProtected,
194 label);
195 if (!proxy) {
196 return nullptr;
197 }
198 skgpu::Swizzle readSwizzle = this->caps()->getReadSwizzle (format, info.colorType());
199 skgpu::Swizzle writeSwizzle = this->caps()->getWriteSwizzle(format, info.colorType());
200
201 GrSurfaceProxyView readView( proxy, origin, readSwizzle);
202 GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
203 std::unique_ptr<skgpu::ganesh::SurfaceFillContext> sfc;
204 sfc = std::make_unique<skgpu::ganesh::SurfaceFillContext>(
205 this->context(), std::move(readView), std::move(writeView), info.colorInfo());
206 sfc->discard();
207 return sfc;
208}
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
Definition GrCaps.cpp:400
GrColorType colorType() const
Definition GrImageInfo.h:44
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)

◆ makeSFC() [2/2]

std::unique_ptr< skgpu::ganesh::SurfaceFillContext > GrRecordingContextPriv::makeSFC ( SkAlphaType  alphaType,
sk_sp< SkColorSpace colorSpace,
SkISize  dimensions,
SkBackingFit  fit,
const GrBackendFormat format,
int  sampleCount,
skgpu::Mipmapped  mipmapped,
skgpu::Protected  isProtected,
skgpu::Swizzle  readSwizzle,
skgpu::Swizzle  writeSwizzle,
GrSurfaceOrigin  origin,
skgpu::Budgeted  budgeted,
std::string_view  label 
)

Makes a custom configured SurfaceFillContext where the caller specifies the specific texture format and swizzles. The color type will be kUnknown. Returns a SurfaceDrawContext if possible.

Definition at line 210 of file GrRecordingContextPriv.cpp.

223 {
224 SkASSERT(!dimensions.isEmpty());
225 SkASSERT(sampleCount >= 1);
226 SkASSERT(format.isValid() && format.backend() == fContext->backend());
227 if (alphaType == kPremul_SkAlphaType || alphaType == kOpaque_SkAlphaType) {
229 std::move(colorSpace),
230 fit,
231 dimensions,
232 format,
233 sampleCount,
234 mipmapped,
235 isProtected,
236 readSwizzle,
237 writeSwizzle,
238 origin,
239 budgeted,
241 label);
242 }
243
245 this->proxyProvider()->createProxy(format,
246 dimensions,
247 GrRenderable::kYes,
248 sampleCount,
249 mipmapped,
250 fit,
251 budgeted,
252 isProtected,
253 label);
254 if (!proxy) {
255 return nullptr;
256 }
257 GrImageInfo info(GrColorType::kUnknown, alphaType, std::move(colorSpace), dimensions);
258 GrSurfaceProxyView readView( proxy, origin, readSwizzle);
259 GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
260 std::unique_ptr<skgpu::ganesh::SurfaceFillContext> sfc;
261 sfc = std::make_unique<skgpu::ganesh::SurfaceFillContext>(
262 this->context(), std::move(readView), std::move(writeView), info.colorInfo());
263 sfc->discard();
264 return sfc;
265}
SK_API GrBackendApi backend() const
bool isEmpty() const
Definition SkSize.h:31

◆ makeSFCFromBackendTexture()

std::unique_ptr< skgpu::ganesh::SurfaceFillContext > GrRecordingContextPriv::makeSFCFromBackendTexture ( GrColorInfo  info,
const GrBackendTexture tex,
int  sampleCount,
GrSurfaceOrigin  origin,
sk_sp< skgpu::RefCntedCallback releaseHelper 
)

Creates a SurfaceFillContext from an existing GrBackendTexture. The GrColorInfo's color type must be compatible with backend texture's format or this will fail. All formats are considered compatible with kUnknown. Returns a SurfaceDrawContext if possible.

Definition at line 305 of file GrRecordingContextPriv.cpp.

309 {
310 SkASSERT(sampleCount > 0);
311
312 if (info.alphaType() == kPremul_SkAlphaType || info.alphaType() == kOpaque_SkAlphaType) {
314 info.colorType(),
315 info.refColorSpace(),
316 tex,
317 sampleCount,
318 origin,
320 std::move(releaseHelper));
321 }
322
323 if (info.colorType() == GrColorType::kUnknown) {
324 return nullptr;
325 }
326
328 if (!this->caps()->areColorTypeAndFormatCompatible(info.colorType(), format)) {
329 return nullptr;
330 }
331 skgpu::Swizzle readSwizzle = this->caps()->getReadSwizzle (format, info.colorType());
332 skgpu::Swizzle writeSwizzle = this->caps()->getWriteSwizzle(format, info.colorType());
333
334 sk_sp<GrTextureProxy> proxy(this->proxyProvider()->wrapRenderableBackendTexture(
336 std::move(releaseHelper)));
337 if (!proxy) {
338 return nullptr;
339 }
340
341 GrSurfaceProxyView readView( proxy, origin, readSwizzle);
342 GrSurfaceProxyView writeView(std::move(proxy), origin, writeSwizzle);
343
344 return std::make_unique<skgpu::ganesh::SurfaceFillContext>(
345 this->context(), std::move(readView), std::move(writeView), std::move(info));
346}
@ kBorrow_GrWrapOwnership
Definition GrTypesPriv.h:78
GrBackendFormat getBackendFormat() const
GrColorType colorType() const
Definition GrColorInfo.h:43
static std::unique_ptr< SurfaceDrawContext > MakeFromBackendTexture(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, const GrBackendTexture &, int sampleCnt, GrSurfaceOrigin, const SkSurfaceProps &, sk_sp< skgpu::RefCntedCallback > releaseHelper)

◆ makeSFCWithFallback()

std::unique_ptr< skgpu::ganesh::SurfaceFillContext > GrRecordingContextPriv::makeSFCWithFallback ( GrImageInfo  info,
SkBackingFit  fit,
int  sampleCount,
skgpu::Mipmapped  mipmapped,
skgpu::Protected  isProtected,
GrSurfaceOrigin  origin = kTopLeft_GrSurfaceOrigin,
skgpu::Budgeted  budgeted = skgpu::Budgeted::kYes 
)

Like the above but uses GetFallbackColorTypeAndFormat to find a fallback color type (and compatible format) if the passed GrImageInfo's color type is not renderable.

Definition at line 267 of file GrRecordingContextPriv.cpp.

274 {
275 if (info.alphaType() == kPremul_SkAlphaType || info.alphaType() == kOpaque_SkAlphaType) {
277 info.colorType(),
278 info.refColorSpace(),
279 fit,
280 info.dimensions(),
282 sampleCount,
283 mipmapped,
284 isProtected,
285 origin,
286 budgeted);
287 }
288 const GrCaps* caps = this->caps();
289
290 auto [ct, _] = caps->getFallbackColorTypeAndFormat(info.colorType(), sampleCount);
291 if (ct == GrColorType::kUnknown) {
292 return nullptr;
293 }
294 info = info.makeColorType(ct);
295 return this->makeSFC(info, "MakeSurfaceContextWithFallback",
296 fit,
297 sampleCount,
298 mipmapped,
299 isProtected,
300 origin,
301 budgeted);
302}
std::tuple< GrColorType, GrBackendFormat > getFallbackColorTypeAndFormat(GrColorType, int sampleCount) const
Definition GrCaps.cpp:499
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)
static std::unique_ptr< SurfaceDrawContext > MakeWithFallback(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, SkBackingFit, SkISize dimensions, const SkSurfaceProps &, int sampleCnt, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin=kBottomLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)

◆ moveRenderTasksToDDL()

void GrRecordingContextPriv::moveRenderTasksToDDL ( GrDeferredDisplayList ddl)

Definition at line 62 of file GrRecordingContextPriv.cpp.

62 {
64}
void moveRenderTasksToDDL(GrDeferredDisplayList *ddl)

◆ printWarningMessage()

void GrRecordingContextPriv::printWarningMessage ( const char *  msg) const
inline

Definition at line 97 of file GrRecordingContextPriv.h.

97 {
98#if defined(GR_TEST_UTILS)
99 if (this->context()->fSuppressWarningMessages > 0) {
100 return;
101 }
102#endif
103 SkDebugf("%s", msg);
104 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1

◆ proxyProvider() [1/2]

GrProxyProvider * GrRecordingContextPriv::proxyProvider ( )
inline

Definition at line 40 of file GrRecordingContextPriv.h.

40{ return this->context()->proxyProvider(); }
GrProxyProvider * proxyProvider()

◆ proxyProvider() [2/2]

const GrProxyProvider * GrRecordingContextPriv::proxyProvider ( ) const
inline

Definition at line 41 of file GrRecordingContextPriv.h.

41{ return this->context()->proxyProvider(); }

◆ recordProgramInfo()

void GrRecordingContextPriv::recordProgramInfo ( const GrProgramInfo programInfo)
inline

Definition at line 53 of file GrRecordingContextPriv.h.

53 {
54 this->context()->recordProgramInfo(programInfo);
55 }
virtual void recordProgramInfo(const GrProgramInfo *)

◆ recordTimeAllocator()

SkArenaAlloc * GrRecordingContextPriv::recordTimeAllocator ( )
inline

Definition at line 45 of file GrRecordingContextPriv.h.

45{ return this->context()->arenas().recordTimeAllocator(); }

◆ recordTimeSubRunAllocator()

sktext::gpu::SubRunAllocator * GrRecordingContextPriv::recordTimeSubRunAllocator ( )
inline

Definition at line 46 of file GrRecordingContextPriv.h.

46 {
47 return this->context()->arenas().recordTimeSubRunAllocator();
48 }
sktext::gpu::SubRunAllocator * recordTimeSubRunAllocator()

◆ stats()

GrRecordingContext::Stats * GrRecordingContextPriv::stats ( )
inline

Definition at line 106 of file GrRecordingContextPriv.h.

106 {
107 return &this->context()->fStats;
108 }
class GrRecordingContext::Stats fStats

◆ threadSafeCache()

GrThreadSafeCache * GrRecordingContextPriv::threadSafeCache ( )
inline

Definition at line 65 of file GrRecordingContextPriv.h.

65{ return this->context()->threadSafeCache(); }
GrThreadSafeCache * threadSafeCache()

Friends And Related Symbol Documentation

◆ GrRecordingContext

friend class GrRecordingContext
friend

Definition at line 226 of file GrRecordingContextPriv.h.


The documentation for this class was generated from the following files: