| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2012 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #ifndef GrSoftwarePathRenderer_DEFINED | 8 #ifndef GrTessellatingPathRenderer_DEFINED |
| 10 #define GrSoftwarePathRenderer_DEFINED | 9 #define GrTessellatingPathRenderer_DEFINED |
| 11 | 10 |
| 12 #include "GrPathRenderer.h" | 11 #include "GrPathRenderer.h" |
| 13 | 12 #include "SkTemplates.h" |
| 14 class GrContext; | |
| 15 | 13 |
| 16 /** | 14 /** |
| 17 * This class uses the software side to render a path to an SkBitmap and | 15 * Subclass that renders the path by converting to screen-space trapezoids plus |
| 18 * then uploads the result to the gpu | 16 * extra 1-pixel geometry for AA. |
| 19 */ | 17 */ |
| 20 class GrSoftwarePathRenderer : public GrPathRenderer { | 18 class SK_API GrTessellatingPathRenderer : public GrPathRenderer { |
| 21 public: | 19 public: |
| 22 GrSoftwarePathRenderer(GrContext* context) | 20 GrTessellatingPathRenderer(); |
| 23 : fContext(context) { | |
| 24 } | |
| 25 | 21 |
| 26 virtual bool canDrawPath(const GrDrawTarget*, | 22 virtual bool canDrawPath(const GrDrawTarget* target, |
| 27 const GrPipelineBuilder*, | 23 const GrPipelineBuilder*, |
| 28 const SkMatrix& viewMatrix, | 24 const SkMatrix& viewMatrix, |
| 29 const SkPath&, | 25 const SkPath& path, |
| 30 const SkStrokeRec&, | 26 const SkStrokeRec& rec, |
| 31 bool antiAlias) const SK_OVERRIDE; | 27 bool antiAlias) const; |
| 32 protected: | 28 |
| 29 static bool gWireframe; |
| 30 private: |
| 31 |
| 33 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 32 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
| 34 const GrPipelineBuilder*, | 33 const GrPipelineBuilder*, |
| 35 const SkPath&, | 34 const SkPath&, |
| 36 const SkStrokeRec&) const SK_OVER
RIDE; | 35 const SkStrokeRec&) const SK_OVER
RIDE; |
| 37 | 36 |
| 38 virtual bool onDrawPath(GrDrawTarget*, | 37 virtual bool onDrawPath(GrDrawTarget*, |
| 39 GrPipelineBuilder*, | 38 GrPipelineBuilder*, |
| 40 GrColor, | 39 GrColor, |
| 41 const SkMatrix& viewMatrix, | 40 const SkMatrix& viewMatrix, |
| 42 const SkPath&, | 41 const SkPath&, |
| 43 const SkStrokeRec&, | 42 const SkStrokeRec&, |
| 44 bool antiAlias) SK_OVERRIDE; | 43 bool antiAlias) SK_OVERRIDE; |
| 45 | 44 |
| 46 private: | |
| 47 GrContext* fContext; | |
| 48 | |
| 49 typedef GrPathRenderer INHERITED; | 45 typedef GrPathRenderer INHERITED; |
| 50 }; | 46 }; |
| 51 | 47 |
| 52 #endif | 48 #endif |
| OLD | NEW |