Flutter Engine
The Flutter Engine
|
#include <GrContextThreadSafeProxy.h>
Public Member Functions | |
virtual | ~GrContextThreadSafeProxy () |
GrSurfaceCharacterization | createCharacterization (size_t cacheMaxResourceBytes, const SkImageInfo &ii, const GrBackendFormat &backendFormat, int sampleCount, GrSurfaceOrigin origin, const SkSurfaceProps &surfaceProps, skgpu::Mipmapped isMipmapped, bool willUseGLFBO0=false, bool isTextureable=true, skgpu::Protected isProtected=GrProtected::kNo, bool vkRTSupportsInputAttachment=false, bool forVulkanSecondaryCommandBuffer=false) |
GrBackendFormat | defaultBackendFormat (SkColorType ct, GrRenderable renderable) const |
GrBackendFormat | compressedBackendFormat (SkTextureCompressionType c) const |
int | maxSurfaceSampleCountForColorType (SkColorType colorType) const |
bool | isValid () const |
bool | operator== (const GrContextThreadSafeProxy &that) const |
bool | operator!= (const GrContextThreadSafeProxy &that) const |
GrContextThreadSafeProxyPriv | priv () |
const GrContextThreadSafeProxyPriv | priv () const |
Public Member Functions inherited from SkNVRefCnt< GrContextThreadSafeProxy > | |
SkNVRefCnt () | |
~SkNVRefCnt () | |
bool | unique () const |
void | ref () const |
void | unref () const |
void | deref () const |
bool | refCntGreaterThan (int32_t threadIsolatedTestCnt) const |
Protected Member Functions | |
GrContextThreadSafeProxy (GrBackendApi, const GrContextOptions &) | |
Private Member Functions | |
virtual bool | isValidCharacterizationForVulkan (sk_sp< const GrCaps >, bool isTextureable, skgpu::Mipmapped isMipmapped, skgpu::Protected isProtected, bool vkRTSupportsInputAttachment, bool forVulkanSecondaryCommandBuffer) |
Friends | |
class | GrContextThreadSafeProxyPriv |
Can be used to perform actions related to the generating GrContext in a thread safe manner. The proxy does not access the 3D API (e.g. OpenGL) that backs the generating GrContext.
Definition at line 34 of file GrContextThreadSafeProxy.h.
|
virtualdefault |
|
protected |
Definition at line 31 of file GrContextThreadSafeProxy.cpp.
GrBackendFormat GrContextThreadSafeProxy::compressedBackendFormat | ( | SkTextureCompressionType | c | ) | const |
Retrieve the GrBackendFormat for a given SkTextureCompressionType. This is guaranteed to match the backend format used by the following createCompressedBackendTexture methods that take a CompressionType.
The caller should check that the returned format is valid.
Definition at line 163 of file GrContextThreadSafeProxy.cpp.
GrSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization | ( | size_t | cacheMaxResourceBytes, |
const SkImageInfo & | ii, | ||
const GrBackendFormat & | backendFormat, | ||
int | sampleCount, | ||
GrSurfaceOrigin | origin, | ||
const SkSurfaceProps & | surfaceProps, | ||
skgpu::Mipmapped | isMipmapped, | ||
bool | willUseGLFBO0 = false , |
||
bool | isTextureable = true , |
||
skgpu::Protected | isProtected = GrProtected::kNo , |
||
bool | vkRTSupportsInputAttachment = false , |
||
bool | forVulkanSecondaryCommandBuffer = false |
||
) |
Create a surface characterization for a DDL that will be replayed into the GrContext that created this proxy. On failure the resulting characterization will be invalid (i.e., "!c.isValid()").
cacheMaxResourceBytes | The max resource bytes limit that will be in effect when the DDL created with this characterization is replayed. Note: the contract here is that the DDL will be created as if it had a full 'cacheMaxResourceBytes' to use. If replayed into a GrContext that already has locked GPU memory, the replay can exceed the budget. To rephrase, all resource allocation decisions are made at record time and at playback time the budget limits will be ignored. |
ii | The image info specifying properties of the SkSurface that the DDL created with this characterization will be replayed into. Note: Ganesh doesn't make use of the SkImageInfo's alphaType |
backendFormat | Information about the format of the GPU surface that will back the SkSurface upon replay |
sampleCount | The sample count of the SkSurface that the DDL created with this characterization will be replayed into |
origin | The origin of the SkSurface that the DDL created with this characterization will be replayed into |
surfaceProps | The surface properties of the SkSurface that the DDL created with this characterization will be replayed into |
isMipmapped | Will the surface the DDL will be replayed into have space allocated for mipmaps? |
willUseGLFBO0 | Will the surface the DDL will be replayed into be backed by GL FBO 0. This flag is only valid if using an GL backend. |
isTextureable | Will the surface be able to act as a texture? |
isProtected | Will the (Vulkan) surface be DRM protected? |
vkRTSupportsInputAttachment | Can the vulkan surface be used as in input attachment? |
forVulkanSecondaryCommandBuffer | Will the surface be wrapping a vulkan secondary command buffer via a GrVkSecondaryCBDrawContext? If this is true then the following is required: isTexureable = false isMipmapped = false willUseGLFBO0 = false vkRTSupportsInputAttachment = false |
Definition at line 47 of file GrContextThreadSafeProxy.cpp.
GrBackendFormat GrContextThreadSafeProxy::defaultBackendFormat | ( | SkColorType | ct, |
GrRenderable | renderable | ||
) | const |
Definition at line 147 of file GrContextThreadSafeProxy.cpp.
|
inline |
Definition at line 124 of file GrContextThreadSafeProxy.h.
|
privatevirtual |
Reimplemented in GrVkContextThreadSafeProxy.
Definition at line 137 of file GrContextThreadSafeProxy.cpp.
int GrContextThreadSafeProxy::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 172 of file GrContextThreadSafeProxy.cpp.
|
inline |
Definition at line 132 of file GrContextThreadSafeProxy.h.
|
inline |
Definition at line 126 of file GrContextThreadSafeProxy.h.
|
inline |
Definition at line 66 of file GrContextThreadSafeProxyPriv.h.
|
inline |
Definition at line 70 of file GrContextThreadSafeProxyPriv.h.
|
friend |
Definition at line 143 of file GrContextThreadSafeProxy.h.