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

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

Issue 638003003: Remove ~GrIORef since last remaining virtual and now all inline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | src/gpu/GrGpuResource.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 2014 Google Inc. 2 * Copyright 2014 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 GrGpuResource_DEFINED 8 #ifndef GrGpuResource_DEFINED
9 #define GrGpuResource_DEFINED 9 #define GrGpuResource_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 * 34 *
35 * The latter two ref types are private and intended only for Gr core code. 35 * The latter two ref types are private and intended only for Gr core code.
36 * 36 *
37 * When an item is purgable DERIVED:notifyIsPurgable() will be called (static po ly morphism using 37 * When an item is purgable DERIVED:notifyIsPurgable() will be called (static po ly morphism using
38 * CRTP). GrIORef and GrGpuResource are separate classes for organizational reas ons and to be 38 * CRTP). GrIORef and GrGpuResource are separate classes for organizational reas ons and to be
39 * able to give access via friendship to only the functions related to pending I O operations. 39 * able to give access via friendship to only the functions related to pending I O operations.
40 */ 40 */
41 template <typename DERIVED> class GrIORef : public SkNoncopyable { 41 template <typename DERIVED> class GrIORef : public SkNoncopyable {
42 public: 42 public:
43 SK_DECLARE_INST_COUNT_ROOT(GrIORef) 43 SK_DECLARE_INST_COUNT_ROOT(GrIORef)
44 virtual ~GrIORef(); 44
45 virtual ~GrIORef() {
mtklein 2014/10/08 17:57:14 Drop this virtual? Seems like you don't have any
bsalomon 2014/10/08 18:01:53 Good point, will remove the virtual
46 SkASSERT(0 == fRefCnt);
47 SkASSERT(0 == fPendingReads);
48 SkASSERT(0 == fPendingWrites);
49 // Set to invalid values.
50 SkDEBUGCODE(fRefCnt = fPendingReads = fPendingWrites = -10;)
51 }
45 52
46 // Some of the signatures are written to mirror SkRefCnt so that GrGpuResour ce can work with 53 // Some of the signatures are written to mirror SkRefCnt so that GrGpuResour ce can work with
47 // templated helper classes (e.g. SkAutoTUnref). However, we have different categories of 54 // templated helper classes (e.g. SkAutoTUnref). However, we have different categories of
48 // refs (e.g. pending reads). We also don't require thread safety as GrCache able objects are 55 // refs (e.g. pending reads). We also don't require thread safety as GrCache able objects are
49 // not intended to cross thread boundaries. 56 // not intended to cross thread boundaries.
50 void ref() const { 57 void ref() const {
51 this->validate(); 58 this->validate();
52 ++fRefCnt; 59 ++fRefCnt;
53 } 60 }
54 61
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache 267 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
261 const uint32_t fUniqueID; 268 const uint32_t fUniqueID;
262 269
263 GrResourceKey fScratchKey; 270 GrResourceKey fScratchKey;
264 271
265 typedef GrIORef<GrGpuResource> INHERITED; 272 typedef GrIORef<GrGpuResource> INHERITED;
266 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable. 273 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable.
267 }; 274 };
268 275
269 #endif 276 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698