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 GrTextureProvider; | 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(GrTextureProvider* texProvider) : fTexProvider(texPro
vider) { } | 21 GrSoftwarePathRenderer(GrTextureProvider* texProvider) : fTexProvider(texPro
vider) { } |
| 22 private: |
| 23 static void DrawNonAARect(GrDrawContext* drawContext, |
| 24 const GrPaint* paint, |
| 25 const GrUserStencilSettings* userStencilSettings, |
| 26 const GrClip& clip, |
| 27 GrColor color, |
| 28 const SkMatrix& viewMatrix, |
| 29 const SkRect& rect, |
| 30 const SkMatrix& localMatrix); |
| 31 static void DrawAroundInvPath(GrDrawContext* drawContext, |
| 32 const GrPaint* paint, |
| 33 const GrUserStencilSettings* userStencilSettin
gs, |
| 34 const GrClip& clip, |
| 35 GrColor color, |
| 36 const SkMatrix& viewMatrix, |
| 37 const SkIRect& devClipBounds, |
| 38 const SkIRect& devPathBounds); |
22 | 39 |
23 private: | |
24 StencilSupport onGetStencilSupport(const SkPath&) const override { | 40 StencilSupport onGetStencilSupport(const SkPath&) const override { |
25 return GrPathRenderer::kNoSupport_StencilSupport; | 41 return GrPathRenderer::kNoSupport_StencilSupport; |
26 } | 42 } |
27 | 43 |
28 bool onCanDrawPath(const CanDrawPathArgs&) const override; | 44 bool onCanDrawPath(const CanDrawPathArgs&) const override; |
29 | 45 |
30 bool onDrawPath(const DrawPathArgs&) override; | 46 bool onDrawPath(const DrawPathArgs&) override; |
31 | 47 |
32 private: | 48 private: |
33 GrTextureProvider* fTexProvider; | 49 GrTextureProvider* fTexProvider; |
34 | 50 |
35 typedef GrPathRenderer INHERITED; | 51 typedef GrPathRenderer INHERITED; |
36 }; | 52 }; |
37 | 53 |
38 #endif | 54 #endif |
OLD | NEW |