| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 GrAADistanceFieldPathRenderer_DEFINED | 9 #ifndef GrAADistanceFieldPathRenderer_DEFINED |
| 10 #define GrAADistanceFieldPathRenderer_DEFINED | 10 #define GrAADistanceFieldPathRenderer_DEFINED |
| 11 | 11 |
| 12 #include "GrAtlas.h" | 12 #include "GrAtlas.h" |
| 13 #include "GrPathRenderer.h" | 13 #include "GrPathRenderer.h" |
| 14 #include "GrRect.h" | 14 #include "GrRect.h" |
| 15 | 15 |
| 16 #include "SkChecksum.h" | 16 #include "SkChecksum.h" |
| 17 #include "SkTDynamicHash.h" | 17 #include "SkTDynamicHash.h" |
| 18 | 18 |
| 19 class GrContext; | 19 class GrContext; |
| 20 class GrPlot; | 20 class GrPlot; |
| 21 | 21 |
| 22 class GrAADistanceFieldPathRenderer : public GrPathRenderer { | 22 class GrAADistanceFieldPathRenderer : public GrPathRenderer { |
| 23 public: | 23 public: |
| 24 GrAADistanceFieldPathRenderer(GrContext* context); | 24 GrAADistanceFieldPathRenderer(GrContext* context); |
| 25 virtual ~GrAADistanceFieldPathRenderer(); | 25 virtual ~GrAADistanceFieldPathRenderer(); |
| 26 | 26 |
| 27 virtual bool canDrawPath(const GrDrawTarget*, | 27 virtual bool canDrawPath(const GrDrawTarget*, |
| 28 const GrDrawState*, | 28 const GrPipelineBuilder*, |
| 29 const SkMatrix& viewMatrix, | 29 const SkMatrix& viewMatrix, |
| 30 const SkPath&, | 30 const SkPath&, |
| 31 const SkStrokeRec&, | 31 const SkStrokeRec&, |
| 32 bool antiAlias) const SK_OVERRIDE; | 32 bool antiAlias) const SK_OVERRIDE; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 35 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
| 36 const GrDrawState*, | 36 const GrPipelineBuilder*, |
| 37 const SkPath&, | 37 const SkPath&, |
| 38 const SkStrokeRec&) const SK_OVER
RIDE; | 38 const SkStrokeRec&) const SK_OVER
RIDE; |
| 39 | 39 |
| 40 virtual bool onDrawPath(GrDrawTarget*, | 40 virtual bool onDrawPath(GrDrawTarget*, |
| 41 GrDrawState*, | 41 GrPipelineBuilder*, |
| 42 GrColor, | 42 GrColor, |
| 43 const SkMatrix& viewMatrix, | 43 const SkMatrix& viewMatrix, |
| 44 const SkPath&, | 44 const SkPath&, |
| 45 const SkStrokeRec&, | 45 const SkStrokeRec&, |
| 46 bool antiAlias) SK_OVERRIDE; | 46 bool antiAlias) SK_OVERRIDE; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 struct PathData { | 49 struct PathData { |
| 50 struct Key { | 50 struct Key { |
| 51 uint32_t fGenID; | 51 uint32_t fGenID; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 74 | 74 |
| 75 GrContext* fContext; | 75 GrContext* fContext; |
| 76 GrAtlas* fAtlas; | 76 GrAtlas* fAtlas; |
| 77 SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor; | 77 SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor; |
| 78 // current set of flags used to create the cached geometry processor | 78 // current set of flags used to create the cached geometry processor |
| 79 uint32_t fEffectFlags; | 79 uint32_t fEffectFlags; |
| 80 GrAtlas::ClientPlotUsage fPlotUsage; | 80 GrAtlas::ClientPlotUsage fPlotUsage; |
| 81 SkTDynamicHash<PathData, PathData::Key> fPathCache; | 81 SkTDynamicHash<PathData, PathData::Key> fPathCache; |
| 82 PathDataList fPathList; | 82 PathDataList fPathList; |
| 83 | 83 |
| 84 bool internalDrawPath(GrDrawTarget*, GrDrawState*, GrColor, const SkMatrix&
viewMatrix, | 84 bool internalDrawPath(GrDrawTarget*, GrPipelineBuilder*, GrColor, const SkMa
trix& viewMatrix, |
| 85 const SkPath& path, const PathData* pathData); | 85 const SkPath& path, const PathData* pathData); |
| 86 PathData* addPathToAtlas(const SkPath& path, const SkStrokeRec& stroke, bool
antiAlias, | 86 PathData* addPathToAtlas(const SkPath& path, const SkStrokeRec& stroke, bool
antiAlias, |
| 87 uint32_t dimension, SkScalar scale); | 87 uint32_t dimension, SkScalar scale); |
| 88 bool freeUnusedPlot(); | 88 bool freeUnusedPlot(); |
| 89 | 89 |
| 90 typedef GrPathRenderer INHERITED; | 90 typedef GrPathRenderer INHERITED; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |