OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrSoftwarePathRenderer_DEFINED | 8 #ifndef GrSoftwarePathRenderer_DEFINED |
9 #define GrSoftwarePathRenderer_DEFINED | 9 #define GrSoftwarePathRenderer_DEFINED |
10 | 10 |
11 #include "GrPathRenderer.h" | 11 #include "GrPathRenderer.h" |
12 | 12 |
13 class GrContext; | 13 class GrTextureProvider; |
14 | 14 |
15 /** | 15 /** |
16 * This class uses the software side to render a path to an SkBitmap and | 16 * This class uses the software side to render a path to an SkBitmap and |
17 * then uploads the result to the gpu | 17 * then uploads the result to the gpu |
18 */ | 18 */ |
19 class GrSoftwarePathRenderer : public GrPathRenderer { | 19 class GrSoftwarePathRenderer : public GrPathRenderer { |
20 public: | 20 public: |
21 GrSoftwarePathRenderer(GrContext* context) | 21 GrSoftwarePathRenderer(GrTextureProvider* texProvider) : fTexProvider(texPro
vider) { } |
22 : fContext(context) { | 22 |
23 } | |
24 private: | 23 private: |
25 StencilSupport onGetStencilSupport(const SkPath&) const override { | 24 StencilSupport onGetStencilSupport(const SkPath&) const override { |
26 return GrPathRenderer::kNoSupport_StencilSupport; | 25 return GrPathRenderer::kNoSupport_StencilSupport; |
27 } | 26 } |
28 | 27 |
29 bool onCanDrawPath(const CanDrawPathArgs&) const override; | 28 bool onCanDrawPath(const CanDrawPathArgs&) const override; |
30 | 29 |
31 bool onDrawPath(const DrawPathArgs&) override; | 30 bool onDrawPath(const DrawPathArgs&) override; |
32 | 31 |
33 private: | 32 private: |
34 GrContext* fContext; | 33 GrTextureProvider* fTexProvider; |
35 | 34 |
36 typedef GrPathRenderer INHERITED; | 35 typedef GrPathRenderer INHERITED; |
37 }; | 36 }; |
38 | 37 |
39 #endif | 38 #endif |
OLD | NEW |