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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
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/GrPaint.h ('k') | include/gpu/GrRenderTarget.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 GrProgramElementRef_DEFINED 8 #ifndef GrProgramElementRef_DEFINED
9 #define GrProgramElementRef_DEFINED 9 #define GrProgramElementRef_DEFINED
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 /** 48 /**
49 * GrProgramElementRef assumes ownership of the ref and manages converting t he ref to a 49 * GrProgramElementRef assumes ownership of the ref and manages converting t he ref to a
50 * pending execution. As a result, it is an error for the user to ref or unr ef through 50 * pending execution. As a result, it is an error for the user to ref or unr ef through
51 * GrProgramElementRef. Therefore operator-> returns BlockRef<T>*. 51 * GrProgramElementRef. Therefore operator-> returns BlockRef<T>*.
52 */ 52 */
53 BlockRefType *operator->() const { 53 BlockRefType *operator->() const {
54 return static_cast<BlockRefType*>(fObj); 54 return static_cast<BlockRefType*>(fObj);
55 } 55 }
56 56
57 ~GrProgramElementRef() { 57 ~GrProgramElementRef() {
58 if (NULL != fObj) { 58 if (fObj) {
59 if (fOwnPendingExec) { 59 if (fOwnPendingExec) {
60 fObj->completedExecution(); 60 fObj->completedExecution();
61 } else { 61 } else {
62 fObj->unref(); 62 fObj->unref();
63 } 63 }
64 } 64 }
65 } 65 }
66 66
67 private: 67 private:
68 bool fOwnPendingExec; 68 bool fOwnPendingExec;
69 T* fObj; 69 T* fObj;
70 70
71 typedef SkNoncopyable INHERITED; 71 typedef SkNoncopyable INHERITED;
72 }; 72 };
73 #endif 73 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | include/gpu/GrRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698