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

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

Issue 1100073003: Extract gpu line dashing to GrDashLinePathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 8 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(GrContext* context);
24 virtual ~GrAADistanceFieldPathRenderer(); 24 virtual ~GrAADistanceFieldPathRenderer();
25 25
26 virtual bool canDrawPath(const GrDrawTarget*, 26 virtual bool canDrawPath(const GrDrawTarget*,
27 const GrPipelineBuilder*, 27 const GrPipelineBuilder*,
28 const SkMatrix& viewMatrix, 28 const SkMatrix& viewMatrix,
29 const SkPath&, 29 const SkPath&,
30 const SkStrokeRec&, 30 const GrStrokeInfo&,
31 bool antiAlias) const override; 31 bool antiAlias) const override;
32 32
33 protected: 33 protected:
34 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, 34 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
35 const GrPipelineBuilder*, 35 const GrPipelineBuilder*,
36 const SkPath&, 36 const SkPath&,
37 const SkStrokeRec&) const overrid e; 37 const GrStrokeInfo&) const overri de;
38 38
39 virtual bool onDrawPath(GrDrawTarget*, 39 virtual bool onDrawPath(GrDrawTarget*,
40 GrPipelineBuilder*, 40 GrPipelineBuilder*,
41 GrColor, 41 GrColor,
42 const SkMatrix& viewMatrix, 42 const SkMatrix& viewMatrix,
43 const SkPath&, 43 const SkPath&,
44 const SkStrokeRec&, 44 const GrStrokeInfo&,
45 bool antiAlias) override; 45 bool antiAlias) override;
46 46
47 private: 47 private:
48 struct PathData { 48 struct PathData {
49 struct Key { 49 struct Key {
50 uint32_t fGenID; 50 uint32_t fGenID;
51 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max) 51 // rendered size for stored path (32x32 max, 64x64 max, 128x128 max)
52 uint32_t fDimension; 52 uint32_t fDimension;
53 bool operator==(const Key& other) const { 53 bool operator==(const Key& other) const {
54 return other.fGenID == fGenID && other.fDimension == fDimension; 54 return other.fGenID == fGenID && other.fDimension == fDimension;
(...skipping 23 matching lines...) Expand all
78 GrBatchAtlas* fAtlas; 78 GrBatchAtlas* fAtlas;
79 SkTDynamicHash<PathData, PathData::Key> fPathCache; 79 SkTDynamicHash<PathData, PathData::Key> fPathCache;
80 PathDataList fPathList; 80 PathDataList fPathList;
81 81
82 typedef GrPathRenderer INHERITED; 82 typedef GrPathRenderer INHERITED;
83 83
84 friend class AADistanceFieldPathBatch; 84 friend class AADistanceFieldPathBatch;
85 }; 85 };
86 86
87 #endif 87 #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