OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrBuiltInPathRenderer_DEFINED | 9 #ifndef GrBuiltInPathRenderer_DEFINED |
10 #define GrBuiltInPathRenderer_DEFINED | 10 #define GrBuiltInPathRenderer_DEFINED |
11 | 11 |
12 #include "GrPathRenderer.h" | 12 #include "GrPathRenderer.h" |
13 | 13 |
14 class GrContext; | 14 class GrContext; |
15 class GrGpu; | 15 class GrGpu; |
16 | 16 |
17 /** | 17 /** |
18 * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't
apply AA; it relies | 18 * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't
apply AA; it relies |
19 * on the target having MSAA if AA is desired. | 19 * on the target having MSAA if AA is desired. |
20 */ | 20 */ |
21 class GrStencilAndCoverPathRenderer : public GrPathRenderer { | 21 class GrStencilAndCoverPathRenderer : public GrPathRenderer { |
22 public: | 22 public: |
23 | 23 |
24 static GrPathRenderer* Create(GrContext*); | 24 static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&); |
25 | 25 |
26 virtual ~GrStencilAndCoverPathRenderer(); | 26 bool canDrawPath(const GrDrawTarget*, |
27 | 27 const GrPipelineBuilder*, |
28 virtual bool canDrawPath(const GrDrawTarget*, | 28 const SkMatrix& viewMatrix, |
29 const GrPipelineBuilder*, | 29 const SkPath&, |
30 const SkMatrix& viewMatrix, | 30 const GrStrokeInfo&, |
31 const SkPath&, | 31 bool antiAlias) const override; |
32 const GrStrokeInfo&, | |
33 bool antiAlias) const override; | |
34 | 32 |
35 protected: | 33 protected: |
36 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 34 StencilSupport onGetStencilSupport(const GrDrawTarget*, |
37 const GrPipelineBuilder*, | 35 const GrPipelineBuilder*, |
38 const SkPath&, | 36 const SkPath&, |
39 const GrStrokeInfo&) const overri
de; | 37 const GrStrokeInfo&) const override; |
40 | 38 |
41 virtual bool onDrawPath(GrDrawTarget*, | 39 bool onDrawPath(GrDrawTarget*, |
42 GrPipelineBuilder*, | 40 GrPipelineBuilder*, |
43 GrColor, | 41 GrColor, |
44 const SkMatrix& viewMatrix, | 42 const SkMatrix& viewMatrix, |
45 const SkPath&, | 43 const SkPath&, |
46 const GrStrokeInfo&, | 44 const GrStrokeInfo&, |
47 bool antiAlias) override; | 45 bool antiAlias) override; |
48 | 46 |
49 virtual void onStencilPath(GrDrawTarget*, | 47 void onStencilPath(GrDrawTarget*, |
50 GrPipelineBuilder*, | 48 GrPipelineBuilder*, |
51 const SkMatrix& viewMatrix, | 49 const SkMatrix& viewMatrix, |
52 const SkPath&, | 50 const SkPath&, |
53 const GrStrokeInfo&) override; | 51 const GrStrokeInfo&) override; |
54 | 52 |
55 private: | 53 private: |
56 GrStencilAndCoverPathRenderer(GrGpu*); | 54 GrStencilAndCoverPathRenderer(GrResourceProvider*); |
57 | 55 |
58 GrGpu* fGpu; | 56 GrResourceProvider* fResourceProvider; |
59 | 57 |
60 typedef GrPathRenderer INHERITED; | 58 typedef GrPathRenderer INHERITED; |
61 }; | 59 }; |
62 | 60 |
63 #endif | 61 #endif |
OLD | NEW |