 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
8 #ifndef SkVertices_DEFINED
9 #define SkVertices_DEFINED
31 kLast_VertexMode = kTriangleFan_VertexMode,
43 const uint16_t indices[]);
58 static constexpr
int kMaxCustomAttributes = 8;
72 enum class Type : uint8_t {
123 kHasTexCoords_BuilderFlag = 1 << 0,
124 kHasColors_BuilderFlag = 1 << 1,
137 bool isValid()
const {
return fVertices !=
nullptr; }
155 void init(
const Desc&);
161 std::unique_ptr<uint8_t[]> fIntermediateFanIndices;
164 friend class SkVerticesPriv;
175 const SkVerticesPriv
priv()
const;
180 friend class SkVerticesPriv;
184 void operator delete(
void* p);
186 Sizes getSizes()
const;
Attribute(Type t=Type::kFloat, Usage u=Usage::kRaw, const char *markerName=nullptr)
markerName is not copied by the Attribute, so it must outlive this struct.
const SkRect & bounds() const
Definition: SkVertices.h:168
const char * fMarkerName
Definition: SkVertices.h:119
BuilderFlags
Definition: SkVertices.h:122
bool isValid() const
Definition: SkVertices.h:137
Definition: SkRefCnt.h:159
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
Create a vertices by copying the specified arrays.
@ kTriangleStrip_VertexMode
Definition: SkVertices.h:28
VertexMode
Definition: SkVertices.h:26
SkData holds an immutable data buffer.
Definition: SkData.h:22
Builder(VertexMode mode, int vertexCount, int indexCount, const Attribute *attrs, int attrCount)
const SkVerticesPriv priv() const
sk_sp< SkVertices > detach()
An immutable set of vertex data that can be used with SkCanvas::drawVertices.
Definition: SkVertices.h:22
size_t approximateSize() const
Definition: SkPoint.h:160
@ kColor
hue and saturation of source with luminosity of destination
#define SK_API
Definition: SkTypes.h:181
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[])
Definition: SkVertices.h:45
EXPERIMENTAL - An SkVertices object can be constructed with a custom collection of vertex attributes.
Definition: SkVertices.h:71
bool operator==(const Attribute &that) const
Definition: SkVertices.h:104
Builder(VertexMode mode, int vertexCount, int indexCount, uint32_t flags)
size_t bytesPerVertex() const
Definition: SkVertices.h:126
Type
Definition: SkVertices.h:72
@ kTriangles_VertexMode
Definition: SkVertices.h:27
uint32_t fMarkerID
Definition: SkVertices.h:118
bool operator!=(const Attribute &that) const
Definition: SkVertices.h:107
uint32_t SkColor
32-bit ARGB color value, unpremultiplied.
Definition: SkColor.h:35
Type fType
Definition: SkVertices.h:116
uint32_t uniqueID() const
Definition: SkVertices.h:167
Usage fUsage
Definition: SkVertices.h:117
Usage
Definition: SkVertices.h:80
@ kTriangleFan_VertexMode
Definition: SkVertices.h:29