1 /* 2 * Copyright 2019 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrVSCoverageProcessor_DEFINED 9 #define GrVSCoverageProcessor_DEFINED 10 11 #include "src/gpu/ccpr/GrCCCoverageProcessor.h" 12 13 /** 14 * This class implements GrCCCoverageProcessor with analytic coverage using vertex shaders. 15 */ 16 class GrVSCoverageProcessor : public GrCCCoverageProcessor { 17 public: GrVSCoverageProcessor()18 GrVSCoverageProcessor() : GrCCCoverageProcessor(kGrVSCoverageProcessor_ClassID) {} 19 20 private: 21 void reset(PrimitiveType, GrResourceProvider*) override; 22 23 void appendMesh(sk_sp<const GrGpuBuffer> instanceBuffer, int instanceCount, int baseInstance, 24 SkTArray<GrMesh>* out) const override; 25 26 GrGLSLPrimitiveProcessor* onCreateGLSLInstance(std::unique_ptr<Shader>) const override; 27 28 Attribute fPerVertexData; 29 Attribute fInputXAndYValues[2]; 30 sk_sp<const GrGpuBuffer> fVertexBuffer; 31 sk_sp<const GrGpuBuffer> fIndexBuffer; 32 int fNumIndicesPerInstance; 33 GrPrimitiveType fTriangleType; 34 35 class Impl; 36 }; 37 38 #endif 39