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

#include <GrContext_Base.h>

Inheritance diagram for GrContext_Base:
SkRefCnt SkRefCntBase GrImageContext GrRecordingContext GrDDLContext GrDirectContext

Public Member Functions

 ~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

 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

sk_sp< GrContextThreadSafeProxyfThreadSafeProxy
 

Friends

class GrBaseContextPriv
 

Detailed Description

Definition at line 28 of file GrContext_Base.h.

Constructor & Destructor Documentation

◆ ~GrContext_Base()

GrContext_Base::~GrContext_Base ( )
override

Definition at line 26 of file GrContext_Base.cpp.

26{ }

◆ GrContext_Base()

GrContext_Base::GrContext_Base ( sk_sp< GrContextThreadSafeProxy proxy)
protected

Definition at line 22 of file GrContext_Base.cpp.

23 : fThreadSafeProxy(std::move(proxy)) {
24}
sk_sp< GrContextThreadSafeProxy > fThreadSafeProxy

Member Function Documentation

◆ asDirectContext()

virtual GrDirectContext * GrContext_Base::asDirectContext ( )
inlinevirtual

Reimplemented in GrDirectContext.

Definition at line 35 of file GrContext_Base.h.

35{ return nullptr; }

◆ asImageContext()

virtual GrImageContext * GrContext_Base::asImageContext ( )
inlineprotectedvirtual

Reimplemented in GrImageContext.

Definition at line 95 of file GrContext_Base.h.

95{ return nullptr; }

◆ asRecordingContext()

virtual GrRecordingContext * GrContext_Base::asRecordingContext ( )
inlineprotectedvirtual

Reimplemented in GrRecordingContext.

Definition at line 96 of file GrContext_Base.h.

96{ return nullptr; }

◆ backend()

GrBackendApi GrContext_Base::backend ( ) const

Definition at line 35 of file GrContext_Base.cpp.

35{ return fThreadSafeProxy->priv().backend(); }
GrContextThreadSafeProxyPriv priv()

◆ caps()

const GrCaps * GrContext_Base::caps ( ) const
protected

Definition at line 41 of file GrContext_Base.cpp.

41{ return fThreadSafeProxy->priv().caps(); }

◆ compressedBackendFormat()

GrBackendFormat GrContext_Base::compressedBackendFormat ( SkTextureCompressionType  c) const

Definition at line 49 of file GrContext_Base.cpp.

49 {
51}
GrBackendFormat compressedBackendFormat(SkTextureCompressionType c) const

◆ contextID()

uint32_t GrContext_Base::contextID ( ) const
protected

An identifier for this context. The id is used by all compatible contexts. For example, if SkImages are created on one thread using an image creation context, then fed into a DDL Recorder on second thread (which has a recording context) and finally replayed on a third thread with a direct context, then all three contexts will report the same id. It is an error for an image to be used with contexts that report different ids.

Definition at line 34 of file GrContext_Base.cpp.

◆ defaultBackendFormat()

GrBackendFormat GrContext_Base::defaultBackendFormat ( SkColorType  skColorType,
GrRenderable  renderable 
) const

Definition at line 44 of file GrContext_Base.cpp.

45 {
46 return fThreadSafeProxy->defaultBackendFormat(skColorType, renderable);
47}
GrBackendFormat defaultBackendFormat(SkColorType ct, GrRenderable renderable) const

◆ init()

bool GrContext_Base::init ( )
protectedvirtual

Reimplemented in GrDirectContext, and GrRecordingContext.

Definition at line 28 of file GrContext_Base.cpp.

28 {
30
31 return true;
32}
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ matches()

bool GrContext_Base::matches ( GrContext_Base candidate) const
inlineprotected

Definition at line 83 of file GrContext_Base.h.

83 {
84 return candidate && candidate->contextID() == this->contextID();
85 }
uint32_t contextID() const

◆ maxSurfaceSampleCountForColorType()

int GrContext_Base::maxSurfaceSampleCountForColorType ( SkColorType  colorType) const

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 53 of file GrContext_Base.cpp.

53 {
55}
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
int maxSurfaceSampleCountForColorType(SkColorType colorType) const

◆ options()

const GrContextOptions & GrContext_Base::options ( ) const
protected

Definition at line 37 of file GrContext_Base.cpp.

37 {
38 return fThreadSafeProxy->priv().options();
39}
const GrContextOptions & options() const

◆ priv() [1/2]

GrBaseContextPriv GrContext_Base::priv ( )
inline

Definition at line 52 of file GrBaseContextPriv.h.

52{ return GrBaseContextPriv(this); }
friend class GrBaseContextPriv

◆ priv() [2/2]

const GrBaseContextPriv GrContext_Base::priv ( ) const
inline

Definition at line 54 of file GrBaseContextPriv.h.

54 { // NOLINT(readability-const-return-type)
55 return GrBaseContextPriv(const_cast<GrContext_Base*>(this));
56}

◆ refCaps()

sk_sp< const GrCaps > GrContext_Base::refCaps ( ) const
protected

Definition at line 42 of file GrContext_Base.cpp.

42{ return fThreadSafeProxy->priv().refCaps(); }
sk_sp< const GrCaps > refCaps() const

◆ threadSafeProxy()

sk_sp< GrContextThreadSafeProxy > GrContext_Base::threadSafeProxy ( )

Definition at line 57 of file GrContext_Base.cpp.

57{ return fThreadSafeProxy; }

Friends And Related Function Documentation

◆ GrBaseContextPriv

friend class GrBaseContextPriv
friend

Definition at line 68 of file GrContext_Base.h.

Member Data Documentation

◆ fThreadSafeProxy

sk_sp<GrContextThreadSafeProxy> GrContext_Base::fThreadSafeProxy
protected

Definition at line 98 of file GrContext_Base.h.


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