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

Side by Side Diff: include/gpu/GrSurface.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/GrRenderTarget.h ('k') | include/gpu/gl/SkGLContextHelper.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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #ifndef GrSurface_DEFINED 9 #ifndef GrSurface_DEFINED
10 #define GrSurface_DEFINED 10 #define GrSurface_DEFINED
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 virtual GrRenderTarget* asRenderTarget() = 0; 73 virtual GrRenderTarget* asRenderTarget() = 0;
74 virtual const GrRenderTarget* asRenderTarget() const = 0; 74 virtual const GrRenderTarget* asRenderTarget() const = 0;
75 75
76 /** 76 /**
77 * Checks whether this GrSurface refers to the same GPU object as other. Thi s 77 * Checks whether this GrSurface refers to the same GPU object as other. Thi s
78 * catches the case where a GrTexture and GrRenderTarget refer to the same 78 * catches the case where a GrTexture and GrRenderTarget refer to the same
79 * GPU memory. 79 * GPU memory.
80 */ 80 */
81 bool isSameAs(const GrSurface* other) const { 81 bool isSameAs(const GrSurface* other) const {
82 const GrRenderTarget* thisRT = this->asRenderTarget(); 82 const GrRenderTarget* thisRT = this->asRenderTarget();
83 if (NULL != thisRT) { 83 if (thisRT) {
84 return thisRT == other->asRenderTarget(); 84 return thisRT == other->asRenderTarget();
85 } else { 85 } else {
86 const GrTexture* thisTex = this->asTexture(); 86 const GrTexture* thisTex = this->asTexture();
87 SkASSERT(NULL != thisTex); // We must be one or the other 87 SkASSERT(thisTex); // We must be one or the other
88 return thisTex == other->asTexture(); 88 return thisTex == other->asTexture();
89 } 89 }
90 } 90 }
91 91
92 /** 92 /**
93 * Reads a rectangle of pixels from the surface. 93 * Reads a rectangle of pixels from the surface.
94 * @param left left edge of the rectangle to read (inclusive) 94 * @param left left edge of the rectangle to read (inclusive)
95 * @param top top edge of the rectangle to read (inclusive) 95 * @param top top edge of the rectangle to read (inclusive)
96 * @param width width of rectangle to read in pixels. 96 * @param width width of rectangle to read in pixels.
97 * @param height height of rectangle to read in pixels. 97 * @param height height of rectangle to read in pixels.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 , fDesc(desc) { 141 , fDesc(desc) {
142 } 142 }
143 143
144 GrTextureDesc fDesc; 144 GrTextureDesc fDesc;
145 145
146 private: 146 private:
147 typedef GrGpuResource INHERITED; 147 typedef GrGpuResource INHERITED;
148 }; 148 };
149 149
150 #endif // GrSurface_DEFINED 150 #endif // GrSurface_DEFINED
OLDNEW
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | include/gpu/gl/SkGLContextHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698