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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 /** | 55 /** |
56 * The same as NewRasterDirect, but also accepts a call-back routine, which
is invoked | 56 * The same as NewRasterDirect, but also accepts a call-back routine, which
is invoked |
57 * when the surface is deleted, and is passed the pixel memory and the spec
ified context. | 57 * when the surface is deleted, and is passed the pixel memory and the spec
ified context. |
58 */ | 58 */ |
59 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixel
s, size_t rowBytes, | 59 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixel
s, size_t rowBytes, |
60 void (*releaseProc)(void* pixel
s, void* context), | 60 void (*releaseProc)(void* pixel
s, void* context), |
61 void* context, const SkSurfaceP
rops* = NULL); | 61 void* context, const SkSurfaceP
rops* = NULL); |
62 | 62 |
63 /** | 63 /** |
64 * Return a new surface, with the memory for the pixels automatically | 64 * Return a new surface, with the memory for the pixels automatically alloc
ated, but respecting |
65 * allocated. | 65 * the specified rowBytes. If rowBytes==0, then a default value will be cho
sen. |
66 * | 66 * |
67 * If the requested surface cannot be created, or the request is not a | 67 * If the requested surface cannot be created, or the request is not a |
68 * supported configuration, NULL will be returned. | 68 * supported configuration, NULL will be returned. |
69 */ | 69 */ |
| 70 static SkSurface* NewRaster(const SkImageInfo&, size_t rowBytes, const SkSur
faceProps*); |
| 71 |
| 72 /** |
| 73 * Allocate a new surface, automatically computing the rowBytes. |
| 74 */ |
70 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); | 75 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); |
71 | 76 |
72 /** | 77 /** |
73 * Helper version of NewRaster. It creates a SkImageInfo with the | 78 * Helper version of NewRaster. It creates a SkImageInfo with the |
74 * specified width and height, and populates the rest of info to match | 79 * specified width and height, and populates the rest of info to match |
75 * pixels in SkPMColor format. | 80 * pixels in SkPMColor format. |
76 */ | 81 */ |
77 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { | 82 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { |
78 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | 83 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
79 } | 84 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 private: | 286 private: |
282 const SkSurfaceProps fProps; | 287 const SkSurfaceProps fProps; |
283 const int fWidth; | 288 const int fWidth; |
284 const int fHeight; | 289 const int fHeight; |
285 uint32_t fGenerationID; | 290 uint32_t fGenerationID; |
286 | 291 |
287 typedef SkRefCnt INHERITED; | 292 typedef SkRefCnt INHERITED; |
288 }; | 293 }; |
289 | 294 |
290 #endif | 295 #endif |
OLD | NEW |