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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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
« no previous file with comments | « include/gpu/GrPaint.h ('k') | include/gpu/effects/GrConstColorProcessor.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 /* 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 GrProgramElement_DEFINED 8 #ifndef GrProgramElement_DEFINED
9 #define GrProgramElement_DEFINED 9 #define GrProgramElement_DEFINED
10 10
(...skipping 27 matching lines...) Expand all
38 SkASSERT(fRefCnt > 0); 38 SkASSERT(fRefCnt > 0);
39 ++fRefCnt; 39 ++fRefCnt;
40 this->validate(); 40 this->validate();
41 } 41 }
42 42
43 void unref() const { 43 void unref() const {
44 this->validate(); 44 this->validate();
45 --fRefCnt; 45 --fRefCnt;
46 if (0 == fRefCnt) { 46 if (0 == fRefCnt) {
47 if (0 == fPendingExecutions) { 47 if (0 == fPendingExecutions) {
48 SkDELETE(this); 48 delete this;
49 return; 49 return;
50 } else { 50 } else {
51 this->removeRefs(); 51 this->removeRefs();
52 } 52 }
53 } 53 }
54 this->validate(); 54 this->validate();
55 } 55 }
56 56
57 /** 57 /**
58 * Gets an id that is unique for this GrProgramElement object. This will nev er return 0. 58 * Gets an id that is unique for this GrProgramElement object. This will nev er return 0.
(...skipping 30 matching lines...) Expand all
89 } 89 }
90 ++fPendingExecutions; 90 ++fPendingExecutions;
91 this->validate(); 91 this->validate();
92 } 92 }
93 93
94 void completedExecution() const { 94 void completedExecution() const {
95 this->validate(); 95 this->validate();
96 --fPendingExecutions; 96 --fPendingExecutions;
97 if (0 == fPendingExecutions) { 97 if (0 == fPendingExecutions) {
98 if (0 == fRefCnt) { 98 if (0 == fRefCnt) {
99 SkDELETE(this); 99 delete this;
100 return; 100 return;
101 } else { 101 } else {
102 this->pendingIOComplete(); 102 this->pendingIOComplete();
103 } 103 }
104 } 104 }
105 this->validate(); 105 this->validate();
106 } 106 }
107 107
108 void removeRefs() const; 108 void removeRefs() const;
109 void addPendingIOs() const; 109 void addPendingIOs() const;
110 void pendingIOComplete() const; 110 void pendingIOComplete() const;
111 111
112 mutable int32_t fRefCnt; 112 mutable int32_t fRefCnt;
113 // Count of deferred executions not yet issued to the 3D API. 113 // Count of deferred executions not yet issued to the 3D API.
114 mutable int32_t fPendingExecutions; 114 mutable int32_t fPendingExecutions;
115 uint32_t fUniqueID; 115 uint32_t fUniqueID;
116 116
117 SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources; 117 SkSTArray<4, const GrGpuResourceRef*, true> fGpuResources;
118 118
119 // Only this class can access addPendingExecution() and completedExecution() . 119 // Only this class can access addPendingExecution() and completedExecution() .
120 template <typename T> friend class GrPendingProgramElement; 120 template <typename T> friend class GrPendingProgramElement;
121 121
122 typedef SkNoncopyable INHERITED; 122 typedef SkNoncopyable INHERITED;
123 }; 123 };
124 124
125 #endif 125 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | include/gpu/effects/GrConstColorProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698