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

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

Issue 543833002: Add method to GrProgramResource to record that pending a execution was completed. (Closed) Base URL: https://skia.googlesource.com/skia.git@progelem
Patch Set: rebase Created 6 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/GrGpuResource.h ('k') | include/gpu/GrProgramResource.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 is and will remain owned by the subclass and this function will retain a raw ptr. Once a 64 is and will remain owned by the subclass and this function will retain a raw ptr. Once a
65 GrProgramResource is registered its setResource must not be called. 65 GrProgramResource is registered its setResource must not be called.
66 */ 66 */
67 void addProgramResource(const GrProgramResource* res) { 67 void addProgramResource(const GrProgramResource* res) {
68 fProgramResources.push_back(res); 68 fProgramResources.push_back(res);
69 } 69 }
70 70
71 private: 71 private:
72 void convertRefToPendingExecution() const; 72 void convertRefToPendingExecution() const;
73 73
74 void completedExecution() const { 74 void completedExecution() const;
75 this->validate();
76 --fPendingExecutions;
77 if (0 == fRefCnt && 0 == fPendingExecutions) {
78 SkDELETE(this);
79 }
80 }
81 75
82 mutable int32_t fRefCnt; 76 mutable int32_t fRefCnt;
83 // Count of deferred executions not yet issued to the 3D API. 77 // Count of deferred executions not yet issued to the 3D API.
84 mutable int32_t fPendingExecutions; 78 mutable int32_t fPendingExecutions;
85 79
86 SkSTArray<4, const GrProgramResource*, true> fProgramResources; 80 SkSTArray<4, const GrProgramResource*, true> fProgramResources;
87 81
88 // Only this class can access convertRefToPendingExecution() and completedEx ecution(). 82 // Only this class can access convertRefToPendingExecution() and completedEx ecution().
89 template <typename T> friend class GrProgramElementRef; 83 template <typename T> friend class GrProgramElementRef;
90 84
91 typedef SkNoncopyable INHERITED; 85 typedef SkNoncopyable INHERITED;
92 }; 86 };
93 87
94 #endif 88 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | include/gpu/GrProgramResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698