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

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

Issue 940463006: Rename GrContentKey to GrUniqueKey (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 10 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/GrGpuResourcePriv.h ('k') | src/gpu/GrPath.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrPath_DEFINED 8 #ifndef GrPath_DEFINED
9 #define GrPath_DEFINED 9 #define GrPath_DEFINED
10 10
11 #include "GrGpuResource.h" 11 #include "GrGpuResource.h"
12 #include "SkPath.h" 12 #include "SkPath.h"
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkStrokeRec.h" 14 #include "SkStrokeRec.h"
15 15
16 class GrPath : public GrGpuResource { 16 class GrPath : public GrGpuResource {
17 public: 17 public:
18 SK_DECLARE_INST_COUNT(GrPath); 18 SK_DECLARE_INST_COUNT(GrPath);
19 19
20 /** 20 /**
21 * Initialize to a path with a fixed stroke. Stroke must not be hairline. 21 * Initialize to a path with a fixed stroke. Stroke must not be hairline.
22 */ 22 */
23 GrPath(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke) 23 GrPath(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke)
24 : INHERITED(gpu, kCached_LifeCycle), 24 : INHERITED(gpu, kCached_LifeCycle),
25 fSkPath(skPath), 25 fSkPath(skPath),
26 fStroke(stroke), 26 fStroke(stroke),
27 fBounds(skPath.getBounds()) { 27 fBounds(skPath.getBounds()) {
28 } 28 }
29 29
30 static void ComputeKey(const SkPath& path, const SkStrokeRec& stroke, GrCont entKey* key); 30 static void ComputeKey(const SkPath& path, const SkStrokeRec& stroke, GrUniq ueKey* key);
31 static uint64_t ComputeStrokeKey(const SkStrokeRec&); 31 static uint64_t ComputeStrokeKey(const SkStrokeRec&);
32 32
33 bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) { 33 bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) {
34 return fSkPath == path && fStroke == stroke; 34 return fSkPath == path && fStroke == stroke;
35 } 35 }
36 36
37 const SkRect& getBounds() const { return fBounds; } 37 const SkRect& getBounds() const { return fBounds; }
38 38
39 const SkStrokeRec& getStroke() const { return fStroke; } 39 const SkStrokeRec& getStroke() const { return fStroke; }
40 40
41 protected: 41 protected:
42 SkPath fSkPath; 42 SkPath fSkPath;
43 SkStrokeRec fStroke; 43 SkStrokeRec fStroke;
44 SkRect fBounds; 44 SkRect fBounds;
45 45
46 private: 46 private:
47 typedef GrGpuResource INHERITED; 47 typedef GrGpuResource INHERITED;
48 }; 48 };
49 49
50 #endif 50 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourcePriv.h ('k') | src/gpu/GrPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698