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

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

Issue 1460873002: Add stroking support to distance field path renderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use original path's generation ID as key Created 5 years, 1 month 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
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
(...skipping 15 matching lines...) Expand all
26 private: 26 private:
27 StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override { 27 StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override {
28 return GrPathRenderer::kNoSupport_StencilSupport; 28 return GrPathRenderer::kNoSupport_StencilSupport;
29 } 29 }
30 30
31 bool onCanDrawPath(const CanDrawPathArgs&) const override; 31 bool onCanDrawPath(const CanDrawPathArgs&) const override;
32 32
33 bool onDrawPath(const DrawPathArgs&) override; 33 bool onDrawPath(const DrawPathArgs&) override;
34 34
35 struct PathData { 35 struct PathData {
36 struct Key { 36 class Key {
37 public:
robertphillips 2015/11/19 19:03:28 Why do we need the default ctor ?
jvanverth1 2015/11/19 20:33:23 Added a comment. It's needed when allocating PathD
38 Key() : fStroke(SkStrokeRec::kFill_InitStyle) {}
39 Key(uint32_t genID, uint32_t dim, const SkStrokeRec& stroke)
40 : fGenID(genID)
41 , fDimension(dim)
42 , fStroke(stroke) {
43 }
44
45 bool operator==(const Key& other) const {
46 return other.fGenID == fGenID && other.fDimension == fDimension & &
robertphillips 2015/11/19 19:03:28 tab this over ?
jvanverth1 2015/11/19 20:33:23 Done.
47 fStroke.hasEqualEffect(other.fStroke);
48 }
49
50 private:
37 uint32_t fGenID; 51 uint32_t fGenID;
38 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max) 52 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max)
39 uint32_t fDimension; 53 uint32_t fDimension;
40 bool operator==(const Key& other) const { 54 // stroking information
41 return other.fGenID == fGenID && other.fDimension == fDimension; 55 SkStrokeRec fStroke;
robertphillips 2015/11/19 19:03:28 extra \n ?
jvanverth1 2015/11/19 20:33:23 Done.
42 } 56
43 }; 57 };
44 Key fKey; 58 Key fKey;
45 SkScalar fScale; 59 SkScalar fScale;
46 GrBatchAtlas::AtlasID fID; 60 GrBatchAtlas::AtlasID fID;
47 SkRect fBounds; 61 SkRect fBounds;
48 SkIPoint16 fAtlasLocation; 62 SkIPoint16 fAtlasLocation;
49 SK_DECLARE_INTERNAL_LLIST_INTERFACE(PathData); 63 SK_DECLARE_INTERNAL_LLIST_INTERFACE(PathData);
50 64
51 static inline const Key& GetKey(const PathData& data) { 65 static inline const Key& GetKey(const PathData& data) {
52 return data.fKey; 66 return data.fKey;
(...skipping 13 matching lines...) Expand all
66 PathCache fPathCache; 80 PathCache fPathCache;
67 PathDataList fPathList; 81 PathDataList fPathList;
68 82
69 typedef GrPathRenderer INHERITED; 83 typedef GrPathRenderer INHERITED;
70 84
71 friend class AADistanceFieldPathBatch; 85 friend class AADistanceFieldPathBatch;
72 friend struct PathTestStruct; 86 friend struct PathTestStruct;
73 }; 87 };
74 88
75 #endif 89 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698