1
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef GrSoftwarePathRenderer_DEFINED
10#define GrSoftwarePathRenderer_DEFINED
11
12#include "GrPathRenderer.h"
13
14class GrContext;
15
16/**
17 * This class uses the software side to render a path to an SkBitmap and
18 * then uploads the result to the gpu
19 */
20class GrSoftwarePathRenderer : public GrPathRenderer {
21public:
22    GrSoftwarePathRenderer(GrContext* context)
23        : fContext(context) {
24    }
25
26    virtual bool canDrawPath(const GrDrawTarget*,
27                             const GrPipelineBuilder*,
28                             const SkMatrix& viewMatrix,
29                             const SkPath&,
30                             const GrStrokeInfo&,
31                             bool antiAlias) const override;
32protected:
33    virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
34                                               const GrPipelineBuilder*,
35                                               const SkPath&,
36                                               const GrStrokeInfo&) const override;
37
38    virtual bool onDrawPath(GrDrawTarget*,
39                            GrPipelineBuilder*,
40                            GrColor,
41                            const SkMatrix& viewMatrix,
42                            const SkPath&,
43                            const GrStrokeInfo&,
44                            bool antiAlias) override;
45
46private:
47    GrContext*     fContext;
48
49    typedef GrPathRenderer INHERITED;
50};
51
52#endif
53