Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
GrRecordingContext Class Reference

#include <GrRecordingContext.h>

Inheritance diagram for GrRecordingContext:
GrImageContext GrContext_Base SkRefCnt SkRefCntBase GrDDLContext GrDirectContext

Classes

class  Arenas
 
class  OwnedArenas
 
struct  ProgramData
 
class  Stats
 

Public Member Functions

 ~GrRecordingContext () override
 
bool abandoned () override
 
SK_API bool colorTypeSupportedAsSurface (SkColorType colorType) const
 
SK_API int maxTextureSize () const
 
SK_API int maxRenderTargetSize () const
 
SK_API bool colorTypeSupportedAsImage (SkColorType) const
 
SK_API bool supportsProtectedContent () const
 
SK_API int maxSurfaceSampleCountForColorType (SkColorType colorType) const
 
SK_API sk_sp< const SkCapabilitiesskCapabilities () const
 
GrRecordingContextPriv priv ()
 
const GrRecordingContextPriv priv () const
 
- Public Member Functions inherited from GrImageContext
 ~GrImageContext () override
 
GrImageContextPriv priv ()
 
const GrImageContextPriv priv () const
 
- Public Member Functions inherited from GrContext_Base
 ~GrContext_Base () override
 
virtual GrDirectContextasDirectContext ()
 
SK_API GrBackendApi backend () const
 
SK_API GrBackendFormat defaultBackendFormat (SkColorType, GrRenderable) const
 
SK_API GrBackendFormat compressedBackendFormat (SkTextureCompressionType) const
 
SK_API int maxSurfaceSampleCountForColorType (SkColorType colorType) const
 
sk_sp< GrContextThreadSafeProxythreadSafeProxy ()
 
GrBaseContextPriv priv ()
 
const GrBaseContextPriv priv () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

 GrRecordingContext (sk_sp< GrContextThreadSafeProxy >, bool ddlRecording)
 
bool init () override
 
void abandonContext () override
 
GrDrawingManagerdrawingManager ()
 
void destroyDrawingManager ()
 
Arenas arenas ()
 
OwnedArenas && detachArenas ()
 
GrProxyProviderproxyProvider ()
 
const GrProxyProviderproxyProvider () const
 
virtual void recordProgramInfo (const GrProgramInfo *)
 
virtual void detachProgramData (skia_private::TArray< ProgramData > *)
 
sktext::gpu::TextBlobRedrawCoordinatorgetTextBlobRedrawCoordinator ()
 
const sktext::gpu::TextBlobRedrawCoordinatorgetTextBlobRedrawCoordinator () const
 
GrThreadSafeCachethreadSafeCache ()
 
const GrThreadSafeCachethreadSafeCache () const
 
void addOnFlushCallbackObject (GrOnFlushCallbackObject *)
 
GrRecordingContextasRecordingContext () override
 
Statsstats ()
 
const Statsstats () const
 
void dumpJSON (SkJSONWriter *) const
 
- Protected Member Functions inherited from GrImageContext
 GrImageContext (sk_sp< GrContextThreadSafeProxy >)
 
virtual SK_API void abandonContext ()
 
virtual SK_API bool abandoned ()
 
skgpu::SingleOwnersingleOwner () const
 
GrImageContextasImageContext () override
 
- Protected Member Functions inherited from GrContext_Base
 GrContext_Base (sk_sp< GrContextThreadSafeProxy >)
 
virtual bool init ()
 
uint32_t contextID () const
 
bool matches (GrContext_Base *candidate) const
 
const GrContextOptionsoptions () const
 
const GrCapscaps () const
 
sk_sp< const GrCapsrefCaps () const
 
virtual GrImageContextasImageContext ()
 
virtual GrRecordingContextasRecordingContext ()
 

Protected Attributes

class GrRecordingContext::Stats fStats
 
std::unique_ptr< GrAuditTrailfAuditTrail
 
- Protected Attributes inherited from GrContext_Base
sk_sp< GrContextThreadSafeProxyfThreadSafeProxy
 

Friends

class GrRecordingContextPriv
 
class GrDeferredDisplayList
 
class GrDeferredDisplayListPriv
 

Detailed Description

Definition at line 42 of file GrRecordingContext.h.

Constructor & Destructor Documentation

◆ ~GrRecordingContext()

GrRecordingContext::~GrRecordingContext ( )
override

Definition at line 57 of file GrRecordingContext.cpp.

◆ GrRecordingContext()

GrRecordingContext::GrRecordingContext ( sk_sp< GrContextThreadSafeProxy proxy,
bool  ddlRecording 
)
protected

Definition at line 50 of file GrRecordingContext.cpp.

51 : GrImageContext(std::move(proxy))
53 , fArenas(ddlRecording) {
54 fProxyProvider = std::make_unique<GrProxyProvider>(this);
55}
GrImageContext(sk_sp< GrContextThreadSafeProxy >)
std::unique_ptr< GrAuditTrail > fAuditTrail

Member Function Documentation

◆ abandonContext()

void GrRecordingContext::abandonContext ( )
overrideprotectedvirtual

Reimplemented from GrImageContext.

Reimplemented in GrDDLContext.

Definition at line 90 of file GrRecordingContext.cpp.

90 {
92
94}
virtual SK_API void abandonContext()

◆ abandoned()

bool GrRecordingContext::abandoned ( )
inlineoverridevirtual

Reports whether the GrDirectContext associated with this GrRecordingContext is abandoned. When called on a GrDirectContext it may actively check whether the underlying 3D API device/context has been disconnected before reporting the status. If so, calling this method will transition the GrDirectContext to the abandoned state.

Reimplemented from GrImageContext.

Definition at line 52 of file GrRecordingContext.h.

52{ return GrImageContext::abandoned(); }
virtual SK_API bool abandoned()

◆ addOnFlushCallbackObject()

void GrRecordingContext::addOnFlushCallbackObject ( GrOnFlushCallbackObject onFlushCBObject)
protected

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 157 of file GrRecordingContext.cpp.

157 {
158 this->drawingManager()->addOnFlushCallbackObject(onFlushCBObject);
159}
void addOnFlushCallbackObject(GrOnFlushCallbackObject *)
GrDrawingManager * drawingManager()

◆ arenas()

Arenas GrRecordingContext::arenas ( )
inlineprotected

Definition at line 158 of file GrRecordingContext.h.

158{ return fArenas.get(); }

◆ asRecordingContext()

GrRecordingContext * GrRecordingContext::asRecordingContext ( )
inlineoverrideprotectedvirtual

Reimplemented from GrContext_Base.

Definition at line 208 of file GrRecordingContext.h.

208{ return this; }

◆ colorTypeSupportedAsImage()

bool GrRecordingContext::colorTypeSupportedAsImage ( SkColorType  colorType) const

Can a SkImage be created with the given color type.

Definition at line 171 of file GrRecordingContext.cpp.

171 {
175 return format.isValid();
176}
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
Definition: GrTypesPriv.h:629
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
bool isValid() const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
Definition: GrCaps.cpp:400
const GrCaps * caps() const
uint32_t uint32_t * format

◆ colorTypeSupportedAsSurface()

SK_API bool GrRecordingContext::colorTypeSupportedAsSurface ( SkColorType  colorType) const
inline

Definition at line 58 of file GrRecordingContext.h.

58 {
65 return false;
66 }
67
69 }
@ kR16G16B16A16_unorm_SkColorType
pixel with a little endian uint16_t for red, green, blue
Definition: SkColorType.h:50
@ kA16_unorm_SkColorType
pixel with a little endian uint16_t for alpha
Definition: SkColorType.h:48
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition: SkColorType.h:35
@ kA16_float_SkColorType
pixel with a half float for alpha
Definition: SkColorType.h:45
@ kR16G16_unorm_SkColorType
pixel with a little endian uint16_t for red and green
Definition: SkColorType.h:49
@ kR16G16_float_SkColorType
pixel with a half float for red and green
Definition: SkColorType.h:46
SK_API int maxSurfaceSampleCountForColorType(SkColorType colorType) const

◆ destroyDrawingManager()

void GrRecordingContext::destroyDrawingManager ( )
protected

Definition at line 100 of file GrRecordingContext.cpp.

100 {
101 fDrawingManager.reset();
102}

◆ detachArenas()

GrRecordingContext::OwnedArenas && GrRecordingContext::detachArenas ( )
protected

Definition at line 137 of file GrRecordingContext.cpp.

137 {
138 return std::move(fArenas);
139}

◆ detachProgramData()

virtual void GrRecordingContext::detachProgramData ( skia_private::TArray< ProgramData > *  )
inlineprotectedvirtual

Definition at line 192 of file GrRecordingContext.h.

192{}

◆ drawingManager()

GrDrawingManager * GrRecordingContext::drawingManager ( )
protected

Definition at line 96 of file GrRecordingContext.cpp.

96 {
97 return fDrawingManager.get();
98}

◆ dumpJSON()

void GrRecordingContext::dumpJSON ( SkJSONWriter ) const
protected

Definition at line 198 of file GrRecordingContext.cpp.

198{ }

◆ getTextBlobRedrawCoordinator() [1/2]

TextBlobRedrawCoordinator * GrRecordingContext::getTextBlobRedrawCoordinator ( )
protected

Definition at line 141 of file GrRecordingContext.cpp.

141 {
143}
sktext::gpu::TextBlobRedrawCoordinator * getTextBlobRedrawCoordinator()
GrContextThreadSafeProxyPriv priv()
sk_sp< GrContextThreadSafeProxy > fThreadSafeProxy

◆ getTextBlobRedrawCoordinator() [2/2]

const TextBlobRedrawCoordinator * GrRecordingContext::getTextBlobRedrawCoordinator ( ) const
protected

Definition at line 145 of file GrRecordingContext.cpp.

145 {
147}

◆ init()

bool GrRecordingContext::init ( )
overrideprotectedvirtual

Reimplemented from GrContext_Base.

Definition at line 61 of file GrRecordingContext.cpp.

61 {
62 if (!GrImageContext::init()) {
63 return false;
64 }
65
68#if defined(GR_TEST_UTILS)
69 prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
70#endif
71 // FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
72 if (this->options().fDisableDistanceFieldPaths) {
74 }
75
76 bool reduceOpsTaskSplitting = true;
77 if (this->caps()->avoidReorderingRenderTasks()) {
78 reduceOpsTaskSplitting = false;
79 } else if (GrContextOptions::Enable::kYes == this->options().fReduceOpsTaskSplitting) {
80 reduceOpsTaskSplitting = true;
81 } else if (GrContextOptions::Enable::kNo == this->options().fReduceOpsTaskSplitting) {
82 reduceOpsTaskSplitting = false;
83 }
84 fDrawingManager.reset(new GrDrawingManager(this,
85 prcOptions,
86 reduceOpsTaskSplitting));
87 return true;
88}
GpuPathRenderers
Definition: GrTypesPriv.h:506
virtual bool init()
const GrContextOptions & options() const

◆ maxRenderTargetSize()

int GrRecordingContext::maxRenderTargetSize ( ) const

Gets the maximum supported render target size.

Definition at line 169 of file GrRecordingContext.cpp.

169{ return this->caps()->maxRenderTargetSize(); }
int maxRenderTargetSize() const
Definition: GrCaps.h:223

◆ maxSurfaceSampleCountForColorType()

SK_API int GrRecordingContext::maxSurfaceSampleCountForColorType ( SkColorType  colorType) const
inline

Gets the maximum supported sample count for a color type. 1 is returned if only non-MSAA rendering is supported for the color type. 0 is returned if rendering to this color type is not supported at all.

Definition at line 96 of file GrRecordingContext.h.

96 {
98 }
SK_API int maxSurfaceSampleCountForColorType(SkColorType colorType) const

◆ maxTextureSize()

int GrRecordingContext::maxTextureSize ( ) const

Gets the maximum supported texture size.

Definition at line 167 of file GrRecordingContext.cpp.

167{ return this->caps()->maxTextureSize(); }
int maxTextureSize() const
Definition: GrCaps.h:229

◆ priv() [1/2]

GrRecordingContextPriv GrRecordingContext::priv ( )
inline

Definition at line 231 of file GrRecordingContextPriv.h.

231{ return GrRecordingContextPriv(this); }
friend class GrRecordingContextPriv

◆ priv() [2/2]

const GrRecordingContextPriv GrRecordingContext::priv ( ) const
inline

Definition at line 233 of file GrRecordingContextPriv.h.

233 { // NOLINT(readability-const-return-type)
234 return GrRecordingContextPriv(const_cast<GrRecordingContext*>(this));
235}

◆ proxyProvider() [1/2]

GrProxyProvider * GrRecordingContext::proxyProvider ( )
inlineprotected

Definition at line 163 of file GrRecordingContext.h.

163{ return fProxyProvider.get(); }

◆ proxyProvider() [2/2]

const GrProxyProvider * GrRecordingContext::proxyProvider ( ) const
inlineprotected

Definition at line 164 of file GrRecordingContext.h.

164{ return fProxyProvider.get(); }

◆ recordProgramInfo()

virtual void GrRecordingContext::recordProgramInfo ( const GrProgramInfo )
inlineprotectedvirtual

Definition at line 186 of file GrRecordingContext.h.

186{}

◆ skCapabilities()

sk_sp< const SkCapabilities > GrRecordingContext::skCapabilities ( ) const

Definition at line 163 of file GrRecordingContext.cpp.

163 {
164 return this->refCaps();
165}
sk_sp< const GrCaps > refCaps() const

◆ stats() [1/2]

Stats * GrRecordingContext::stats ( )
inlineprotected

Definition at line 259 of file GrRecordingContext.h.

259{ return &fStats; }
class GrRecordingContext::Stats fStats

◆ stats() [2/2]

const Stats * GrRecordingContext::stats ( ) const
inlineprotected

Definition at line 260 of file GrRecordingContext.h.

260{ return &fStats; }

◆ supportsProtectedContent()

bool GrRecordingContext::supportsProtectedContent ( ) const

Does this context support protected content?

Definition at line 178 of file GrRecordingContext.cpp.

178 {
179 return this->caps()->supportsProtectedContent();
180}
bool supportsProtectedContent() const
Definition: GrCaps.h:422

◆ threadSafeCache() [1/2]

GrThreadSafeCache * GrRecordingContext::threadSafeCache ( )
protected

Definition at line 149 of file GrRecordingContext.cpp.

149 {
151}

◆ threadSafeCache() [2/2]

const GrThreadSafeCache * GrRecordingContext::threadSafeCache ( ) const
protected

Definition at line 153 of file GrRecordingContext.cpp.

153 {
155}

Friends And Related Function Documentation

◆ GrDeferredDisplayList

friend class GrDeferredDisplayList
friend

Definition at line 127 of file GrRecordingContext.h.

◆ GrDeferredDisplayListPriv

friend class GrDeferredDisplayListPriv
friend

Definition at line 128 of file GrRecordingContext.h.

◆ GrRecordingContextPriv

friend class GrRecordingContextPriv
friend

Definition at line 126 of file GrRecordingContext.h.

Member Data Documentation

◆ fAuditTrail

std::unique_ptr<GrAuditTrail> GrRecordingContext::fAuditTrail
protected

Definition at line 265 of file GrRecordingContext.h.

◆ fStats

class GrRecordingContext::Stats GrRecordingContext::fStats
protected

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