Flutter Engine
The Flutter Engine
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/SkDebug.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 490 of file GrTypesPriv.h.

Typedef Documentation

◆ GrVisitProxyFunc

Definition at line 943 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 506 of file GrTypesPriv.h.

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

◆ GrAA

enum class GrAA : bool
strong

Used to control antialiasing in draw calls.

Enumerator
kNo 
kYes 

Definition at line 173 of file GrTypesPriv.h.

173 : bool {
174 kNo = false,
175 kYes = true
176};
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.

◆ 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 200 of file GrTypesPriv.h.

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

◆ 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 424 of file GrTypesPriv.h.

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

◆ 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 496 of file GrTypesPriv.h.

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

◆ 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 100 of file GrTypesPriv.h.

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

◆ 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 228 of file GrTypesPriv.h.

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

◆ 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 361 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 540 of file GrTypesPriv.h.

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

◆ GrColorTypeEncoding

enum class GrColorTypeEncoding
strong

Describes the encoding of channel data in a GrColorType.

Enumerator
kUnorm 
kSRGBUnorm 
kFloat 

Definition at line 704 of file GrTypesPriv.h.

704 {
705 kUnorm,
707 // kSnorm,
708 kFloat,
709 // kSint
710 // kUint
711};

◆ GrDDLProvider

enum class GrDDLProvider : bool
strong
Enumerator
kNo 
kYes 

Definition at line 71 of file GrTypesPriv.h.

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

◆ GrDstSampleFlags

enum class GrDstSampleFlags
strong
Enumerator
kNone 
kRequiresTextureBarrier 
kAsInputAttachment 

Definition at line 936 of file GrTypesPriv.h.

936 {
937 kNone = 0,
939 kAsInputAttachment = 1 << 1,
940};

◆ GrFillRule

enum class GrFillRule : bool
strong
Enumerator
kNonzero 
kEvenOdd 

Definition at line 178 of file GrTypesPriv.h.

178 : bool {
179 kNonzero,
181};

◆ 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 411 of file GrTypesPriv.h.

◆ GrInternalSurfaceFlags

enum class GrInternalSurfaceFlags
strong
Enumerator
kNone 
kReadOnly 
kGLRTFBOIDIs0 
kRequiresManualMSAAResolve 
kFramebufferOnly 
kVkRTSupportsInputAttachment 

Definition at line 436 of file GrTypesPriv.h.

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

◆ 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 402 of file GrTypesPriv.h.

402 {
406};
@ kRead_GrIOType
Definition: GrTypesPriv.h:403
@ kRW_GrIOType
Definition: GrTypesPriv.h:405
@ kWrite_GrIOType
Definition: GrTypesPriv.h:404

◆ 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 155 of file GrTypesPriv.h.

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

◆ 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 123 of file GrTypesPriv.h.

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

◆ GrMipmapStatus

enum class GrMipmapStatus
strong

Used to describe the current state of Mips on a GrTexture

Enumerator
kNotAllocated 
kDirty 
kValid 

Definition at line 523 of file GrTypesPriv.h.

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

◆ GrPrimitiveRestart

enum class GrPrimitiveRestart : bool
strong
Enumerator
kNo 
kYes 

Definition at line 56 of file GrTypesPriv.h.

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

◆ GrPrimitiveType

enum class GrPrimitiveType : uint8_t
strong

Geometric primitives used for drawing.

Enumerator
kTriangles 
kTriangleStrip 
kPoints 
kLines 
kLineStrip 

Definition at line 43 of file GrTypesPriv.h.

43 : uint8_t {
46 kPoints,
47 kLines, // 1 pix wide only
48 kLineStrip, // 1 pix wide only
49};
@ kTriangles
The vertices are taken 3 at a time to form a triangle.

◆ 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 247 of file GrTypesPriv.h.

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

◆ GrScissorTest

enum class GrScissorTest : bool
strong
Enumerator
kDisabled 
kEnabled 

Definition at line 115 of file GrTypesPriv.h.

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

◆ GrSemaphoreWrapType

enum class GrSemaphoreWrapType
strong
Enumerator
kWillSignal 
kWillWait 

Definition at line 146 of file GrTypesPriv.h.

◆ GrShaderFlags

Enumerator
kNone_GrShaderFlags 
kVertex_GrShaderFlag 
kFragment_GrShaderFlag 

Definition at line 284 of file GrTypesPriv.h.

284 {
286 kVertex_GrShaderFlag = 1 << 0,
288};
@ kVertex_GrShaderFlag
Definition: GrTypesPriv.h:286
@ kNone_GrShaderFlags
Definition: GrTypesPriv.h:285
@ kFragment_GrShaderFlag
Definition: GrTypesPriv.h:287

◆ GrShaderType

Enumerator
kVertex_GrShaderType 
kFragment_GrShaderType 
kLast_GrShaderType 

Definition at line 276 of file GrTypesPriv.h.

276 {
279
281};
@ kLast_GrShaderType
Definition: GrTypesPriv.h:280
@ kFragment_GrShaderType
Definition: GrTypesPriv.h:278
@ kVertex_GrShaderType
Definition: GrTypesPriv.h:277

◆ 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 165 of file GrTypesPriv.h.

165 {
166 kStore,
167 kDiscard,
168};

◆ GrTexturable

enum class GrTexturable : bool
strong

Should a created surface be texturable?

Enumerator
kNo 
kYes 

Definition at line 64 of file GrTypesPriv.h.

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

◆ 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 268 of file GrTypesPriv.h.

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

◆ 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 312 of file GrTypesPriv.h.

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

◆ 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 85 of file GrTypesPriv.h.

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

◆ 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 77 of file GrTypesPriv.h.

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

Function Documentation

◆ GrAATypeIsHW()

static constexpr bool GrAATypeIsHW ( GrAAType  type)
staticconstexpr

Definition at line 212 of file GrTypesPriv.h.

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

◆ GrClipEdgeTypeIsAA()

static constexpr bool GrClipEdgeTypeIsAA ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 380 of file GrTypesPriv.h.

380 {
381 return (GrClipEdgeType::kFillBW != edgeType &&
383}

◆ GrClipEdgeTypeIsFill()

static constexpr bool GrClipEdgeTypeIsFill ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 371 of file GrTypesPriv.h.

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

◆ GrClipEdgeTypeIsInverseFill()

static constexpr bool GrClipEdgeTypeIsInverseFill ( const GrClipEdgeType  edgeType)
staticconstexpr

Definition at line 375 of file GrTypesPriv.h.

375 {
376 return (GrClipEdgeType::kInverseFillAA == edgeType ||
378}

◆ GrColorTypeBytesPerPixel()

static constexpr size_t GrColorTypeBytesPerPixel ( GrColorType  ct)
staticconstexpr

Definition at line 896 of file GrTypesPriv.h.

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

◆ GrColorTypeChannelFlags()

static constexpr uint32_t GrColorTypeChannelFlags ( GrColorType  ct)
staticconstexpr

Definition at line 661 of file GrTypesPriv.h.

661 {
662 switch (ct) {
663 case GrColorType::kUnknown: return 0;
697 }
699}
@ 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 868 of file GrTypesPriv.h.

868 {
871 return GrClampType::kAuto;
872 }
874}
static constexpr GrColorFormatDesc GrGetColorTypeDesc(GrColorType ct)
Definition: GrTypesPriv.h:794
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)

◆ GrColorTypeHasAlpha()

static constexpr bool GrColorTypeHasAlpha ( GrColorType  ct)
staticconstexpr

Definition at line 892 of file GrTypesPriv.h.

892 {
894}
static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct)
Definition: GrTypesPriv.h:661

◆ GrColorTypeIsAlphaOnly()

static constexpr bool GrColorTypeIsAlphaOnly ( GrColorType  ct)
staticconstexpr

Definition at line 888 of file GrTypesPriv.h.

888 {
890}

◆ GrColorTypeIsWiderThan()

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

Definition at line 878 of file GrTypesPriv.h.

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

◆ GrColorTypeToSkColorType()

static constexpr SkColorType GrColorTypeToSkColorType ( GrColorType  ct)
staticconstexpr

Definition at line 589 of file GrTypesPriv.h.

589 {
590 switch (ct) {
625 }
627}
@ 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 183 of file GrTypesPriv.h.

◆ GrFillRuleForSkPath()

GrFillRule GrFillRuleForSkPath ( const SkPath path)
inline

Definition at line 195 of file GrTypesPriv.h.

195 {
196 return GrFillRuleForPathFillType(path.getFillType());
197}
GrFillRule GrFillRuleForPathFillType(SkPathFillType fillType)
Definition: GrTypesPriv.h:183
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 794 of file GrTypesPriv.h.

794 {
795 switch (ct) {
864 }
866}
static constexpr GrColorFormatDesc MakeInvalid()
Definition: GrTypesPriv.h:756
static constexpr GrColorFormatDesc MakeRGBA(int rgba, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:720
static constexpr GrColorFormatDesc MakeAlpha(int a, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:736
static constexpr GrColorFormatDesc MakeGray(int grayBits, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:748
static constexpr GrColorFormatDesc MakeRG(int rg, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:744
static constexpr GrColorFormatDesc MakeRGB(int rgb, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:728
static constexpr GrColorFormatDesc MakeGrayAlpha(int grayAlpha, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:752
static constexpr GrColorFormatDesc MakeR(int r, GrColorTypeEncoding e)
Definition: GrTypesPriv.h:740

◆ GrInvertClipEdgeType()

static GrClipEdgeType GrInvertClipEdgeType ( const GrClipEdgeType  edgeType)
inlinestatic

Definition at line 385 of file GrTypesPriv.h.

◆ GrIsPrimTypeLines()

static constexpr bool GrIsPrimTypeLines ( GrPrimitiveType  type)
staticconstexpr

Definition at line 52 of file GrTypesPriv.h.

◆ GrSizeDivRoundUp()

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

divide, rounding up

Definition at line 38 of file GrTypesPriv.h.

38{ 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 294 of file GrTypesPriv.h.

294 {
295 switch (type) {
297 return false;
299 return true;
301 return true;
302 default:
303 SK_ABORT("Unexpected texture type");
304 }
305}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70

◆ SkColorTypeToGrColorType()

static constexpr GrColorType SkColorTypeToGrColorType ( SkColorType  ct)
staticconstexpr

Definition at line 629 of file GrTypesPriv.h.

629 {
630 switch (ct) {
657 }
659}
@ 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 259 of file GrTypesPriv.h.

259 {
260 return static_cast<GrQuadAAFlags>(flags);
261}
GrQuadAAFlags
Definition: GrTypesPriv.h:247
FlutterSemanticsFlag flags

Variable Documentation

◆ kGrAATypeCount

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

Definition at line 210 of file GrTypesPriv.h.

◆ kGrClipEdgeTypeCnt

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

Definition at line 369 of file GrTypesPriv.h.

◆ kGrColorTypeCnt

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

Definition at line 587 of file GrTypesPriv.h.

◆ kGrGpuBufferTypeCount

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

Definition at line 419 of file GrTypesPriv.h.

◆ kGrInternalRenderTargetFlagsMask

constexpr int kGrInternalRenderTargetFlagsMask
staticconstexpr
Initial value:

Definition at line 478 of file GrTypesPriv.h.

◆ kGrInternalTextureFlagsMask

constexpr int kGrInternalTextureFlagsMask
staticconstexpr
Initial value:

Definition at line 469 of file GrTypesPriv.h.

◆ kGrInternalTextureRenderTargetFlagsMask

constexpr int kGrInternalTextureRenderTargetFlagsMask
staticconstexpr
Initial value:
=
static constexpr int kGrInternalTextureFlagsMask
Definition: GrTypesPriv.h:469
static constexpr int kGrInternalRenderTargetFlagsMask
Definition: GrTypesPriv.h:478

Definition at line 483 of file GrTypesPriv.h.

◆ kGrShaderTypeCount

const int kGrShaderTypeCount = kLast_GrShaderType + 1
static

Definition at line 282 of file GrTypesPriv.h.

◆ kGrVertexAttribTypeCount

const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1
static

Definition at line 352 of file GrTypesPriv.h.

◆ kNumGrPrimitiveTypes

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

Definition at line 50 of file GrTypesPriv.h.