1/*
2 * Copyright 2015 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 GrTriangulatingPathRenderer_DEFINED
9#define GrTriangulatingPathRenderer_DEFINED
10
11#include "src/gpu/GrPathRenderer.h"
12
13/**
14 * Subclass that renders the path by converting to screen-space trapezoids plus
15 * extra 1-pixel geometry for AA.
16 */
17class GrTriangulatingPathRenderer : public GrPathRenderer {
18public:
19 GrTriangulatingPathRenderer();
20#if GR_TEST_UTILS
21 void setMaxVerbCount(int maxVerbCount) { fMaxVerbCount = maxVerbCount; }
22#endif
23
24 const char* name() const final { return "Triangulating"; }
25
26private:
27 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
28
29 StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
30 return GrPathRenderer::kNoSupport_StencilSupport;
31 }
32
33 bool onDrawPath(const DrawPathArgs&) override;
34 int fMaxVerbCount;
35
36 typedef GrPathRenderer INHERITED;
37};
38
39#endif
40