Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "src/gpu/ccpr/GrCCCoverageProcessor.h" |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 12 | |
| 13 | /** |
| 14 | * This class implements GrCCCoverageProcessor with analytic coverage using vertex shaders. |
| 15 | */ |
| 16 | class GrVSCoverageProcessor : public GrCCCoverageProcessor { |
| 17 | public: |
| 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 | |
Robert Phillips | cea290f | 2019-11-06 11:21:03 -0500 | [diff] [blame] | 26 | GrPrimitiveType primType() const final { return fTriangleType; } |
| 27 | |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 28 | GrGLSLPrimitiveProcessor* onCreateGLSLInstance(std::unique_ptr<Shader>) const override; |
| 29 | |
| 30 | Attribute fPerVertexData; |
| 31 | Attribute fInputXAndYValues[2]; |
| 32 | sk_sp<const GrGpuBuffer> fVertexBuffer; |
| 33 | sk_sp<const GrGpuBuffer> fIndexBuffer; |
| 34 | int fNumIndicesPerInstance; |
Robert Phillips | cea290f | 2019-11-06 11:21:03 -0500 | [diff] [blame] | 35 | GrPrimitiveType fTriangleType = GrPrimitiveType::kPoints; |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 36 | |
| 37 | class Impl; |
| 38 | }; |
| 39 | |
| 40 | #endif |