blob: 8c670e171d73279c4d2479d750e7e11e916abc51 [file] [log] [blame]
Chris Daltona32a3c32017-12-05 10:05:21 -07001/*
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
Chris Dalton383a2ef2018-01-08 17:21:41 -05008#ifndef GrCCClipProcessor_DEFINED
9#define GrCCClipProcessor_DEFINED
Chris Daltona32a3c32017-12-05 10:05:21 -070010
11#include "GrFragmentProcessor.h"
Chris Dalton5ba36ba2018-05-09 01:08:38 -060012
13class GrCCClipPath;
Chris Daltona32a3c32017-12-05 10:05:21 -070014
Chris Dalton383a2ef2018-01-08 17:21:41 -050015class GrCCClipProcessor : public GrFragmentProcessor {
Chris Daltona32a3c32017-12-05 10:05:21 -070016public:
Chris Daltona32a3c32017-12-05 10:05:21 -070017 enum class MustCheckBounds : bool {
18 kNo = false,
19 kYes = true
20 };
21
Chris Dalton5ba36ba2018-05-09 01:08:38 -060022 GrCCClipProcessor(const GrCCClipPath*, MustCheckBounds, SkPath::FillType overrideFillType);
Chris Daltona32a3c32017-12-05 10:05:21 -070023
Chris Dalton383a2ef2018-01-08 17:21:41 -050024 const char* name() const override { return "GrCCClipProcessor"; }
Chris Daltona32a3c32017-12-05 10:05:21 -070025 std::unique_ptr<GrFragmentProcessor> clone() const override;
26 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
27 bool onIsEqual(const GrFragmentProcessor&) const override;
28 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
29
30private:
Chris Dalton5ba36ba2018-05-09 01:08:38 -060031 const GrCCClipPath* const fClipPath;
Chris Daltona32a3c32017-12-05 10:05:21 -070032 const bool fMustCheckBounds;
33 const SkPath::FillType fOverrideFillType;
34 const TextureSampler fAtlasAccess;
35
36 class Impl;
37
38 typedef GrFragmentProcessor INHERITED;
39};
40
41#endif