Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Friends | List of all members
GrSurfaceCharacterization Class Reference

#include <GrSurfaceCharacterization.h>

Public Types

enum class  Textureable : bool { kNo = false , kYes = true }
 
enum class  UsesGLFBO0 : bool { kNo = false , kYes = true }
 
enum class  VkRTSupportsInputAttachment : bool { kNo = false , kYes = true }
 
enum class  VulkanSecondaryCBCompatible : bool { kNo = false , kYes = true }
 

Public Member Functions

 GrSurfaceCharacterization ()
 
 GrSurfaceCharacterization (GrSurfaceCharacterization &&)=default
 
GrSurfaceCharacterizationoperator= (GrSurfaceCharacterization &&)=default
 
 GrSurfaceCharacterization (const GrSurfaceCharacterization &)=default
 
GrSurfaceCharacterizationoperator= (const GrSurfaceCharacterization &other)=default
 
bool operator== (const GrSurfaceCharacterization &other) const
 
bool operator!= (const GrSurfaceCharacterization &other) const
 
GrSurfaceCharacterization createResized (int width, int height) const
 
GrSurfaceCharacterization createColorSpace (sk_sp< SkColorSpace >) const
 
GrSurfaceCharacterization createBackendFormat (SkColorType colorType, const GrBackendFormat &backendFormat) const
 
GrSurfaceCharacterization createFBO0 (bool usesGLFBO0) const
 
GrContextThreadSafeProxycontextInfo () const
 
sk_sp< GrContextThreadSafeProxyrefContextInfo () const
 
size_t cacheMaxResourceBytes () const
 
bool isValid () const
 
const SkImageInfoimageInfo () const
 
const GrBackendFormatbackendFormat () const
 
GrSurfaceOrigin origin () const
 
SkISize dimensions () const
 
int width () const
 
int height () const
 
SkColorType colorType () const
 
int sampleCount () const
 
bool isTextureable () const
 
bool isMipMapped () const
 
bool usesGLFBO0 () const
 
bool vkRTSupportsInputAttachment () const
 
bool vulkanSecondaryCBCompatible () const
 
skgpu::Protected isProtected () const
 
SkColorSpacecolorSpace () const
 
sk_sp< SkColorSpacerefColorSpace () const
 
const SkSurfacePropssurfaceProps () const
 

Friends

class SkSurface_Ganesh
 
class GrVkSecondaryCBDrawContext
 
class GrContextThreadSafeProxy
 
class GrVkContextThreadSafeProxy
 
class GrDeferredDisplayListRecorder
 
class SkSurface
 

Detailed Description

A surface characterization contains all the information Ganesh requires to makes its internal rendering decisions. When passed into a GrDeferredDisplayListRecorder it will copy the data and pass it on to the GrDeferredDisplayList if/when it is created. Note that both of those objects (the Recorder and the DisplayList) will take a ref on the GrContextThreadSafeProxy and SkColorSpace objects.

Definition at line 34 of file GrSurfaceCharacterization.h.

Member Enumeration Documentation

◆ Textureable

enum class GrSurfaceCharacterization::Textureable : bool
strong
Enumerator
kNo 
kYes 

Definition at line 36 of file GrSurfaceCharacterization.h.

36: bool { kNo = false, kYes = true };
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.

◆ UsesGLFBO0

enum class GrSurfaceCharacterization::UsesGLFBO0 : bool
strong
Enumerator
kNo 
kYes 

Definition at line 37 of file GrSurfaceCharacterization.h.

37: bool { kNo = false, kYes = true };

◆ VkRTSupportsInputAttachment

Enumerator
kNo 
kYes 

Definition at line 41 of file GrSurfaceCharacterization.h.

41: bool { kNo = false, kYes = true };

◆ VulkanSecondaryCBCompatible

Enumerator
kNo 
kYes 

Definition at line 43 of file GrSurfaceCharacterization.h.

43: bool { kNo = false, kYes = true };

Constructor & Destructor Documentation

◆ GrSurfaceCharacterization() [1/3]

GrSurfaceCharacterization::GrSurfaceCharacterization ( )
inline

Definition at line 45 of file GrSurfaceCharacterization.h.

46 : fCacheMaxResourceBytes(0)
48 , fSampleCnt(0)
49 , fIsTextureable(Textureable::kYes)
50 , fIsMipmapped(skgpu::Mipmapped::kYes)
51 , fUsesGLFBO0(UsesGLFBO0::kNo)
52 , fVulkanSecondaryCBCompatible(VulkanSecondaryCBCompatible::kNo)
53 , fIsProtected(skgpu::Protected::kNo)
54 , fSurfaceProps() {}
@ kBottomLeft_GrSurfaceOrigin
Definition: GrTypes.h:149

◆ GrSurfaceCharacterization() [2/3]

GrSurfaceCharacterization::GrSurfaceCharacterization ( GrSurfaceCharacterization &&  )
default

◆ GrSurfaceCharacterization() [3/3]

GrSurfaceCharacterization::GrSurfaceCharacterization ( const GrSurfaceCharacterization )
default

Member Function Documentation

◆ backendFormat()

const GrBackendFormat & GrSurfaceCharacterization::backendFormat ( ) const
inline

Definition at line 96 of file GrSurfaceCharacterization.h.

96{ return fBackendFormat; }

◆ cacheMaxResourceBytes()

size_t GrSurfaceCharacterization::cacheMaxResourceBytes ( ) const
inline

Definition at line 91 of file GrSurfaceCharacterization.h.

91{ return fCacheMaxResourceBytes; }

◆ colorSpace()

SkColorSpace * GrSurfaceCharacterization::colorSpace ( ) const
inline

Definition at line 113 of file GrSurfaceCharacterization.h.

113{ return fImageInfo.colorSpace(); }
SkColorSpace * colorSpace() const

◆ colorType()

SkColorType GrSurfaceCharacterization::colorType ( ) const
inline

Definition at line 101 of file GrSurfaceCharacterization.h.

101{ return fImageInfo.colorType(); }
SkColorType colorType() const
Definition: SkImageInfo.h:373

◆ contextInfo()

GrContextThreadSafeProxy * GrSurfaceCharacterization::contextInfo ( ) const
inline

Definition at line 89 of file GrSurfaceCharacterization.h.

89{ return fContextInfo.get(); }
T * get() const
Definition: SkRefCnt.h:303

◆ createBackendFormat()

GrSurfaceCharacterization GrSurfaceCharacterization::createBackendFormat ( SkColorType  colorType,
const GrBackendFormat backendFormat 
) const

Definition at line 108 of file GrSurfaceCharacterization.cpp.

110 {
111 if (!this->isValid()) {
113 }
114
115 SkImageInfo newII = fImageInfo.makeColorType(colorType);
116
117 return GrSurfaceCharacterization(fContextInfo,
118 fCacheMaxResourceBytes,
119 newII,
120 backendFormat,
121 fOrigin,
122 fSampleCnt,
123 fIsTextureable,
124 fIsMipmapped,
125 fUsesGLFBO0,
126 fVkRTSupportsInputAttachment,
127 fVulkanSecondaryCBCompatible,
128 fIsProtected,
129 fSurfaceProps);
130}
SkImageInfo makeColorType(SkColorType newColorType) const
Definition: SkImageInfo.h:475

◆ createColorSpace()

GrSurfaceCharacterization GrSurfaceCharacterization::createColorSpace ( sk_sp< SkColorSpace cs) const

Definition at line 87 of file GrSurfaceCharacterization.cpp.

88 {
89 if (!this->isValid()) {
91 }
92
93 return GrSurfaceCharacterization(fContextInfo,
94 fCacheMaxResourceBytes,
95 fImageInfo.makeColorSpace(std::move(cs)),
96 fBackendFormat,
97 fOrigin,
98 fSampleCnt,
99 fIsTextureable,
100 fIsMipmapped,
101 fUsesGLFBO0,
102 fVkRTSupportsInputAttachment,
103 fVulkanSecondaryCBCompatible,
104 fIsProtected,
105 fSurfaceProps);
106}
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const

◆ createFBO0()

GrSurfaceCharacterization GrSurfaceCharacterization::createFBO0 ( bool  usesGLFBO0) const

Definition at line 132 of file GrSurfaceCharacterization.cpp.

132 {
133 if (!this->isValid()) {
135 }
136
137 // We can't create an FBO0 characterization that is textureable or has any non-gl specific flags
138 if (fIsTextureable == Textureable::kYes ||
139 fVkRTSupportsInputAttachment == VkRTSupportsInputAttachment::kYes ||
140 fVulkanSecondaryCBCompatible == VulkanSecondaryCBCompatible::kYes) {
142 }
143
144 return GrSurfaceCharacterization(fContextInfo,
145 fCacheMaxResourceBytes,
146 fImageInfo,
147 fBackendFormat,
148 fOrigin,
149 fSampleCnt,
150 fIsTextureable,
151 fIsMipmapped,
152 usesGLFBO0 ? UsesGLFBO0::kYes : UsesGLFBO0::kNo,
153 fVkRTSupportsInputAttachment,
154 fVulkanSecondaryCBCompatible,
155 fIsProtected,
156 fSurfaceProps);
157}

◆ createResized()

GrSurfaceCharacterization GrSurfaceCharacterization::createResized ( int  width,
int  height 
) const

Definition at line 61 of file GrSurfaceCharacterization.cpp.

61 {
62 const GrCaps* caps = fContextInfo->priv().caps();
63 if (!caps) {
65 }
66
67 if (width <= 0 || height <= 0 || width > caps->maxRenderTargetSize() ||
68 height > caps->maxRenderTargetSize()) {
70 }
71
72 return GrSurfaceCharacterization(fContextInfo,
73 fCacheMaxResourceBytes,
74 fImageInfo.makeWH(width, height),
75 fBackendFormat,
76 fOrigin,
77 fSampleCnt,
78 fIsTextureable,
79 fIsMipmapped,
80 fUsesGLFBO0,
81 fVkRTSupportsInputAttachment,
82 fVulkanSecondaryCBCompatible,
83 fIsProtected,
84 fSurfaceProps);
85}
Definition: GrCaps.h:57
int maxRenderTargetSize() const
Definition: GrCaps.h:223
GrContextThreadSafeProxyPriv priv()
SkImageInfo makeWH(int newWidth, int newHeight) const
Definition: SkImageInfo.h:444

◆ dimensions()

SkISize GrSurfaceCharacterization::dimensions ( ) const
inline

Definition at line 98 of file GrSurfaceCharacterization.h.

98{ return fImageInfo.dimensions(); }
SkISize dimensions() const
Definition: SkImageInfo.h:421

◆ height()

int GrSurfaceCharacterization::height ( ) const
inline

Definition at line 100 of file GrSurfaceCharacterization.h.

100{ return fImageInfo.height(); }
int height() const
Definition: SkImageInfo.h:371

◆ imageInfo()

const SkImageInfo & GrSurfaceCharacterization::imageInfo ( ) const
inline

Definition at line 95 of file GrSurfaceCharacterization.h.

95{ return fImageInfo; }

◆ isMipMapped()

bool GrSurfaceCharacterization::isMipMapped ( ) const
inline

Definition at line 104 of file GrSurfaceCharacterization.h.

104{ return skgpu::Mipmapped::kYes == fIsMipmapped; }

◆ isProtected()

skgpu::Protected GrSurfaceCharacterization::isProtected ( ) const
inline

Definition at line 112 of file GrSurfaceCharacterization.h.

112{ return fIsProtected; }

◆ isTextureable()

bool GrSurfaceCharacterization::isTextureable ( ) const
inline

Definition at line 103 of file GrSurfaceCharacterization.h.

103{ return Textureable::kYes == fIsTextureable; }

◆ isValid()

bool GrSurfaceCharacterization::isValid ( ) const
inline

Definition at line 93 of file GrSurfaceCharacterization.h.

93{ return kUnknown_SkColorType != fImageInfo.colorType(); }
@ kUnknown_SkColorType
uninitialized
Definition: SkColorType.h:20

◆ operator!=()

bool GrSurfaceCharacterization::operator!= ( const GrSurfaceCharacterization other) const
inline

Definition at line 62 of file GrSurfaceCharacterization.h.

62 {
63 return !(*this == other);
64 }

◆ operator=() [1/2]

GrSurfaceCharacterization & GrSurfaceCharacterization::operator= ( const GrSurfaceCharacterization other)
default

◆ operator=() [2/2]

GrSurfaceCharacterization & GrSurfaceCharacterization::operator= ( GrSurfaceCharacterization &&  )
default

◆ operator==()

bool GrSurfaceCharacterization::operator== ( const GrSurfaceCharacterization other) const

Definition at line 39 of file GrSurfaceCharacterization.cpp.

39 {
40 if (!this->isValid() || !other.isValid()) {
41 return false;
42 }
43
44 if (fContextInfo != other.fContextInfo) {
45 return false;
46 }
47
48 return fCacheMaxResourceBytes == other.fCacheMaxResourceBytes &&
49 fOrigin == other.fOrigin &&
50 fImageInfo == other.fImageInfo &&
51 fBackendFormat == other.fBackendFormat &&
52 fSampleCnt == other.fSampleCnt &&
53 fIsTextureable == other.fIsTextureable &&
54 fIsMipmapped == other.fIsMipmapped &&
55 fUsesGLFBO0 == other.fUsesGLFBO0 &&
56 fVulkanSecondaryCBCompatible == other.fVulkanSecondaryCBCompatible &&
57 fIsProtected == other.fIsProtected &&
58 fSurfaceProps == other.fSurfaceProps;
59}

◆ origin()

GrSurfaceOrigin GrSurfaceCharacterization::origin ( ) const
inline

Definition at line 97 of file GrSurfaceCharacterization.h.

97{ return fOrigin; }

◆ refColorSpace()

sk_sp< SkColorSpace > GrSurfaceCharacterization::refColorSpace ( ) const
inline

Definition at line 114 of file GrSurfaceCharacterization.h.

114{ return fImageInfo.refColorSpace(); }
sk_sp< SkColorSpace > refColorSpace() const

◆ refContextInfo()

sk_sp< GrContextThreadSafeProxy > GrSurfaceCharacterization::refContextInfo ( ) const
inline

Definition at line 90 of file GrSurfaceCharacterization.h.

90{ return fContextInfo; }

◆ sampleCount()

int GrSurfaceCharacterization::sampleCount ( ) const
inline

Definition at line 102 of file GrSurfaceCharacterization.h.

102{ return fSampleCnt; }

◆ surfaceProps()

const SkSurfaceProps & GrSurfaceCharacterization::surfaceProps ( ) const
inline

Definition at line 115 of file GrSurfaceCharacterization.h.

115{ return fSurfaceProps; }

◆ usesGLFBO0()

bool GrSurfaceCharacterization::usesGLFBO0 ( ) const
inline

Definition at line 105 of file GrSurfaceCharacterization.h.

105{ return UsesGLFBO0::kYes == fUsesGLFBO0; }

◆ vkRTSupportsInputAttachment()

bool GrSurfaceCharacterization::vkRTSupportsInputAttachment ( ) const
inline

Definition at line 106 of file GrSurfaceCharacterization.h.

106 {
107 return VkRTSupportsInputAttachment::kYes == fVkRTSupportsInputAttachment;
108 }

◆ vulkanSecondaryCBCompatible()

bool GrSurfaceCharacterization::vulkanSecondaryCBCompatible ( ) const
inline

Definition at line 109 of file GrSurfaceCharacterization.h.

109 {
110 return VulkanSecondaryCBCompatible::kYes == fVulkanSecondaryCBCompatible;
111 }

◆ width()

int GrSurfaceCharacterization::width ( ) const
inline

Definition at line 99 of file GrSurfaceCharacterization.h.

99{ return fImageInfo.width(); }
int width() const
Definition: SkImageInfo.h:365

Friends And Related Function Documentation

◆ GrContextThreadSafeProxy

friend class GrContextThreadSafeProxy
friend

Definition at line 120 of file GrSurfaceCharacterization.h.

◆ GrDeferredDisplayListRecorder

friend class GrDeferredDisplayListRecorder
friend

Definition at line 122 of file GrSurfaceCharacterization.h.

◆ GrVkContextThreadSafeProxy

friend class GrVkContextThreadSafeProxy
friend

Definition at line 121 of file GrSurfaceCharacterization.h.

◆ GrVkSecondaryCBDrawContext

friend class GrVkSecondaryCBDrawContext
friend

Definition at line 119 of file GrSurfaceCharacterization.h.

◆ SkSurface

friend class SkSurface
friend

Definition at line 123 of file GrSurfaceCharacterization.h.

◆ SkSurface_Ganesh

friend class SkSurface_Ganesh
friend

Definition at line 118 of file GrSurfaceCharacterization.h.


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