GrStencilAndCoverPathRenderer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2012 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 GrBuiltInPathRenderer_DEFINED
  8. #define GrBuiltInPathRenderer_DEFINED
  9. #include "src/gpu/GrPathRenderer.h"
  10. class GrGpu;
  11. class GrResourceProvider;
  12. /**
  13. * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies
  14. * on the target having MSAA if AA is desired.
  15. */
  16. class GrStencilAndCoverPathRenderer : public GrPathRenderer {
  17. public:
  18. static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&);
  19. private:
  20. StencilSupport onGetStencilSupport(const GrShape&) const override {
  21. return GrPathRenderer::kStencilOnly_StencilSupport;
  22. }
  23. CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
  24. bool onDrawPath(const DrawPathArgs&) override;
  25. void onStencilPath(const StencilPathArgs&) override;
  26. GrStencilAndCoverPathRenderer(GrResourceProvider*);
  27. GrResourceProvider* fResourceProvider;
  28. typedef GrPathRenderer INHERITED;
  29. };
  30. #endif