GrCCClipProcessor.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifndef GrCCClipProcessor_DEFINED
  8. #define GrCCClipProcessor_DEFINED
  9. #include "src/gpu/GrFragmentProcessor.h"
  10. class GrCCClipPath;
  11. class GrCCClipProcessor : public GrFragmentProcessor {
  12. public:
  13. enum class IsCoverageCount : bool {
  14. kNo = false,
  15. kYes = true
  16. };
  17. enum class MustCheckBounds : bool {
  18. kNo = false,
  19. kYes = true
  20. };
  21. GrCCClipProcessor(const GrCCClipPath*, IsCoverageCount, MustCheckBounds);
  22. const char* name() const override { return "GrCCClipProcessor"; }
  23. std::unique_ptr<GrFragmentProcessor> clone() const override;
  24. void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
  25. bool onIsEqual(const GrFragmentProcessor&) const override;
  26. GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
  27. const TextureSampler& onTextureSampler(int) const override { return fAtlasAccess; }
  28. private:
  29. const GrCCClipPath* const fClipPath;
  30. const bool fIsCoverageCount;
  31. const bool fMustCheckBounds;
  32. const TextureSampler fAtlasAccess;
  33. class Impl;
  34. typedef GrFragmentProcessor INHERITED;
  35. };
  36. #endif