OLD | NEW |
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 #ifndef SkSurface_DEFINED | 8 #ifndef SkSurface_DEFINED |
9 #define SkSurface_DEFINED | 9 #define SkSurface_DEFINED |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 /** | 31 /** |
32 * Create a new surface, using the specified pixels/rowbytes as its | 32 * Create a new surface, using the specified pixels/rowbytes as its |
33 * backend. | 33 * backend. |
34 * | 34 * |
35 * If the requested surface cannot be created, or the request is not a | 35 * If the requested surface cannot be created, or the request is not a |
36 * supported configuration, NULL will be returned. | 36 * supported configuration, NULL will be returned. |
37 */ | 37 */ |
38 static SkSurface* NewRasterDirect(const SkImageInfo&, void* pixels, size_t r
owBytes); | 38 static SkSurface* NewRasterDirect(const SkImageInfo&, void* pixels, size_t r
owBytes); |
39 | 39 |
40 /** | 40 /** |
| 41 * The same as NewRasterDirect, but also accepts a call-back routine, which
is invoked |
| 42 * when the surface is deleted, and is passed the pixel memory and the spec
ified context. |
| 43 */ |
| 44 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixel
s, size_t rowBytes, |
| 45 void (*releaseProc)(void* pixel
s, void* context), |
| 46 void* context); |
| 47 |
| 48 /** |
41 * Return a new surface, with the memory for the pixels automatically | 49 * Return a new surface, with the memory for the pixels automatically |
42 * allocated. | 50 * allocated. |
43 * | 51 * |
44 * If the requested surface cannot be created, or the request is not a | 52 * If the requested surface cannot be created, or the request is not a |
45 * supported configuration, NULL will be returned. | 53 * supported configuration, NULL will be returned. |
46 */ | 54 */ |
47 static SkSurface* NewRaster(const SkImageInfo&); | 55 static SkSurface* NewRaster(const SkImageInfo&); |
48 | 56 |
49 /** | 57 /** |
50 * Helper version of NewRaster. It creates a SkImageInfo with the | 58 * Helper version of NewRaster. It creates a SkImageInfo with the |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 203 |
196 private: | 204 private: |
197 const int fWidth; | 205 const int fWidth; |
198 const int fHeight; | 206 const int fHeight; |
199 uint32_t fGenerationID; | 207 uint32_t fGenerationID; |
200 | 208 |
201 typedef SkRefCnt INHERITED; | 209 typedef SkRefCnt INHERITED; |
202 }; | 210 }; |
203 | 211 |
204 #endif | 212 #endif |
OLD | NEW |