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

Side by Side Diff: src/gpu/GrGeometryBuffer.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 | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrGeometryBuffer_DEFINED 10 #ifndef GrGeometryBuffer_DEFINED
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 * @return a pointer to the data or NULL if the map fails. 51 * @return a pointer to the data or NULL if the map fails.
52 */ 52 */
53 void* map() { return (fMapPtr = this->onMap()); } 53 void* map() { return (fMapPtr = this->onMap()); }
54 54
55 /** 55 /**
56 * Unmaps the buffer. 56 * Unmaps the buffer.
57 * 57 *
58 * The pointer returned by the previous map call will no longer be valid. 58 * The pointer returned by the previous map call will no longer be valid.
59 */ 59 */
60 void unmap() { 60 void unmap() {
61 SkASSERT(NULL != fMapPtr); 61 SkASSERT(fMapPtr);
62 this->onUnmap(); 62 this->onUnmap();
63 fMapPtr = NULL; 63 fMapPtr = NULL;
64 } 64 }
65 65
66 /** 66 /**
67 * Returns the same ptr that map() returned at time of map or NULL if the 67 * Returns the same ptr that map() returned at time of map or NULL if the
68 * is not mapped. 68 * is not mapped.
69 * 69 *
70 * @return ptr to mapped buffer data or NULL if buffer is not mapped. 70 * @return ptr to mapped buffer data or NULL if buffer is not mapped.
71 */ 71 */
72 void* mapPtr() const { return fMapPtr; } 72 void* mapPtr() const { return fMapPtr; }
73 73
74 /** 74 /**
75 Queries whether the buffer has been mapped. 75 Queries whether the buffer has been mapped.
76 76
77 @return true if the buffer is mapped, false otherwise. 77 @return true if the buffer is mapped, false otherwise.
78 */ 78 */
79 bool isMapped() const { return NULL != fMapPtr; } 79 bool isMapped() const { return SkToBool(fMapPtr); }
80 80
81 /** 81 /**
82 * Updates the buffer data. 82 * Updates the buffer data.
83 * 83 *
84 * The size of the buffer will be preserved. The src data will be 84 * The size of the buffer will be preserved. The src data will be
85 * placed at the beginning of the buffer and any remaining contents will 85 * placed at the beginning of the buffer and any remaining contents will
86 * be undefined. srcSizeInBytes must be <= to the buffer size. 86 * be undefined. srcSizeInBytes must be <= to the buffer size.
87 * 87 *
88 * The buffer must not be mapped. 88 * The buffer must not be mapped.
89 * 89 *
(...skipping 26 matching lines...) Expand all
116 116
117 void* fMapPtr; 117 void* fMapPtr;
118 size_t fGpuMemorySize; 118 size_t fGpuMemorySize;
119 bool fDynamic; 119 bool fDynamic;
120 bool fCPUBacked; 120 bool fCPUBacked;
121 121
122 typedef GrGpuResource INHERITED; 122 typedef GrGpuResource INHERITED;
123 }; 123 };
124 124
125 #endif 125 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698