Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/gpu/GrAADistanceFieldPathRenderer.h

Issue 815553003: Move ViewMatrix off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-fragment-stage
Patch Set: more cleaning Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GrDrawState*,
29 const SkMatrix& viewMatrix,
29 const SkPath&, 30 const SkPath&,
30 const SkStrokeRec&, 31 const SkStrokeRec&,
31 bool antiAlias) const SK_OVERRIDE; 32 bool antiAlias) const SK_OVERRIDE;
32 33
33 protected: 34 protected:
34 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, 35 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
35 const GrDrawState*, 36 const GrDrawState*,
36 const SkPath&, 37 const SkPath&,
37 const SkStrokeRec&) const SK_OVER RIDE; 38 const SkStrokeRec&) const SK_OVER RIDE;
38 39
39 virtual bool onDrawPath(GrDrawTarget*, 40 virtual bool onDrawPath(GrDrawTarget*,
40 GrDrawState*, 41 GrDrawState*,
41 GrColor, 42 GrColor,
43 const SkMatrix& viewMatrix,
42 const SkPath&, 44 const SkPath&,
43 const SkStrokeRec&, 45 const SkStrokeRec&,
44 bool antiAlias) SK_OVERRIDE; 46 bool antiAlias) SK_OVERRIDE;
45 47
46 private: 48 private:
47 struct PathData { 49 struct PathData {
48 struct Key { 50 struct Key {
49 uint32_t fGenID; 51 uint32_t fGenID;
50 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max) 52 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max)
51 uint32_t fDimension; 53 uint32_t fDimension;
(...skipping 20 matching lines...) Expand all
72 74
73 GrContext* fContext; 75 GrContext* fContext;
74 GrAtlas* fAtlas; 76 GrAtlas* fAtlas;
75 SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor; 77 SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor;
76 // current set of flags used to create the cached geometry processor 78 // current set of flags used to create the cached geometry processor
77 uint32_t fEffectFlags; 79 uint32_t fEffectFlags;
78 GrAtlas::ClientPlotUsage fPlotUsage; 80 GrAtlas::ClientPlotUsage fPlotUsage;
79 SkTDynamicHash<PathData, PathData::Key> fPathCache; 81 SkTDynamicHash<PathData, PathData::Key> fPathCache;
80 PathDataList fPathList; 82 PathDataList fPathList;
81 83
82 bool internalDrawPath(GrDrawTarget*, GrDrawState*, GrColor, const SkPath& pa th, 84 bool internalDrawPath(GrDrawTarget*, GrDrawState*, GrColor, const SkMatrix& viewMatrix,
83 const PathData* pathData); 85 const SkPath& path, const PathData* pathData);
84 PathData* addPathToAtlas(const SkPath& path, const SkStrokeRec& stroke, bool antiAlias, 86 PathData* addPathToAtlas(const SkPath& path, const SkStrokeRec& stroke, bool antiAlias,
85 uint32_t dimension, SkScalar scale); 87 uint32_t dimension, SkScalar scale);
86 bool freeUnusedPlot(); 88 bool freeUnusedPlot();
87 89
88 typedef GrPathRenderer INHERITED; 90 typedef GrPathRenderer INHERITED;
89 }; 91 };
90 92
91 #endif 93 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698