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 "src/gpu/GrFragmentProcessor.h" 12 13 class GrCCClipPath; 14 15 class GrCCClipProcessor : public GrFragmentProcessor { 16 public: 17 enum class MustCheckBounds : bool { 18 kNo = false, 19 kYes = true 20 }; 21 22 GrCCClipProcessor(std::unique_ptr<GrFragmentProcessor>, const GrCaps&, 23 sk_sp<const GrCCClipPath>, MustCheckBounds); 24 name()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 std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override; 30 31 private: 32 explicit GrCCClipProcessor(const GrCCClipProcessor&); 33 34 const sk_sp<const GrCCClipPath> fClipPath; 35 const bool fMustCheckBounds; 36 37 class Impl; 38 39 using INHERITED = GrFragmentProcessor; 40 }; 41 42 #endif 43