1/*
2 * Copyright 2017 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 GrCCClipProcessor_DEFINED
9#define GrCCClipProcessor_DEFINED
10
11#include "GrFragmentProcessor.h"
12#include "ccpr/GrCoverageCountingPathRenderer.h"
13
14class GrCCClipProcessor : public GrFragmentProcessor {
15public:
16    using ClipPath = GrCoverageCountingPathRenderer::ClipPath;
17
18    enum class MustCheckBounds : bool {
19        kNo = false,
20        kYes = true
21    };
22
23    GrCCClipProcessor(const ClipPath*, MustCheckBounds, SkPath::FillType overrideFillType);
24
25    const char* name() const override { return "GrCCClipProcessor"; }
26    std::unique_ptr<GrFragmentProcessor> clone() const override;
27    void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
28    bool onIsEqual(const GrFragmentProcessor&) const override;
29    GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
30
31private:
32    const ClipPath* const fClipPath;
33    const bool fMustCheckBounds;
34    const SkPath::FillType fOverrideFillType;
35    const TextureSampler fAtlasAccess;
36
37    class Impl;
38
39    typedef GrFragmentProcessor INHERITED;
40};
41
42#endif
43