Flutter Engine
The Flutter Engine
Classes | Functions
GrGeometryProcessor.h File Reference
#include "include/gpu/GrBackendSurface.h"
#include "src/gpu/Swizzle.h"
#include "src/gpu/ganesh/GrColor.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrProcessor.h"
#include "src/gpu/ganesh/GrSamplerState.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrShaderVar.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include "src/gpu/ganesh/glsl/GrGLSLVarying.h"
#include <unordered_map>

Go to the source code of this file.

Classes

class  GrGeometryProcessor
 
class  GrGeometryProcessor::Attribute
 
class  GrGeometryProcessor::AttributeSet
 
class  GrGeometryProcessor::ProgramImpl
 
struct  GrGeometryProcessor::ProgramImpl::FPCoords
 
struct  GrGeometryProcessor::ProgramImpl::EmitArgs
 
struct  GrGeometryProcessor::ProgramImpl::GrGPArgs
 
class  GrGeometryProcessor::TextureSampler
 

Functions

static constexpr size_t GrVertexAttribTypeSize (GrVertexAttribType type)
 

Function Documentation

◆ GrVertexAttribTypeSize()

static constexpr size_t GrVertexAttribTypeSize ( GrVertexAttribType  type)
inlinestaticconstexpr

Returns the size of the attrib type in bytes. This was moved from include/private/gpu/ganesh/GrTypesPriv.h in service of Skia dependents that build with C++11.

Definition at line 504 of file GrGeometryProcessor.h.

504 {
505 switch (type) {
507 return sizeof(float);
509 return 2 * sizeof(float);
511 return 3 * sizeof(float);
513 return 4 * sizeof(float);
515 return sizeof(uint16_t);
517 return 2 * sizeof(uint16_t);
519 return 4 * sizeof(uint16_t);
521 return 2 * sizeof(int32_t);
523 return 3 * sizeof(int32_t);
525 return 4 * sizeof(int32_t);
527 return 1 * sizeof(char);
529 return 2 * sizeof(char);
531 return 4 * sizeof(char);
533 return 1 * sizeof(char);
535 return 2 * sizeof(char);
537 return 4 * sizeof(char);
539 return 1 * sizeof(char);
541 return 4 * sizeof(char);
543 return 2 * sizeof(int16_t);
545 return 4 * sizeof(int16_t);
546 case kUShort2_GrVertexAttribType: // fall through
548 return 2 * sizeof(uint16_t);
550 return sizeof(int32_t);
552 return sizeof(uint32_t);
554 return sizeof(uint16_t);
556 return 4 * sizeof(uint16_t);
557 }
558 // GCC fails because SK_ABORT evaluates to non constexpr. clang and cl.exe think this is
559 // unreachable and don't complain.
560#if defined(__clang__) || !defined(__GNUC__)
561 SK_ABORT("Unsupported type conversion");
562#endif
563 return 0;
564}
@ 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
@ 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
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
GLenum type