Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Enumerations | Variables
GrTypes.h File Reference
#include "include/core/SkTypes.h"
#include "include/private/base/SkTo.h"
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

class  GrTFlagsMask< TFlags >
 
struct  GrFlushInfo
 

Namespaces

namespace  skgpu
 

Macros

#define GR_MAKE_BITFIELD_CLASS_OPS(X)
 
#define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X)
 

Typedefs

typedef GrBackendApi GrBackend
 
using GrRenderable = skgpu::Renderable
 
using GrProtected = skgpu::Protected
 
typedef void * GrGpuFinishedContext
 
typedef void(* GrGpuFinishedProc) (GrGpuFinishedContext finishedContext)
 
typedef void * GrGpuSubmittedContext
 
typedef void(* GrGpuSubmittedProc) (GrGpuSubmittedContext submittedContext, bool success)
 
typedef void * GrDirectContextDestroyedContext
 
typedef void(* GrDirectContextDestroyedProc) (GrDirectContextDestroyedContext destroyedContext)
 

Enumerations

enum class  GrBackendApi : unsigned {
  kOpenGL , kVulkan , kMetal , kDirect3D ,
  kMock , kUnsupported , kOpenGL_GrBackend = kOpenGL
}
 
enum  GrSurfaceOrigin : int { kTopLeft_GrSurfaceOrigin , kBottomLeft_GrSurfaceOrigin }
 
enum  GrGLBackendState {
  kRenderTarget_GrGLBackendState = 1 << 0 , kTextureBinding_GrGLBackendState = 1 << 1 , kView_GrGLBackendState = 1 << 2 , kBlend_GrGLBackendState = 1 << 3 ,
  kMSAAEnable_GrGLBackendState = 1 << 4 , kVertex_GrGLBackendState = 1 << 5 , kStencil_GrGLBackendState = 1 << 6 , kPixelStore_GrGLBackendState = 1 << 7 ,
  kProgram_GrGLBackendState = 1 << 8 , kFixedFunction_GrGLBackendState = 1 << 9 , kMisc_GrGLBackendState = 1 << 10 , kALL_GrGLBackendState = 0xffff
}
 
enum class  GrSemaphoresSubmitted : bool { kNo = false , kYes = true }
 
enum class  GrPurgeResourceOptions { kAllResources , kScratchResourcesOnly }
 
enum class  GrSyncCpu : bool { kNo = false , kYes = true }
 

Variables

static constexpr GrBackendApi kMetal_GrBackend = GrBackendApi::kMetal
 
static constexpr GrBackendApi kVulkan_GrBackend = GrBackendApi::kVulkan
 
static constexpr GrBackendApi kMock_GrBackend = GrBackendApi::kMock
 
static const uint32_t kAll_GrBackendState = 0xffffffff
 

Macro Definition Documentation

◆ GR_DECL_BITFIELD_CLASS_OPS_FRIENDS

#define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (   X)
Value:
friend constexpr GrTFlagsMask<X> operator ~(X); \
friend constexpr X operator |(X, X); \
friend X& operator |=(X&, X); \
friend constexpr bool operator &(X, X); \
friend constexpr X operator&(GrTFlagsMask<X>, X); \
friend constexpr X operator&(X, GrTFlagsMask<X>); \
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator&=(E &l, E r)
Definition: SkBitmaskEnum.h:39
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator~(E e)
Definition: SkBitmaskEnum.h:55
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator|(E l, E r)
Definition: SkBitmaskEnum.h:22
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator|=(E &l, E r)
Definition: SkBitmaskEnum.h:28
static const SkScalar X
Definition: StrokeBench.cpp:54
constexpr Mask< EnumType > operator&(const EnumType &lhs, const EnumType &rhs)
Definition: mask.h:139

Definition at line 77 of file GrTypes.h.

◆ GR_MAKE_BITFIELD_CLASS_OPS

#define GR_MAKE_BITFIELD_CLASS_OPS (   X)

Defines bitwise operators that make it possible to use an enum class as a basic bitfield.

Definition at line 42 of file GrTypes.h.

Typedef Documentation

◆ GrBackend

Previously the above enum was not an enum class but a normal enum. To support the legacy use of the enum values we define them below so that no clients break.

Definition at line 123 of file GrTypes.h.

◆ GrDirectContextDestroyedContext

Definition at line 184 of file GrTypes.h.

◆ GrDirectContextDestroyedProc

typedef void(* GrDirectContextDestroyedProc) (GrDirectContextDestroyedContext destroyedContext)

Definition at line 185 of file GrTypes.h.

◆ GrGpuFinishedContext

typedef void* GrGpuFinishedContext

Definition at line 178 of file GrTypes.h.

◆ GrGpuFinishedProc

typedef void(* GrGpuFinishedProc) (GrGpuFinishedContext finishedContext)

Definition at line 179 of file GrTypes.h.

◆ GrGpuSubmittedContext

typedef void* GrGpuSubmittedContext

Definition at line 181 of file GrTypes.h.

◆ GrGpuSubmittedProc

typedef void(* GrGpuSubmittedProc) (GrGpuSubmittedContext submittedContext, bool success)

Definition at line 182 of file GrTypes.h.

◆ GrProtected

Definition at line 139 of file GrTypes.h.

◆ GrRenderable

Definition at line 134 of file GrTypes.h.

Enumeration Type Documentation

◆ GrBackendApi

enum class GrBackendApi : unsigned
strong

Possible 3D APIs that may be used by Ganesh.

Enumerator
kOpenGL 
kVulkan 
kMetal 
kDirect3D 
kMock 

Mock is a backend that does not draw anything. It is used for unit tests and to measure CPU overhead.

kUnsupported 

Ganesh doesn't support some context types (e.g. Dawn) and will return Unsupported.

kOpenGL_GrBackend 

Added here to support the legacy GrBackend enum value and clients who referenced it using GrBackend::kOpenGL_GrBackend.

Definition at line 95 of file GrTypes.h.

95 : unsigned {
96 kOpenGL,
97 kVulkan,
98 kMetal,
100
101 /**
102 * Mock is a backend that does not draw anything. It is used for unit tests
103 * and to measure CPU overhead.
104 */
105 kMock,
106
107 /**
108 * Ganesh doesn't support some context types (e.g. Dawn) and will return Unsupported.
109 */
111
112 /**
113 * Added here to support the legacy GrBackend enum value and clients who referenced it using
114 * GrBackend::kOpenGL_GrBackend.
115 */
117};
@ kVulkan
Definition: embedder.h:86
@ kOpenGL
Definition: embedder.h:80
@ kMetal
Definition: embedder.h:85

◆ GrGLBackendState

A GrContext's cache of backend context state can be partially invalidated. These enums are specific to the GL backend and we'd add a new set for an alternative backend.

Enumerator
kRenderTarget_GrGLBackendState 
kTextureBinding_GrGLBackendState 
kView_GrGLBackendState 
kBlend_GrGLBackendState 
kMSAAEnable_GrGLBackendState 
kVertex_GrGLBackendState 
kStencil_GrGLBackendState 
kPixelStore_GrGLBackendState 
kProgram_GrGLBackendState 
kFixedFunction_GrGLBackendState 
kMisc_GrGLBackendState 
kALL_GrGLBackendState 

Definition at line 156 of file GrTypes.h.

156 {
158 // Also includes samplers bound to texture units.
160 // View state stands for scissor and viewport
161 kView_GrGLBackendState = 1 << 2,
169 kMisc_GrGLBackendState = 1 << 10,
170 kALL_GrGLBackendState = 0xffff
171};
@ kProgram_GrGLBackendState
Definition: GrTypes.h:167
@ kView_GrGLBackendState
Definition: GrTypes.h:161
@ kTextureBinding_GrGLBackendState
Definition: GrTypes.h:159
@ kVertex_GrGLBackendState
Definition: GrTypes.h:164
@ kBlend_GrGLBackendState
Definition: GrTypes.h:162
@ kMisc_GrGLBackendState
Definition: GrTypes.h:169
@ kMSAAEnable_GrGLBackendState
Definition: GrTypes.h:163
@ kALL_GrGLBackendState
Definition: GrTypes.h:170
@ kFixedFunction_GrGLBackendState
Definition: GrTypes.h:168
@ kPixelStore_GrGLBackendState
Definition: GrTypes.h:166
@ kStencil_GrGLBackendState
Definition: GrTypes.h:165
@ kRenderTarget_GrGLBackendState
Definition: GrTypes.h:157

◆ GrPurgeResourceOptions

enum class GrPurgeResourceOptions
strong
Enumerator
kAllResources 
kScratchResourcesOnly 

Definition at line 234 of file GrTypes.h.

◆ GrSemaphoresSubmitted

enum class GrSemaphoresSubmitted : bool
strong

Enum used as return value when flush with semaphores so the client knows whether the valid semaphores will be submitted on the next GrContext::submit call.

Enumerator
kNo 
kYes 

Definition at line 229 of file GrTypes.h.

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

◆ GrSurfaceOrigin

GPU SkImage and SkSurfaces can be stored such that (0, 0) in texture space may correspond to either the top-left or bottom-left content pixel.

Enumerator
kTopLeft_GrSurfaceOrigin 
kBottomLeft_GrSurfaceOrigin 

Definition at line 147 of file GrTypes.h.

147 : int {
150};
@ kBottomLeft_GrSurfaceOrigin
Definition: GrTypes.h:149
@ kTopLeft_GrSurfaceOrigin
Definition: GrTypes.h:148

◆ GrSyncCpu

enum class GrSyncCpu : bool
strong
Enumerator
kNo 
kYes 

Definition at line 239 of file GrTypes.h.

239 : bool {
240 kNo = false,
241 kYes = true,
242};

Variable Documentation

◆ kAll_GrBackendState

const uint32_t kAll_GrBackendState = 0xffffffff
static

This value translates to reseting all the context state for any backend.

Definition at line 176 of file GrTypes.h.

◆ kMetal_GrBackend

constexpr GrBackendApi kMetal_GrBackend = GrBackendApi::kMetal
staticconstexpr

Definition at line 125 of file GrTypes.h.

◆ kMock_GrBackend

constexpr GrBackendApi kMock_GrBackend = GrBackendApi::kMock
staticconstexpr

Definition at line 127 of file GrTypes.h.

◆ kVulkan_GrBackend

constexpr GrBackendApi kVulkan_GrBackend = GrBackendApi::kVulkan
staticconstexpr

Definition at line 126 of file GrTypes.h.