8 #ifndef GrTypes_DEFINED
9 #define GrTypes_DEFINED
12 #include "include/private/base/SkTo.h"
34 constexpr
int value()
const {
return fValue; }
43 #define GR_MAKE_BITFIELD_CLASS_OPS(X) \
44 [[maybe_unused]] constexpr GrTFlagsMask<X> operator~(X a) { \
45 return GrTFlagsMask<X>(~static_cast<int>(a)); \
47 [[maybe_unused]] constexpr X operator|(X a, X b) { \
48 return static_cast<X>(static_cast<int>(a) | static_cast<int>(b)); \
50 [[maybe_unused]] inline X& operator|=(X& a, X b) { \
53 [[maybe_unused]] constexpr bool operator&(X a, X b) { \
54 return SkToBool(static_cast<int>(a) & static_cast<int>(b)); \
56 [[maybe_unused]] constexpr GrTFlagsMask<X> operator|(GrTFlagsMask<X> a, GrTFlagsMask<X> b) { \
57 return GrTFlagsMask<X>(a.value() | b.value()); \
59 [[maybe_unused]] constexpr GrTFlagsMask<X> operator|(GrTFlagsMask<X> a, X b) { \
60 return GrTFlagsMask<X>(a.value() | static_cast<int>(b)); \
62 [[maybe_unused]] constexpr GrTFlagsMask<X> operator|(X a, GrTFlagsMask<X> b) { \
63 return GrTFlagsMask<X>(static_cast<int>(a) | b.value()); \
65 [[maybe_unused]] constexpr X operator&(GrTFlagsMask<X> a, GrTFlagsMask<X> b) { \
66 return static_cast<X>(a.value() & b.value()); \
68 [[maybe_unused]] constexpr X operator&(GrTFlagsMask<X> a, X b) { \
69 return static_cast<X>(a.value() & static_cast<int>(b)); \
71 [[maybe_unused]] constexpr X operator&(X a, GrTFlagsMask<X> b) { \
72 return static_cast<X>(static_cast<int>(a) & b.value()); \
74 [[maybe_unused]] inline X& operator&=(X& a, GrTFlagsMask<X> b) { \
78 #define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X) \
79 friend constexpr GrTFlagsMask<X> operator ~(X); \
80 friend constexpr X operator |(X, X); \
81 friend X& operator |=(X&, X); \
82 friend constexpr bool operator &(X, X); \
83 friend constexpr GrTFlagsMask<X> operator|(GrTFlagsMask<X>, GrTFlagsMask<X>); \
84 friend constexpr GrTFlagsMask<X> operator|(GrTFlagsMask<X>, X); \
85 friend constexpr GrTFlagsMask<X> operator|(X, GrTFlagsMask<X>); \
86 friend constexpr X operator&(GrTFlagsMask<X>, GrTFlagsMask<X>); \
87 friend constexpr X operator&(GrTFlagsMask<X>, X); \
88 friend constexpr X operator&(X, GrTFlagsMask<X>); \
89 friend X& operator &=(X&, GrTFlagsMask<X>)
226 size_t fNumSemaphores = 0;
GrPurgeResourceOptions
Definition: GrTypes.h:243
GrSurfaceOrigin
GPU SkImage and SkSurfaces can be stored such that (0, 0) in texture space may correspond to either t...
Definition: GrTypes.h:156
@ kBottomLeft_GrSurfaceOrigin
Definition: GrTypes.h:158
@ kTopLeft_GrSurfaceOrigin
Definition: GrTypes.h:157
static const uint32_t kAll_GrBackendState
This value translates to reseting all the context state for any backend.
Definition: GrTypes.h:185
static constexpr GrBackendApi kVulkan_GrBackend
Definition: GrTypes.h:127
GrBackendApi
Possible 3D APIs that may be used by Ganesh.
Definition: GrTypes.h:96
@ kMock
Mock is a backend that does not draw anything.
@ kOpenGL_GrBackend
Added here to support the legacy GrBackend enum value and clients who referenced it using GrBackend::...
static constexpr GrBackendApi kMock_GrBackend
Definition: GrTypes.h:128
void * GrDirectContextDestroyedContext
Definition: GrTypes.h:193
GrSemaphoresSubmitted
Enum used as return value when flush with semaphores so the client knows whether the valid semaphores...
Definition: GrTypes.h:238
void * GrGpuSubmittedContext
Definition: GrTypes.h:190
void * GrGpuFinishedContext
Definition: GrTypes.h:187
void(* GrGpuSubmittedProc)(GrGpuSubmittedContext submittedContext, bool success)
Definition: GrTypes.h:191
void(* GrDirectContextDestroyedProc)(GrDirectContextDestroyedContext destroyedContext)
Definition: GrTypes.h:194
void(* GrGpuFinishedProc)(GrGpuFinishedContext finishedContext)
Definition: GrTypes.h:188
GrSyncCpu
Definition: GrTypes.h:248
GrGLBackendState
A GrContext's cache of backend context state can be partially invalidated.
Definition: GrTypes.h:165
@ kProgram_GrGLBackendState
Definition: GrTypes.h:176
@ kView_GrGLBackendState
Definition: GrTypes.h:170
@ kTextureBinding_GrGLBackendState
Definition: GrTypes.h:168
@ kVertex_GrGLBackendState
Definition: GrTypes.h:173
@ kBlend_GrGLBackendState
Definition: GrTypes.h:171
@ kMisc_GrGLBackendState
Definition: GrTypes.h:178
@ kMSAAEnable_GrGLBackendState
Definition: GrTypes.h:172
@ kALL_GrGLBackendState
Definition: GrTypes.h:179
@ kFixedFunction_GrGLBackendState
Definition: GrTypes.h:177
@ kPixelStore_GrGLBackendState
Definition: GrTypes.h:175
@ kStencil_GrGLBackendState
Definition: GrTypes.h:174
@ kRenderTarget_GrGLBackendState
Definition: GrTypes.h:166
GrBackendApi GrBackend
Previously the above enum was not an enum class but a normal enum.
Definition: GrTypes.h:124
static constexpr GrBackendApi kMetal_GrBackend
Definition: GrTypes.h:126
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object.
Definition: GrBackendSemaphore.h:34
Wraps a C++11 enum that we use as a bitfield, and enables a limited amount of masking with type safet...
Definition: GrTypes.h:30
constexpr GrTFlagsMask(TFlags value)
Definition: GrTypes.h:32
constexpr GrTFlagsMask(int value)
Definition: GrTypes.h:33
constexpr int value() const
Definition: GrTypes.h:34
This file includes numerous public types that are used by all of our gpu backends.
Definition: SkCanvas.h:73
Renderable
Is a texture renderable or not.
Definition: GpuTypes.h:69
Mipmapped
Is the texture mipmapped or not.
Definition: GpuTypes.h:53
Protected
Is the data protected on the GPU or not.
Definition: GpuTypes.h:61
Struct to supply options to flush calls.
Definition: GrTypes.h:225