| 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 GrSoftwarePathRenderer_DEFINED | 9 #ifndef GrSoftwarePathRenderer_DEFINED |
| 10 #define GrSoftwarePathRenderer_DEFINED | 10 #define GrSoftwarePathRenderer_DEFINED |
| 11 | 11 |
| 12 #include "GrPathRenderer.h" | 12 #include "GrPathRenderer.h" |
| 13 | 13 |
| 14 class GrContext; | 14 class GrContext; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * This class uses the software side to render a path to an SkBitmap and | 17 * This class uses the software side to render a path to an SkBitmap and |
| 18 * then uploads the result to the gpu | 18 * then uploads the result to the gpu |
| 19 */ | 19 */ |
| 20 class GrSoftwarePathRenderer : public GrPathRenderer { | 20 class GrSoftwarePathRenderer : public GrPathRenderer { |
| 21 public: | 21 public: |
| 22 GrSoftwarePathRenderer(GrContext* context) | 22 GrSoftwarePathRenderer(GrContext* context) |
| 23 : fContext(context) { | 23 : fContext(context) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 virtual bool canDrawPath(const GrDrawTarget*, | 26 virtual bool canDrawPath(const GrDrawTarget*, |
| 27 const GrDrawState*, | 27 const GrDrawState*, |
| 28 const SkMatrix& viewMatrix, |
| 28 const SkPath&, | 29 const SkPath&, |
| 29 const SkStrokeRec&, | 30 const SkStrokeRec&, |
| 30 bool antiAlias) const SK_OVERRIDE; | 31 bool antiAlias) const SK_OVERRIDE; |
| 31 protected: | 32 protected: |
| 32 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 33 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
| 33 const GrDrawState*, | 34 const GrDrawState*, |
| 34 const SkPath&, | 35 const SkPath&, |
| 35 const SkStrokeRec&) const SK_OVER
RIDE; | 36 const SkStrokeRec&) const SK_OVER
RIDE; |
| 36 | 37 |
| 37 virtual bool onDrawPath(GrDrawTarget*, | 38 virtual bool onDrawPath(GrDrawTarget*, |
| 38 GrDrawState*, | 39 GrDrawState*, |
| 39 GrColor, | 40 GrColor, |
| 41 const SkMatrix& viewMatrix, |
| 40 const SkPath&, | 42 const SkPath&, |
| 41 const SkStrokeRec&, | 43 const SkStrokeRec&, |
| 42 bool antiAlias) SK_OVERRIDE; | 44 bool antiAlias) SK_OVERRIDE; |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 GrContext* fContext; | 47 GrContext* fContext; |
| 46 | 48 |
| 47 typedef GrPathRenderer INHERITED; | 49 typedef GrPathRenderer INHERITED; |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 #endif | 52 #endif |
| OLD | NEW |