GrVSCoverageProcessor.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef GrVSCoverageProcessor_DEFINED
  8. #define GrVSCoverageProcessor_DEFINED
  9. #include "src/gpu/ccpr/GrCCCoverageProcessor.h"
  10. /**
  11. * This class implements GrCCCoverageProcessor with analytic coverage using vertex shaders.
  12. */
  13. class GrVSCoverageProcessor : public GrCCCoverageProcessor {
  14. public:
  15. GrVSCoverageProcessor() : GrCCCoverageProcessor(kGrVSCoverageProcessor_ClassID) {}
  16. private:
  17. void reset(PrimitiveType, GrResourceProvider*) override;
  18. void appendMesh(sk_sp<const GrGpuBuffer> instanceBuffer, int instanceCount, int baseInstance,
  19. SkTArray<GrMesh>* out) const override;
  20. GrGLSLPrimitiveProcessor* onCreateGLSLInstance(std::unique_ptr<Shader>) const override;
  21. Attribute fPerVertexData;
  22. Attribute fInputXAndYValues[2];
  23. sk_sp<const GrGpuBuffer> fVertexBuffer;
  24. sk_sp<const GrGpuBuffer> fIndexBuffer;
  25. int fNumIndicesPerInstance;
  26. GrPrimitiveType fTriangleType;
  27. class Impl;
  28. };
  29. #endif