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

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

Issue 1265763002: Args structs to GrPathRenderer functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 4 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 "GrBatchAtlas.h" 12 #include "GrBatchAtlas.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 20
21 class GrAADistanceFieldPathRenderer : public GrPathRenderer { 21 class GrAADistanceFieldPathRenderer : public GrPathRenderer {
22 public: 22 public:
23 GrAADistanceFieldPathRenderer(GrContext* context); 23 GrAADistanceFieldPathRenderer();
24 virtual ~GrAADistanceFieldPathRenderer(); 24 virtual ~GrAADistanceFieldPathRenderer();
25
26 virtual bool canDrawPath(const GrDrawTarget*,
27 const GrPipelineBuilder*,
28 const SkMatrix& viewMatrix,
29 const SkPath&,
30 const GrStrokeInfo&,
31 bool antiAlias) const override;
32
33 protected:
34 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
35 const GrPipelineBuilder*,
36 const SkPath&,
37 const GrStrokeInfo&) const overri de;
38
39 virtual bool onDrawPath(GrDrawTarget*,
40 GrPipelineBuilder*,
41 GrColor,
42 const SkMatrix& viewMatrix,
43 const SkPath&,
44 const GrStrokeInfo&,
45 bool antiAlias) override;
46 25
47 private: 26 private:
27 StencilSupport onGetStencilSupport(const GrDrawTarget*,
28 const GrPipelineBuilder*,
29 const SkPath&,
30 const GrStrokeInfo&) const override;
31
32 bool onCanDrawPath(const CanDrawPathArgs&) const override;
33
34 bool onDrawPath(const DrawPathArgs&) override;
35
48 struct PathData { 36 struct PathData {
49 struct Key { 37 struct Key {
50 uint32_t fGenID; 38 uint32_t fGenID;
51 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max) 39 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max)
52 uint32_t fDimension; 40 uint32_t fDimension;
53 bool operator==(const Key& other) const { 41 bool operator==(const Key& other) const {
54 return other.fGenID == fGenID && other.fDimension == fDimension; 42 return other.fGenID == fGenID && other.fDimension == fDimension;
55 } 43 }
56 }; 44 };
57 Key fKey; 45 Key fKey;
(...skipping 10 matching lines...) Expand all
68 static inline uint32_t Hash(Key key) { 56 static inline uint32_t Hash(Key key) {
69 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&key), sizeof(key)); 57 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&key), sizeof(key));
70 } 58 }
71 }; 59 };
72 60
73 static void HandleEviction(GrBatchAtlas::AtlasID, void*); 61 static void HandleEviction(GrBatchAtlas::AtlasID, void*);
74 62
75 typedef SkTDynamicHash<PathData, PathData::Key> PathCache; 63 typedef SkTDynamicHash<PathData, PathData::Key> PathCache;
76 typedef SkTInternalLList<PathData> PathDataList; 64 typedef SkTInternalLList<PathData> PathDataList;
77 65
78 GrContext* fContext;
79 GrBatchAtlas* fAtlas; 66 GrBatchAtlas* fAtlas;
80 PathCache fPathCache; 67 PathCache fPathCache;
81 PathDataList fPathList; 68 PathDataList fPathList;
82 69
83 typedef GrPathRenderer INHERITED; 70 typedef GrPathRenderer INHERITED;
84 71
85 friend class AADistanceFieldPathBatch; 72 friend class AADistanceFieldPathBatch;
86 friend struct PathTestStruct; 73 friend struct PathTestStruct;
87 }; 74 };
88 75
89 #endif 76 #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