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

Side by Side Diff: include/gpu/GrKey.h

Issue 23904003: Remove GrRefCnt.h in favor of SkRefCnt.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rm GrRefCnt.h Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrFontScaler.h ('k') | include/gpu/GrPathRendererChain.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10
11 #ifndef GrKey_DEFINED 8 #ifndef GrKey_DEFINED
12 #define GrKey_DEFINED 9 #define GrKey_DEFINED
13 10
14 #include "GrRefCnt.h" 11 class GrKey : public SkRefCnt {
15
16 class GrKey : public GrRefCnt {
17 public: 12 public:
18 SK_DECLARE_INST_COUNT(GrKey) 13 SK_DECLARE_INST_COUNT(GrKey)
19 14
20 typedef intptr_t Hash; 15 typedef intptr_t Hash;
21 16
22 explicit GrKey(Hash hash) : fHash(hash) {} 17 explicit GrKey(Hash hash) : fHash(hash) {}
23 18
24 intptr_t getHash() const { return fHash; } 19 intptr_t getHash() const { return fHash; }
25 20
26 bool operator<(const GrKey& rh) const { 21 bool operator<(const GrKey& rh) const {
27 return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh)); 22 return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh));
28 } 23 }
29 bool operator==(const GrKey& rh) const { 24 bool operator==(const GrKey& rh) const {
30 return fHash == rh.fHash && this->eq(rh); 25 return fHash == rh.fHash && this->eq(rh);
31 } 26 }
32 27
33 protected: 28 protected:
34 virtual bool lt(const GrKey& rh) const = 0; 29 virtual bool lt(const GrKey& rh) const = 0;
35 virtual bool eq(const GrKey& rh) const = 0; 30 virtual bool eq(const GrKey& rh) const = 0;
36 31
37 private: 32 private:
38 const Hash fHash; 33 const Hash fHash;
39 34
40 typedef GrRefCnt INHERITED; 35 typedef SkRefCnt INHERITED;
41 }; 36 };
42 37
43 #endif 38 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrFontScaler.h ('k') | include/gpu/GrPathRendererChain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698