1/*
2 * Copyright 2019 Google LLC.
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 GrSampleMaskProcessor_DEFINED
9#define GrSampleMaskProcessor_DEFINED
10
11#include "src/gpu/ccpr/GrCCCoverageProcessor.h"
12
13/**
14 * This class implements GrCCCoverageProcessor with MSAA using the sample mask.
15 */
16class GrSampleMaskProcessor : public GrCCCoverageProcessor {
17public:
18 GrSampleMaskProcessor() : GrCCCoverageProcessor(kGrSampleMaskProcessor_ClassID) {}
19
20private:
21 GrPrimitiveType primType() const final;
22 int numSubpasses() const override { return 1; }
23 void reset(PrimitiveType, int subpassIdx, GrResourceProvider*) override;
24 void bindBuffers(GrOpsRenderPass*, const GrBuffer* instanceBuffer) const override;
25 void drawInstances(GrOpsRenderPass*, int instanceCount, int baseInstance) const override;
26
27 GrGLSLPrimitiveProcessor* onCreateGLSLInstance(std::unique_ptr<Shader>) const override;
28
29 SkSTArray<2, Attribute> fInputAttribs;
30
31 class Impl;
32};
33
34#endif
35