diff options
Diffstat (limited to 'src/gpu/ops/GrDrawVerticesOp.h')
-rw-r--r-- | src/gpu/ops/GrDrawVerticesOp.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gpu/ops/GrDrawVerticesOp.h b/src/gpu/ops/GrDrawVerticesOp.h index 3a6eca0a0d..d15e620ff5 100644 --- a/src/gpu/ops/GrDrawVerticesOp.h +++ b/src/gpu/ops/GrDrawVerticesOp.h @@ -38,13 +38,16 @@ public: static std::unique_ptr<GrDrawOp> Make(GrContext* context, GrPaint&&, sk_sp<SkVertices>, + const SkMatrix bones[], + int boneCount, const SkMatrix& viewMatrix, GrAAType, sk_sp<GrColorSpaceXform>, GrPrimitiveType* overridePrimType = nullptr); - GrDrawVerticesOp(const Helper::MakeArgs&, GrColor, sk_sp<SkVertices>, GrPrimitiveType, GrAAType, - sk_sp<GrColorSpaceXform>, const SkMatrix& viewMatrix); + GrDrawVerticesOp(const Helper::MakeArgs&, GrColor, sk_sp<SkVertices>, const SkMatrix bones[], + int boneCount, GrPrimitiveType, GrAAType, sk_sp<GrColorSpaceXform>, + const SkMatrix& viewMatrix); const char* name() const override { return "DrawVerticesOp"; } @@ -72,6 +75,7 @@ private: void fillBuffers(bool hasColorAttribute, bool hasLocalCoordsAttribute, + bool hasBoneAttribute, size_t vertexStride, void* verts, uint16_t* indices) const; @@ -84,7 +88,8 @@ private: int firstIndex); sk_sp<GrGeometryProcessor> makeGP(bool* hasColorAttribute, - bool* hasLocalCoordAttribute) const; + bool* hasLocalCoordAttribute, + bool* hasBoneAttribute) const; GrPrimitiveType primitiveType() const { return fPrimitiveType; } bool combinablePrimitive() const { @@ -98,9 +103,11 @@ private: struct Mesh { GrColor fColor; // Used if this->hasPerVertexColors() is false. sk_sp<SkVertices> fVertices; + std::vector<float> fBones; // Transformation matrices stored in GPU format. SkMatrix fViewMatrix; bool fIgnoreTexCoords; bool fIgnoreColors; + bool fIgnoreBones; bool hasExplicitLocalCoords() const { return fVertices->hasTexCoords() && !fIgnoreTexCoords; @@ -109,6 +116,10 @@ private: bool hasPerVertexColors() const { return fVertices->hasColors() && !fIgnoreColors; } + + bool hasBones() const { + return fVertices->hasBones() && fBones.size() && !fIgnoreBones; + } }; bool isIndexed() const { @@ -128,10 +139,15 @@ private: return SkToBool(kHasMultipleViewMatrices_Flag & fFlags); } + bool hasBones() const { + return SkToBool(kHasBones_Flag & fFlags); + } + enum Flags { kRequiresPerVertexColors_Flag = 0x1, kAnyMeshHasExplicitLocalCoords_Flag = 0x2, kHasMultipleViewMatrices_Flag = 0x4, + kHasBones_Flag = 0x8, }; Helper fHelper; |