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

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

Issue 23566022: move GrMalloc, GrFree, Gr_bzero to their sk equivalents (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAllocPool.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 2010 Google Inc. 3 * Copyright 2010 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 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 static inline size_t GrSizeAlignDown(size_t x, uint32_t alignment) { 119 static inline size_t GrSizeAlignDown(size_t x, uint32_t alignment) {
120 return (x / alignment) * alignment; 120 return (x / alignment) * alignment;
121 } 121 }
122 122
123 /** 123 /**
124 * Count elements in an array 124 * Count elements in an array
125 */ 125 */
126 #define GR_ARRAY_COUNT(array) SK_ARRAY_COUNT(array) 126 #define GR_ARRAY_COUNT(array) SK_ARRAY_COUNT(array)
127 127
128 //!< allocate a block of memory, will never return NULL
129 extern void* GrMalloc(size_t bytes);
130
131 //!< free block allocated by GrMalloc. ptr may be NULL
132 extern void GrFree(void* ptr);
133
134 static inline void Gr_bzero(void* dst, size_t size) {
135 memset(dst, 0, size);
136 }
137
138 /////////////////////////////////////////////////////////////////////////////// 128 ///////////////////////////////////////////////////////////////////////////////
139 129
140 /** 130 /**
141 * Return true if n is a power of 2 131 * Return true if n is a power of 2
142 */ 132 */
143 static inline bool GrIsPow2(unsigned n) { 133 static inline bool GrIsPow2(unsigned n) {
144 return n && 0 == (n & (n - 1)); 134 return n && 0 == (n & (n - 1));
145 } 135 }
146 136
147 /** 137 /**
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 }; 612 };
623 613
624 /** 614 /**
625 * This value translates to reseting all the context state for any backend. 615 * This value translates to reseting all the context state for any backend.
626 */ 616 */
627 static const uint32_t kAll_GrBackendState = 0xffffffff; 617 static const uint32_t kAll_GrBackendState = 0xffffffff;
628 618
629 /////////////////////////////////////////////////////////////////////////////// 619 ///////////////////////////////////////////////////////////////////////////////
630 620
631 #endif 621 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAllocPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698