Skia
2D Graphics Library
GrTypes.h File Reference
#include "include/core/SkTypes.h"
#include "include/private/base/SkTo.h"
#include <cstddef>
#include <cstdint>
Include dependency graph for GrTypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GrTFlagsMask< TFlags >
 Wraps a C++11 enum that we use as a bitfield, and enables a limited amount of masking with type safety. More...
 
struct  GrFlushInfo
 Struct to supply options to flush calls. More...
 

Namespaces

 skgpu
 This file includes numerous public types that are used by all of our gpu backends.
 

Macros

#define GR_MAKE_BITFIELD_CLASS_OPS(X)
 Defines bitwise operators that make it possible to use an enum class as a basic bitfield. More...
 
#define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X)
 

Typedefs

typedef GrBackendApi GrBackend
 Previously the above enum was not an enum class but a normal enum. More...
 
using GrMipmapped = skgpu::Mipmapped
 Used to say whether a texture has mip levels allocated or not. More...
 
using GrMipMapped = skgpu::Mipmapped
 Deprecated legacy alias of skgpu::Mipmapped. More...
 
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
}
 Possible 3D APIs that may be used by Ganesh. More...
 
enum  GrSurfaceOrigin : int { kTopLeft_GrSurfaceOrigin , kBottomLeft_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. More...
 
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
}
 A GrContext's cache of backend context state can be partially invalidated. More...
 
enum class  GrSemaphoresSubmitted : bool { kNo = false , kYes = true }
 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. More...
 
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
 This value translates to reseting all the context state for any backend. More...
 

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 GrTFlagsMask<X> operator|(GrTFlagsMask<X>, GrTFlagsMask<X>); \
friend constexpr GrTFlagsMask<X> operator|(GrTFlagsMask<X>, X); \
friend constexpr GrTFlagsMask<X> operator|(X, GrTFlagsMask<X>); \
friend constexpr X operator&(GrTFlagsMask<X>, GrTFlagsMask<X>); \
friend constexpr X operator&(GrTFlagsMask<X>, X); \
friend constexpr X operator&(X, GrTFlagsMask<X>); \
friend X& operator &=(X&, GrTFlagsMask<X>)
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

◆ 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.

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.

◆ GrDirectContextDestroyedContext

◆ GrDirectContextDestroyedProc

typedef void(* GrDirectContextDestroyedProc) (GrDirectContextDestroyedContext destroyedContext)

◆ GrGpuFinishedContext

typedef void* GrGpuFinishedContext

◆ GrGpuFinishedProc

typedef void(* GrGpuFinishedProc) (GrGpuFinishedContext finishedContext)

◆ GrGpuSubmittedContext

typedef void* GrGpuSubmittedContext

◆ GrGpuSubmittedProc

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

◆ GrMipmapped

Used to say whether a texture has mip levels allocated or not.

Deprecated legacy alias of skgpu::Mipmapped.

◆ GrMipMapped

Deprecated legacy alias of skgpu::Mipmapped.

◆ GrProtected

◆ GrRenderable

Enumeration Type Documentation

◆ GrBackendApi

enum 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.

◆ 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 

◆ GrPurgeResourceOptions

Enumerator
kAllResources 
kScratchResourcesOnly 

◆ GrSemaphoresSubmitted

enum 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 

◆ GrSurfaceOrigin

enum GrSurfaceOrigin : int

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 

◆ GrSyncCpu

enum GrSyncCpu : bool
strong
Enumerator
kNo 
kYes 

Variable Documentation

◆ kAll_GrBackendState

const uint32_t kAll_GrBackendState = 0xffffffff
static

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

◆ kMetal_GrBackend

constexpr GrBackendApi kMetal_GrBackend = GrBackendApi::kMetal
staticconstexpr

◆ kMock_GrBackend

constexpr GrBackendApi kMock_GrBackend = GrBackendApi::kMock
staticconstexpr

◆ kVulkan_GrBackend

constexpr GrBackendApi kVulkan_GrBackend = GrBackendApi::kVulkan
staticconstexpr