Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
GrTypesPriv.h File Reference
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkRefCnt.h"
#include "include/gpu/GrTypes.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMacros.h"
#include "include/private/base/SkTypeTraits.h"
#include <cstddef>
#include <cstdint>
#include <functional>
#include <type_traits>

Go to the source code of this file.

Classes

struct  GrMipLevel
 
class  GrColorFormatDesc
 

Namespaces

namespace  skgpu
 

Macros

#define GrCapsDebugf(caps, ...)   do {} while (0)
 

Typedefs

using GrVisitProxyFunc = std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)>
 

Enumerations

enum class  GrPrimitiveType : uint8_t {
  kTriangles , kTriangleStrip , kPoints , kLines ,
  kLineStrip
}
 
enum class  GrPrimitiveRestart : bool { kNo = false , kYes = true }
 
enum class  GrTexturable : bool { kNo = false , kYes = true }
 
enum class  GrDDLProvider : bool { kNo = false , kYes = true }
 
enum  GrWrapOwnership { kBorrow_GrWrapOwnership , kAdopt_GrWrapOwnership }
 
enum class  GrWrapCacheable : bool { kNo = false , kYes = true }
 
enum class  GrBudgetedType : uint8_t { kBudgeted , kUnbudgetedUncacheable , kUnbudgetedCacheable }
 
enum class  GrScissorTest : bool { kDisabled = false , kEnabled = true }
 
enum class  GrMemoryless : bool { kNo = false , kYes = true }
 
enum class  GrSemaphoreWrapType { kWillSignal , kWillWait }
 
enum class  GrLoadOp { kLoad , kClear , kDiscard }
 
enum class  GrStoreOp { kStore , kDiscard }
 
enum class  GrAA : bool { kNo = false , kYes = true }
 
enum class  GrFillRule : bool { kNonzero , kEvenOdd }
 
enum class  GrAAType : unsigned { kNone , kCoverage , kMSAA , kLast = kMSAA }
 
enum class  GrClampType { kAuto , kManual , kNone }
 
enum class  GrQuadAAFlags {
  kLeft = 0b0001 , kTop = 0b0010 , kRight = 0b0100 , kBottom = 0b1000 ,
  kNone = 0b0000 , kAll = 0b1111
}
 
enum class  GrTextureType { kNone , k2D , kRectangle , kExternal }
 
enum  GrShaderType { kVertex_GrShaderType , kFragment_GrShaderType , kLast_GrShaderType = kFragment_GrShaderType }
 
enum  GrShaderFlags { kNone_GrShaderFlags = 0 , kVertex_GrShaderFlag = 1 << 0 , kFragment_GrShaderFlag = 1 << 1 }
 
enum  GrVertexAttribType {
  kFloat_GrVertexAttribType = 0 , kFloat2_GrVertexAttribType , kFloat3_GrVertexAttribType , kFloat4_GrVertexAttribType ,
  kHalf_GrVertexAttribType , kHalf2_GrVertexAttribType , kHalf4_GrVertexAttribType , kInt2_GrVertexAttribType ,
  kInt3_GrVertexAttribType , kInt4_GrVertexAttribType , kByte_GrVertexAttribType , kByte2_GrVertexAttribType ,
  kByte4_GrVertexAttribType , kUByte_GrVertexAttribType , kUByte2_GrVertexAttribType , kUByte4_GrVertexAttribType ,
  kUByte_norm_GrVertexAttribType , kUByte4_norm_GrVertexAttribType , kShort2_GrVertexAttribType , kShort4_GrVertexAttribType ,
  kUShort2_GrVertexAttribType , kUShort2_norm_GrVertexAttribType , kInt_GrVertexAttribType , kUInt_GrVertexAttribType ,
  kUShort_norm_GrVertexAttribType , kUShort4_norm_GrVertexAttribType , kLast_GrVertexAttribType = kUShort4_norm_GrVertexAttribType
}
 
enum class  GrClipEdgeType {
  kFillBW , kFillAA , kInverseFillBW , kInverseFillAA ,
  kLast = kInverseFillAA
}
 
enum  GrIOType { kRead_GrIOType , kWrite_GrIOType , kRW_GrIOType }
 
enum class  GrGpuBufferType {
  kVertex , kIndex , kDrawIndirect , kXferCpuToGpu ,
  kXferGpuToCpu , kUniform
}
 
enum  GrAccessPattern { kDynamic_GrAccessPattern , kStatic_GrAccessPattern , kStream_GrAccessPattern , kLast_GrAccessPattern = kStream_GrAccessPattern }
 
enum class  GrInternalSurfaceFlags {
  kNone = 0 , kReadOnly = 1 << 0 , kGLRTFBOIDIs0 = 1 << 1 , kRequiresManualMSAAResolve = 1 << 2 ,
  kFramebufferOnly = 1 << 3 , kVkRTSupportsInputAttachment = 1 << 4
}
 
enum class  GrBackendObjectOwnership : bool { kBorrowed = false , kOwned = true }
 
enum class  GpuPathRenderers {
  kNone = 0 , kDashLine = 1 << 0 , kAtlas = 1 << 1 , kTessellation = 1 << 2 ,
  kCoverageCounting = 1 << 3 , kAAHairline = 1 << 4 , kAAConvex = 1 << 5 , kAALinearizing = 1 << 6 ,
  kSmall = 1 << 7 , kTriangulating = 1 << 8 , kDefault = ((1 << 9) - 1)
}
 
enum class  GrMipmapStatus { kNotAllocated , kDirty , kValid }
 
enum class  GrColorType {
  kUnknown , kAlpha_8 , kBGR_565 , kRGB_565 ,
  kABGR_4444 , kRGBA_8888 , kRGBA_8888_SRGB , kRGB_888x ,
  kRG_88 , kBGRA_8888 , kRGBA_1010102 , kBGRA_1010102 ,
  kRGBA_10x6 , kGray_8 , kGrayAlpha_88 , kAlpha_F16 ,
  kRGBA_F16 , kRGBA_F16_Clamped , kRGBA_F32 , kAlpha_16 ,
  kRG_1616 , kRG_F16 , kRGBA_16161616 , kAlpha_8xxx ,
  kAlpha_F32xxx , kGray_8xxx , kR_8xxx , kRGB_888 ,
  kR_8 , kR_16 , kR_F16 , kGray_F16 ,
  kBGRA_4444 , kARGB_4444 , kLast = kARGB_4444
}
 
enum class  GrColorTypeEncoding { kUnorm , kSRGBUnorm , kFloat }
 
enum class  GrDstSampleFlags { kNone = 0 , kRequiresTextureBarrier = 1 << 0 , kAsInputAttachment = 1 << 1 }
 

Functions

static constexpr size_t GrSizeDivRoundUp (size_t x, size_t y)
 
static constexpr bool GrIsPrimTypeLines (GrPrimitiveType type)
 
GrFillRule GrFillRuleForPathFillType (SkPathFillType fillType)
 
GrFillRule GrFillRuleForSkPath (const SkPath &path)
 
static constexpr bool GrAATypeIsHW (GrAAType type)
 
static GrQuadAAFlags SkToGrQuadAAFlags (unsigned flags)
 
static bool GrTextureTypeHasRestrictedSampling (GrTextureType type)
 
static constexpr bool GrClipEdgeTypeIsFill (const GrClipEdgeType edgeType)
 
static constexpr bool GrClipEdgeTypeIsInverseFill (const GrClipEdgeType edgeType)
 
static constexpr bool GrClipEdgeTypeIsAA (const GrClipEdgeType edgeType)
 
static GrClipEdgeType GrInvertClipEdgeType (const GrClipEdgeType edgeType)
 
static constexpr SkColorType GrColorTypeToSkColorType (GrColorType ct)
 
static constexpr GrColorType SkColorTypeToGrColorType (SkColorType ct)
 
static constexpr uint32_t GrColorTypeChannelFlags (GrColorType ct)
 
static constexpr GrColorFormatDesc GrGetColorTypeDesc (GrColorType ct)
 
static constexpr GrClampType GrColorTypeClampType (GrColorType colorType)
 
static constexpr bool GrColorTypeIsWiderThan (GrColorType colorType, int n)
 
static constexpr bool GrColorTypeIsAlphaOnly (GrColorType ct)
 
static constexpr bool GrColorTypeHasAlpha (GrColorType ct)
 
static constexpr size_t GrColorTypeBytesPerPixel (GrColorType ct)
 

Variables

static constexpr int kNumGrPrimitiveTypes = (int)GrPrimitiveType::kLineStrip + 1
 
static const int kGrAATypeCount = static_cast<int>(GrAAType::kLast) + 1
 
static const int kGrShaderTypeCount = kLast_GrShaderType + 1
 
static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1
 
static const int kGrClipEdgeTypeCnt = (int) GrClipEdgeType::kLast + 1
 
static const constexpr int kGrGpuBufferTypeCount = static_cast<int>(GrGpuBufferType::kUniform) + 1
 
static constexpr int kGrInternalTextureFlagsMask
 
static constexpr int kGrInternalRenderTargetFlagsMask
 
static constexpr int kGrInternalTextureRenderTargetFlagsMask
 
static const int kGrColorTypeCnt = static_cast<int>(GrColorType::kLast) + 1
 

Macro Definition Documentation

◆ GrCapsDebugf

#define GrCapsDebugf (   caps,
  ... 
)    do {} while (0)

Definition at line 489 of file GrTypesPriv.h.

Typedef Documentation

◆ GrVisitProxyFunc

Definition at line 942 of file GrTypesPriv.h.

Enumeration Type Documentation

◆ GpuPathRenderers

enum class GpuPathRenderers
strong

Used to include or exclude specific GPU path renderers for testing purposes.

Enumerator
kNone 
kDashLine 
kAtlas 
kTessellation 
kCoverageCounting 
kAAHairline 
kAAConvex 
kAALinearizing 
kSmall 
kTriangulating 
kDefault 

Definition at line 505 of file GrTypesPriv.h.

505 {
506 kNone = 0, // Always use software masks and/or DefaultPathRenderer.
507 kDashLine = 1 << 0,
508 kAtlas = 1 << 1,
509 kTessellation = 1 << 2,
510 kCoverageCounting = 1 << 3,
511 kAAHairline = 1 << 4,
512 kAAConvex = 1 << 5,
513 kAALinearizing = 1 << 6,
514 kSmall = 1 << 7,
515 kTriangulating = 1 << 8,
516 kDefault = ((1 << 9) - 1) // All path renderers.
517};

◆ GrAA

enum class GrAA : bool
strong

Used to control antialiasing in draw calls.

Enumerator
kNo 
kYes 

Definition at line 172 of file GrTypesPriv.h.

172 : bool {
173 kNo = false,
174 kYes = true
175};

◆ GrAAType

enum class GrAAType : unsigned
strong

This enum indicates the type of antialiasing to be performed.

Enumerator
kNone 

No antialiasing

kCoverage 

Use fragment shader code to blend with a fractional pixel coverage.

kMSAA 

Use normal MSAA.

kLast 

Definition at line 199 of file GrTypesPriv.h.

199 : unsigned {
200 /** No antialiasing */
201 kNone,
202 /** Use fragment shader code to blend with a fractional pixel coverage. */
203 kCoverage,
204 /** Use normal MSAA. */
205 kMSAA,
206
207 kLast = kMSAA
208};

◆ GrAccessPattern

Provides a performance hint regarding the frequency at which a data store will be accessed.

Enumerator
kDynamic_GrAccessPattern 

Data store will be respecified repeatedly and used many times.

kStatic_GrAccessPattern 

Data store will be specified once and used many times. (Thus disqualified from caching.)

kStream_GrAccessPattern 

Data store will be specified once and used at most a few times. (Also can't be cached.)

kLast_GrAccessPattern 

Definition at line 423 of file GrTypesPriv.h.

423 {
424 /** Data store will be respecified repeatedly and used many times. */
426 /** Data store will be specified once and used many times. (Thus disqualified from caching.) */
428 /** Data store will be specified once and used at most a few times. (Also can't be cached.) */
430
432};
@ kDynamic_GrAccessPattern
@ kLast_GrAccessPattern
@ kStatic_GrAccessPattern
@ kStream_GrAccessPattern

◆ GrBackendObjectOwnership

enum class GrBackendObjectOwnership : bool
strong

Specifies if the holder owns the backend, OpenGL or Vulkan, object.

Enumerator
kBorrowed 

Holder does not destroy the backend object.

kOwned 

Holder destroys the backend object.

Definition at line 495 of file GrTypesPriv.h.

495 : bool {
496 /** Holder does not destroy the backend object. */
497 kBorrowed = false,
498 /** Holder destroys the backend object. */
499 kOwned = true
500};

◆ GrBudgetedType

enum class GrBudgetedType : uint8_t
strong
Enumerator
kBudgeted 

The resource is budgeted and is subject to purging under budget pressure.

kUnbudgetedUncacheable 

The resource is unbudgeted and is purged as soon as it has no refs regardless of whether it has a unique or scratch key.

kUnbudgetedCacheable 

The resource is unbudgeted and is allowed to remain in the cache with no refs if it has a unique key. Scratch keys are ignored.

Definition at line 99 of file GrTypesPriv.h.

99 : uint8_t {
100 /** The resource is budgeted and is subject to purging under budget pressure. */
101 kBudgeted,
102 /**
103 * The resource is unbudgeted and is purged as soon as it has no refs regardless of whether
104 * it has a unique or scratch key.
105 */
107 /**
108 * The resource is unbudgeted and is allowed to remain in the cache with no refs if it
109 * has a unique key. Scratch keys are ignored.
110 */
112};

◆ GrClampType

enum class GrClampType
strong

Some pixel configs are inherently clamped to [0,1], some are allowed to go outside that range, and some are FP but manually clamped in the XP.

Enumerator
kAuto 
kManual 
kNone 

Definition at line 227 of file GrTypesPriv.h.

227 {
228 kAuto, // Normalized, fixed-point configs
229 kManual, // Clamped FP configs
230 kNone, // Normal (unclamped) FP configs
231};

◆ GrClipEdgeType

enum class GrClipEdgeType
strong

We have coverage effects that clip rendering to the edge of some geometric primitive. This enum specifies how that clipping is performed. Not all factories that take a GrClipEdgeType will succeed with all values and it is up to the caller to verify success.

Enumerator
kFillBW 
kFillAA 
kInverseFillBW 
kInverseFillAA 
kLast 

Definition at line 360 of file GrTypesPriv.h.

◆ GrColorType

enum class GrColorType
strong

Like SkColorType this describes a layout of pixel data in CPU memory. It specifies the channels, their type, and width. This exists so that the GPU backend can have private types that have no analog in the public facing SkColorType enum and omit types not implemented in the GPU backend. It does not refer to a texture format and the mapping to texture formats may be many-to-many. It does not specify the sRGB encoding of the stored values. The components are listed in order of where they appear in memory. In other words the first component listed is in the low bits and the last component in the high bits.

Enumerator
kUnknown 
kAlpha_8 
kBGR_565 
kRGB_565 
kABGR_4444 
kRGBA_8888 
kRGBA_8888_SRGB 
kRGB_888x 
kRG_88 
kBGRA_8888 
kRGBA_1010102 
kBGRA_1010102 
kRGBA_10x6 
kGray_8 
kGrayAlpha_88 
kAlpha_F16 
kRGBA_F16 
kRGBA_F16_Clamped 
kRGBA_F32 
kAlpha_16 
kRG_1616 
kRG_F16 
kRGBA_16161616 
kAlpha_8xxx 
kAlpha_F32xxx 
kGray_8xxx 
kR_8xxx 
kRGB_888 
kR_8 
kR_16 
kR_F16 
kGray_F16 
kBGRA_4444 
kARGB_4444 
kLast 

Definition at line 539 of file GrTypesPriv.h.

539 {
540 kUnknown,
541 kAlpha_8,
542 kBGR_565,
543 kRGB_565,
544 kABGR_4444, // This name differs from SkColorType. kARGB_4444_SkColorType is misnamed.
547 kRGB_888x,
548 kRG_88,
553 kGray_8,
556 kRGBA_F16,
558 kRGBA_F32,
559
560 kAlpha_16,
561 kRG_1616,
562 kRG_F16,
564
565 // Unusual types that come up after reading back in cases where we are reassigning the meaning
566 // of a texture format's channels to use for a particular color format but have to read back the
567 // data to a full RGBA quadruple. (e.g. using a R8 texture format as A8 color type but the API
568 // only supports reading to RGBA8.) None of these have SkColorType equivalents.
572 kR_8xxx,
573
574 // Types used to initialize backend textures.
575 kRGB_888,
576 kR_8,
577 kR_16,
578 kR_F16,
579 kGray_F16,
582
584};

◆ GrColorTypeEncoding

enum class GrColorTypeEncoding
strong

Describes the encoding of channel data in a GrColorType.

Enumerator
kUnorm 
kSRGBUnorm 
kFloat 

Definition at line 703 of file GrTypesPriv.h.

703 {
704 kUnorm,
706 // kSnorm,
707 kFloat,
708 // kSint
709 // kUint
710};

◆ GrDDLProvider

enum class GrDDLProvider : bool
strong
Enumerator
kNo 
kYes 

Definition at line 70 of file GrTypesPriv.h.

70 : bool {
71 kNo = false,
72 kYes = true
73};

◆ GrDstSampleFlags

enum class GrDstSampleFlags
strong
Enumerator
kNone 
kRequiresTextureBarrier 
kAsInputAttachment 

Definition at line 935 of file GrTypesPriv.h.

935 {
936 kNone = 0,
938 kAsInputAttachment = 1 << 1,
939};

◆ GrFillRule

enum class GrFillRule : bool
strong
Enumerator
kNonzero 
kEvenOdd 

Definition at line 177 of file GrTypesPriv.h.

177 : bool {
178 kNonzero,
180};

◆ GrGpuBufferType

enum class GrGpuBufferType
strong

Indicates the type of data that a GPU buffer will be used for.

Enumerator
kVertex 
kIndex 
kDrawIndirect 
kXferCpuToGpu 
kXferGpuToCpu 
kUniform 

Definition at line 410 of file GrTypesPriv.h.

◆ GrInternalSurfaceFlags

enum class GrInternalSurfaceFlags
strong
Enumerator
kNone 
kReadOnly 
kGLRTFBOIDIs0 
kRequiresManualMSAAResolve 
kFramebufferOnly 
kVkRTSupportsInputAttachment 

Definition at line 435 of file GrTypesPriv.h.

435 {
436 kNone = 0,
437
438 // Texture-level
439
440 // Means the pixels in the texture are read-only. Cannot also be a GrRenderTarget[Proxy].
441 kReadOnly = 1 << 0,
442
443 // RT-level
444
445 // This flag is for use with GL only. It tells us that the internal render target wraps FBO 0.
446 kGLRTFBOIDIs0 = 1 << 1,
447
448 // This means the render target is multisampled, and internally holds a non-msaa texture for
449 // resolving into. The render target resolves itself by blitting into this internal texture.
450 // (asTexture() might or might not return the internal texture, but if it does, we always
451 // resolve the render target before accessing this texture's data.)
453
454 // This means the pixels in the render target are write-only. This is used for Dawn and Metal
455 // swap chain targets which can be rendered to, but not read or copied.
456 kFramebufferOnly = 1 << 3,
457
458 // This is a Vulkan only flag. If set the surface can be used as an input attachment in a
459 // shader. This is used for doing in shader blending where we want to sample from the same
460 // image we are drawing to.
462};

◆ GrIOType

enum GrIOType

Indicates the type of pending IO operations that can be recorded for gpu resources.

Enumerator
kRead_GrIOType 
kWrite_GrIOType 
kRW_GrIOType 

Definition at line 401 of file GrTypesPriv.h.

401 {
405};
@ kRead_GrIOType
@ kRW_GrIOType
@ kWrite_GrIOType

◆ GrLoadOp

enum class GrLoadOp
strong

This enum is used to specify the load operation to be used when an OpsTask/GrOpsRenderPass begins execution.

Enumerator
kLoad 
kClear 
kDiscard 

Definition at line 154 of file GrTypesPriv.h.

154 {
155 kLoad,
156 kClear,
157 kDiscard,
158};

◆ GrMemoryless

enum class GrMemoryless : bool
strong
Enumerator
kNo 

The texture will be allocated normally and will affect memory budgets.

kYes 

The texture will be not use GPU memory and will not affect memory budgets.

Definition at line 122 of file GrTypesPriv.h.

122 : bool {
123 /**
124 * The texture will be allocated normally and will affect memory budgets.
125 */
126 kNo = false,
127 /**
128 * The texture will be not use GPU memory and will not affect memory budgets.
129 */
130 kYes = true
131};

◆ GrMipmapStatus

enum class GrMipmapStatus
strong

Used to describe the current state of Mips on a GrTexture

Enumerator
kNotAllocated 
kDirty 
kValid 

Definition at line 522 of file GrTypesPriv.h.

522 {
523 kNotAllocated, // Mips have not been allocated
524 kDirty, // Mips are allocated but the full mip tree does not have valid data
525 kValid, // All levels fully allocated and have valid data in them
526};

◆ GrPrimitiveRestart

enum class GrPrimitiveRestart : bool
strong
Enumerator
kNo 
kYes 

Definition at line 55 of file GrTypesPriv.h.

55 : bool {
56 kNo = false,
57 kYes = true
58};

◆ GrPrimitiveType

enum class GrPrimitiveType : uint8_t
strong

Geometric primitives used for drawing.

Enumerator
kTriangles 
kTriangleStrip 
kPoints 
kLines 
kLineStrip 

Definition at line 42 of file GrTypesPriv.h.

42 : uint8_t {
45 kPoints,
46 kLines, // 1 pix wide only
47 kLineStrip, // 1 pix wide only
48};

◆ GrQuadAAFlags

enum class GrQuadAAFlags
strong

A number of rectangle/quadrilateral drawing APIs can control anti-aliasing on a per edge basis. These masks specify which edges are AA'ed. The intent for this is to support tiling with seamless boundaries, where the inner edges are non-AA and the outer edges are AA. Regular rectangle draws simply use kAll or kNone depending on if they want anti-aliasing or not.

In APIs that support per-edge AA, GrQuadAAFlags is the only AA-control parameter that is provided (compared to the typical GrAA parameter). kNone is equivalent to GrAA::kNo, and any other set of edge flags would require GrAA::kYes (with rendering output dependent on how that maps to GrAAType for a given SurfaceDrawContext).

These values are identical to SkCanvas::QuadAAFlags.

Enumerator
kLeft 
kTop 
kRight 
kBottom 
kNone 
kAll 

Definition at line 246 of file GrTypesPriv.h.

246 {
247 kLeft = 0b0001,
248 kTop = 0b0010,
249 kRight = 0b0100,
250 kBottom = 0b1000,
251
252 kNone = 0b0000,
253 kAll = 0b1111,
254};

◆ GrScissorTest

enum class GrScissorTest : bool
strong
Enumerator
kDisabled 
kEnabled 

Definition at line 114 of file GrTypesPriv.h.

114 : bool {
115 kDisabled = false,
116 kEnabled = true
117};

◆ GrSemaphoreWrapType

enum class GrSemaphoreWrapType
strong
Enumerator
kWillSignal 
kWillWait 

Definition at line 145 of file GrTypesPriv.h.

◆ GrShaderFlags

Enumerator
kNone_GrShaderFlags 
kVertex_GrShaderFlag 
kFragment_GrShaderFlag 

Definition at line 283 of file GrTypesPriv.h.

283 {
285 kVertex_GrShaderFlag = 1 << 0,
287};
@ kVertex_GrShaderFlag
@ kNone_GrShaderFlags
@ kFragment_GrShaderFlag

◆ GrShaderType

Enumerator
kVertex_GrShaderType 
kFragment_GrShaderType 
kLast_GrShaderType 

Definition at line 275 of file GrTypesPriv.h.

275 {
278
280};
@ kLast_GrShaderType
@ kFragment_GrShaderType
@ kVertex_GrShaderType

◆ GrStoreOp

enum class GrStoreOp
strong

This enum is used to specify the store operation to be used when an OpsTask/GrOpsRenderPass ends execution.

Enumerator
kStore 
kDiscard 

Definition at line 164 of file GrTypesPriv.h.

164 {
165 kStore,
166 kDiscard,
167};

◆ GrTexturable

enum class GrTexturable : bool
strong

Should a created surface be texturable?

Enumerator
kNo 
kYes 

Definition at line 63 of file GrTypesPriv.h.

63 : bool {
64 kNo = false,
65 kYes = true
66};

◆ GrTextureType

enum class GrTextureType
strong

The type of texture. Backends other than GL currently only use the 2D value but the type must still be known at the API-neutral layer as it used to determine whether MIP maps, renderability, and sampling parameters are legal for proxies that will be instantiated with wrapped textures.

Enumerator
kNone 
k2D 
kRectangle 
kExternal 

Definition at line 267 of file GrTypesPriv.h.

267 {
268 kNone,
269 k2D,
270 /* Rectangle uses unnormalized texture coordinates. */
273};

◆ GrVertexAttribType

Types used to describe format of vertices in arrays.

Enumerator
kFloat_GrVertexAttribType 
kFloat2_GrVertexAttribType 
kFloat3_GrVertexAttribType 
kFloat4_GrVertexAttribType 
kHalf_GrVertexAttribType 
kHalf2_GrVertexAttribType 
kHalf4_GrVertexAttribType 
kInt2_GrVertexAttribType 
kInt3_GrVertexAttribType 
kInt4_GrVertexAttribType 
kByte_GrVertexAttribType 
kByte2_GrVertexAttribType 
kByte4_GrVertexAttribType 
kUByte_GrVertexAttribType 
kUByte2_GrVertexAttribType 
kUByte4_GrVertexAttribType 
kUByte_norm_GrVertexAttribType 
kUByte4_norm_GrVertexAttribType 
kShort2_GrVertexAttribType 
kShort4_GrVertexAttribType 
kUShort2_GrVertexAttribType 
kUShort2_norm_GrVertexAttribType 
kInt_GrVertexAttribType 
kUInt_GrVertexAttribType 
kUShort_norm_GrVertexAttribType 
kUShort4_norm_GrVertexAttribType 
kLast_GrVertexAttribType 

Definition at line 311 of file GrTypesPriv.h.

311 {
319
320 kInt2_GrVertexAttribType, // vector of 2 32-bit ints
321 kInt3_GrVertexAttribType, // vector of 3 32-bit ints
322 kInt4_GrVertexAttribType, // vector of 4 32-bit ints
323
324
325 kByte_GrVertexAttribType, // signed byte
326 kByte2_GrVertexAttribType, // vector of 2 8-bit signed bytes
327 kByte4_GrVertexAttribType, // vector of 4 8-bit signed bytes
328 kUByte_GrVertexAttribType, // unsigned byte
329 kUByte2_GrVertexAttribType, // vector of 2 8-bit unsigned bytes
330 kUByte4_GrVertexAttribType, // vector of 4 8-bit unsigned bytes
331
332 kUByte_norm_GrVertexAttribType, // unsigned byte, e.g. coverage, 0 -> 0.0f, 255 -> 1.0f.
333 kUByte4_norm_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors, 0 -> 0.0f,
334 // 255 -> 1.0f.
335
336 kShort2_GrVertexAttribType, // vector of 2 16-bit shorts.
337 kShort4_GrVertexAttribType, // vector of 4 16-bit shorts.
338
339 kUShort2_GrVertexAttribType, // vector of 2 unsigned shorts. 0 -> 0, 65535 -> 65535.
340 kUShort2_norm_GrVertexAttribType, // vector of 2 unsigned shorts. 0 -> 0.0f, 65535 -> 1.0f.
341
344
346
347 kUShort4_norm_GrVertexAttribType, // vector of 4 unsigned shorts. 0 -> 0.0f, 65535 -> 1.0f.
348
350};
@ kUShort_norm_GrVertexAttribType
@ kFloat2_GrVertexAttribType
@ kUShort2_GrVertexAttribType
@ kUInt_GrVertexAttribType
@ kUByte4_norm_GrVertexAttribType
@ kUByte_GrVertexAttribType
@ kShort2_GrVertexAttribType
@ kUShort4_norm_GrVertexAttribType
@ kInt_GrVertexAttribType
@ kByte_GrVertexAttribType
@ kLast_GrVertexAttribType
@ kByte4_GrVertexAttribType
@ kFloat3_GrVertexAttribType
@ kFloat_GrVertexAttribType
@ kByte2_GrVertexAttribType
@ kFloat4_GrVertexAttribType
@ kShort4_GrVertexAttribType
@ kUShort2_norm_GrVertexAttribType
@ kInt3_GrVertexAttribType
@ kHalf2_GrVertexAttribType
@ kHalf4_GrVertexAttribType
@ kUByte4_GrVertexAttribType
@ kUByte2_GrVertexAttribType
@ kInt4_GrVertexAttribType
@ kUByte_norm_GrVertexAttribType
@ kInt2_GrVertexAttribType
@ kHalf_GrVertexAttribType

◆ GrWrapCacheable

enum class GrWrapCacheable : bool
strong
Enumerator
kNo 

The wrapped resource will be removed from the cache as soon as it becomes purgeable. It may still be assigned and found by a unique key, but the presence of the key will not be used to keep the resource alive when it has no references.

kYes 

The wrapped resource is allowed to remain in the GrResourceCache when it has no references but has a unique key. Such resources should only be given unique keys when it is known that the key will eventually be removed from the resource or invalidated via the message bus.

Definition at line 84 of file GrTypesPriv.h.

84 : bool {
85 /**
86 * The wrapped resource will be removed from the cache as soon as it becomes purgeable. It may
87 * still be assigned and found by a unique key, but the presence of the key will not be used to
88 * keep the resource alive when it has no references.
89 */
90 kNo = false,
91 /**
92 * The wrapped resource is allowed to remain in the GrResourceCache when it has no references
93 * but has a unique key. Such resources should only be given unique keys when it is known that
94 * the key will eventually be removed from the resource or invalidated via the message bus.
95 */
96 kYes = true
97};

◆ GrWrapOwnership

Ownership rules for external GPU resources imported into Skia.

Enumerator
kBorrow_GrWrapOwnership 

Skia will assume the client will keep the resource alive and Skia will not free it.

kAdopt_GrWrapOwnership 

Skia will assume ownership of the resource and free it.

Definition at line 76 of file GrTypesPriv.h.

76 {
77 /** Skia will assume the client will keep the resource alive and Skia will not free it. */
79
80 /** Skia will assume ownership of the resource and free it. */
82};
@ kAdopt_GrWrapOwnership
Definition GrTypesPriv.h:81
@ kBorrow_GrWrapOwnership
Definition GrTypesPriv.h:78

Function Documentation

◆ GrAATypeIsHW()

static constexpr bool GrAATypeIsHW ( GrAAType  type)
staticconstexpr

Definition at line 211 of file GrTypesPriv.h.

211 {
212 switch (type) {
213 case GrAAType::kNone:
214 return false;
216 return false;
217 case GrAAType::kMSAA:
218 return true;
219 }
221}
#define SkUNREACHABLE
Definition SkAssert.h:135

◆ GrClipEdgeTypeIsAA()

static constexpr bool GrClipEdgeTypeIsAA ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 379 of file GrTypesPriv.h.

379 {
380 return (GrClipEdgeType::kFillBW != edgeType &&
382}

◆ GrClipEdgeTypeIsFill()

static constexpr bool GrClipEdgeTypeIsFill ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 370 of file GrTypesPriv.h.

370 {
371 return (GrClipEdgeType::kFillAA == edgeType || GrClipEdgeType::kFillBW == edgeType);
372}

◆ GrClipEdgeTypeIsInverseFill()

static constexpr bool GrClipEdgeTypeIsInverseFill ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 374 of file GrTypesPriv.h.

374 {
375 return (GrClipEdgeType::kInverseFillAA == edgeType ||
377}

◆ GrColorTypeBytesPerPixel()

static constexpr size_t GrColorTypeBytesPerPixel ( GrColorType  ct)
staticconstexpr

Definition at line 895 of file GrTypesPriv.h.

895 {
896 switch (ct) {
897 case GrColorType::kUnknown: return 0;
898 case GrColorType::kAlpha_8: return 1;
899 case GrColorType::kBGR_565: return 2;
900 case GrColorType::kRGB_565: return 2;
901 case GrColorType::kABGR_4444: return 2;
902 case GrColorType::kRGBA_8888: return 4;
903 case GrColorType::kRGBA_8888_SRGB: return 4;
904 case GrColorType::kRGB_888x: return 4;
905 case GrColorType::kRG_88: return 2;
906 case GrColorType::kBGRA_8888: return 4;
907 case GrColorType::kRGBA_1010102: return 4;
908 case GrColorType::kBGRA_1010102: return 4;
909 case GrColorType::kRGBA_10x6: return 8;
910 case GrColorType::kGray_8: return 1;
911 case GrColorType::kGrayAlpha_88: return 2;
912 case GrColorType::kAlpha_F16: return 2;
913 case GrColorType::kRGBA_F16: return 8;
914 case GrColorType::kRGBA_F16_Clamped: return 8;
915 case GrColorType::kRGBA_F32: return 16;
916 case GrColorType::kAlpha_8xxx: return 4;
917 case GrColorType::kAlpha_F32xxx: return 16;
918 case GrColorType::kGray_8xxx: return 4;
919 case GrColorType::kR_8xxx: return 4;
920 case GrColorType::kAlpha_16: return 2;
921 case GrColorType::kRG_1616: return 4;
922 case GrColorType::kRGBA_16161616: return 8;
923 case GrColorType::kRG_F16: return 4;
924 case GrColorType::kRGB_888: return 3;
925 case GrColorType::kR_8: return 1;
926 case GrColorType::kR_16: return 2;
927 case GrColorType::kR_F16: return 2;
928 case GrColorType::kGray_F16: return 2;
929 case GrColorType::kARGB_4444: return 2;
930 case GrColorType::kBGRA_4444: return 2;
931 }
933}

◆ GrColorTypeChannelFlags()

static constexpr uint32_t GrColorTypeChannelFlags ( GrColorType  ct)
staticconstexpr

Definition at line 660 of file GrTypesPriv.h.

660 {
661 switch (ct) {
662 case GrColorType::kUnknown: return 0;
696 }
698}
@ kRGB_SkColorChannelFlags
Definition SkColor.h:247
@ kRGBA_SkColorChannelFlags
Definition SkColor.h:248
@ kRed_SkColorChannelFlag
Definition SkColor.h:239
@ kGrayAlpha_SkColorChannelFlags
Definition SkColor.h:245
@ kRG_SkColorChannelFlags
Definition SkColor.h:246
@ kAlpha_SkColorChannelFlag
Definition SkColor.h:242
@ kGray_SkColorChannelFlag
Definition SkColor.h:243

◆ GrColorTypeClampType()

static constexpr GrClampType GrColorTypeClampType ( GrColorType  colorType)
staticconstexpr

Definition at line 867 of file GrTypesPriv.h.

867 {
870 return GrClampType::kAuto;
871 }
873}
static constexpr GrColorFormatDesc GrGetColorTypeDesc(GrColorType ct)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)

◆ GrColorTypeHasAlpha()

static constexpr bool GrColorTypeHasAlpha ( GrColorType  ct)
staticconstexpr

Definition at line 891 of file GrTypesPriv.h.

891 {
893}
static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct)

◆ GrColorTypeIsAlphaOnly()

static constexpr bool GrColorTypeIsAlphaOnly ( GrColorType  ct)
staticconstexpr

Definition at line 887 of file GrTypesPriv.h.

887 {
889}

◆ GrColorTypeIsWiderThan()

static constexpr bool GrColorTypeIsWiderThan ( GrColorType  colorType,
int  n 
)
staticconstexpr

Definition at line 877 of file GrTypesPriv.h.

877 {
878 SkASSERT(n > 0);
880 return (desc.r() && desc.r() > n )||
881 (desc.g() && desc.g() > n) ||
882 (desc.b() && desc.b() > n) ||
883 (desc.a() && desc.a() > n) ||
884 (desc.gray() && desc.gray() > n);
885}
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ GrColorTypeToSkColorType()

static constexpr SkColorType GrColorTypeToSkColorType ( GrColorType  ct)
staticconstexpr

Definition at line 588 of file GrTypesPriv.h.

588 {
589 switch (ct) {
624 }
626}
@ kR16G16B16A16_unorm_SkColorType
pixel with a little endian uint16_t for red, green, blue
Definition SkColorType.h:50
@ kRGBA_10x6_SkColorType
pixel with 10 used bits (most significant) followed by 6 unused
Definition SkColorType.h:33
@ kR8_unorm_SkColorType
Definition SkColorType.h:54
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
Definition SkColorType.h:23
@ kR8G8_unorm_SkColorType
pixel with a uint8_t for red and green
Definition SkColorType.h:43
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition SkColorType.h:26
@ kA16_unorm_SkColorType
pixel with a little endian uint16_t for alpha
Definition SkColorType.h:48
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition SkColorType.h:38
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
Definition SkColorType.h:21
@ kSRGBA_8888_SkColorType
Definition SkColorType.h:53
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition SkColorType.h:35
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
Definition SkColorType.h:22
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
Definition SkColorType.h:25
@ kBGRA_1010102_SkColorType
10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
Definition SkColorType.h:28
@ kA16_float_SkColorType
pixel with a half float for alpha
Definition SkColorType.h:45
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
Definition SkColorType.h:40
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
Definition SkColorType.h:27
@ kR16G16_unorm_SkColorType
pixel with a little endian uint16_t for red and green
Definition SkColorType.h:49
@ kRGBA_F16Norm_SkColorType
pixel with half floats in [0,1] for red, green, blue, alpha;
Definition SkColorType.h:36
@ kUnknown_SkColorType
uninitialized
Definition SkColorType.h:20
@ kR16G16_float_SkColorType
pixel with a half float for red and green
Definition SkColorType.h:46

◆ GrFillRuleForPathFillType()

GrFillRule GrFillRuleForPathFillType ( SkPathFillType  fillType)
inline

Definition at line 182 of file GrTypesPriv.h.

◆ GrFillRuleForSkPath()

GrFillRule GrFillRuleForSkPath ( const SkPath path)
inline

Definition at line 194 of file GrTypesPriv.h.

194 {
195 return GrFillRuleForPathFillType(path.getFillType());
196}
GrFillRule GrFillRuleForPathFillType(SkPathFillType fillType)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ GrGetColorTypeDesc()

static constexpr GrColorFormatDesc GrGetColorTypeDesc ( GrColorType  ct)
staticconstexpr

Definition at line 793 of file GrTypesPriv.h.

793 {
794 switch (ct) {
863 }
865}
static constexpr GrColorFormatDesc MakeInvalid()
static constexpr GrColorFormatDesc MakeRGBA(int rgba, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeAlpha(int a, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeGray(int grayBits, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeRG(int rg, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeRGB(int rgb, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeGrayAlpha(int grayAlpha, GrColorTypeEncoding e)
static constexpr GrColorFormatDesc MakeR(int r, GrColorTypeEncoding e)

◆ GrInvertClipEdgeType()

static GrClipEdgeType GrInvertClipEdgeType ( const GrClipEdgeType  edgeType)
inlinestatic

Definition at line 384 of file GrTypesPriv.h.

◆ GrIsPrimTypeLines()

static constexpr bool GrIsPrimTypeLines ( GrPrimitiveType  type)
staticconstexpr

Definition at line 51 of file GrTypesPriv.h.

◆ GrSizeDivRoundUp()

static constexpr size_t GrSizeDivRoundUp ( size_t  x,
size_t  y 
)
inlinestaticconstexpr

divide, rounding up

Definition at line 37 of file GrTypesPriv.h.

37{ return (x + (y - 1)) / y; }
double y
double x

◆ GrTextureTypeHasRestrictedSampling()

static bool GrTextureTypeHasRestrictedSampling ( GrTextureType  type)
inlinestatic

Rectangle and external textures only support the clamp wrap mode and do not support MIP maps.

Definition at line 293 of file GrTypesPriv.h.

293 {
294 switch (type) {
296 return false;
298 return true;
300 return true;
301 default:
302 SK_ABORT("Unexpected texture type");
303 }
304}
#define SK_ABORT(message,...)
Definition SkAssert.h:70

◆ SkColorTypeToGrColorType()

static constexpr GrColorType SkColorTypeToGrColorType ( SkColorType  ct)
staticconstexpr

Definition at line 628 of file GrTypesPriv.h.

628 {
629 switch (ct) {
656 }
658}
@ kBGR_101010x_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word
Definition SkColorType.h:30
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
Definition SkColorType.h:29
@ kBGRA_10101010_XR_SkColorType
pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
Definition SkColorType.h:32
@ kBGR_101010x_XR_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
Definition SkColorType.h:31

◆ SkToGrQuadAAFlags()

static GrQuadAAFlags SkToGrQuadAAFlags ( unsigned  flags)
inlinestatic

Definition at line 258 of file GrTypesPriv.h.

258 {
259 return static_cast<GrQuadAAFlags>(flags);
260}
GrQuadAAFlags
FlutterSemanticsFlag flags

Variable Documentation

◆ kGrAATypeCount

const int kGrAATypeCount = static_cast<int>(GrAAType::kLast) + 1
static

Definition at line 209 of file GrTypesPriv.h.

◆ kGrClipEdgeTypeCnt

const int kGrClipEdgeTypeCnt = (int) GrClipEdgeType::kLast + 1
static

Definition at line 368 of file GrTypesPriv.h.

◆ kGrColorTypeCnt

const int kGrColorTypeCnt = static_cast<int>(GrColorType::kLast) + 1
static

Definition at line 586 of file GrTypesPriv.h.

◆ kGrGpuBufferTypeCount

const constexpr int kGrGpuBufferTypeCount = static_cast<int>(GrGpuBufferType::kUniform) + 1
staticconstexpr

Definition at line 418 of file GrTypesPriv.h.

◆ kGrInternalRenderTargetFlagsMask

constexpr int kGrInternalRenderTargetFlagsMask
staticconstexpr
Initial value:

Definition at line 477 of file GrTypesPriv.h.

◆ kGrInternalTextureFlagsMask

constexpr int kGrInternalTextureFlagsMask
staticconstexpr
Initial value:
= static_cast<int>(

Definition at line 468 of file GrTypesPriv.h.

◆ kGrInternalTextureRenderTargetFlagsMask

constexpr int kGrInternalTextureRenderTargetFlagsMask
staticconstexpr
Initial value:
=
static constexpr int kGrInternalTextureFlagsMask
static constexpr int kGrInternalRenderTargetFlagsMask

Definition at line 482 of file GrTypesPriv.h.

◆ kGrShaderTypeCount

const int kGrShaderTypeCount = kLast_GrShaderType + 1
static

Definition at line 281 of file GrTypesPriv.h.

◆ kGrVertexAttribTypeCount

const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1
static

Definition at line 351 of file GrTypesPriv.h.

◆ kNumGrPrimitiveTypes

constexpr int kNumGrPrimitiveTypes = (int)GrPrimitiveType::kLineStrip + 1
staticconstexpr

Definition at line 49 of file GrTypesPriv.h.