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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 /** | 45 /** |
46 * The same as NewRasterDirect, but also accepts a call-back routine, which
is invoked | 46 * The same as NewRasterDirect, but also accepts a call-back routine, which
is invoked |
47 * when the surface is deleted, and is passed the pixel memory and the spec
ified context. | 47 * when the surface is deleted, and is passed the pixel memory and the spec
ified context. |
48 */ | 48 */ |
49 static sk_sp<SkSurface> MakeRasterDirectReleaseProc(const SkImageInfo&, void
* pixels, size_t rowBytes, | 49 static sk_sp<SkSurface> MakeRasterDirectReleaseProc(const SkImageInfo&, void
* pixels, size_t rowBytes, |
50 void (*releaseProc)(void* pixel
s, void* context), | 50 void (*releaseProc)(void* pixel
s, void* context), |
51 void* context, const SkSurfaceP
rops* = nullptr); | 51 void* context, const SkSurfaceP
rops* = nullptr); |
52 | 52 |
53 /** | 53 /** |
54 * Return a new surface, with the memory for the pixels automatically alloc
ated but respecting | 54 * Return a new surface, with the memory for the pixels automatically alloc
ated and |
55 * the specified rowBytes. If rowBytes==0, then a default value will be cho
sen. If a non-zero | 55 * zero-initialized, but respecting the specified rowBytes. If rowBytes==0,
then a default |
56 * rowBytes is specified, then any images snapped off of this surface (via
makeImageSnapshot()) | 56 * value will be chosen. If a non-zero rowBytes is specified, then any imag
es snapped off of |
57 * are guaranteed to have the same rowBytes. | 57 * this surface (via makeImageSnapshot()) are guaranteed to have the same r
owBytes. |
58 * | |
59 * If the requested alpha type is not opaque, then the surface's pixel memo
ry will be | |
60 * zero-initialized. If it is opaque, then it will be left uninitialized, a
nd the caller is | |
61 * responsible for initially clearing the surface. | |
62 * | 58 * |
63 * If the requested surface cannot be created, or the request is not a | 59 * If the requested surface cannot be created, or the request is not a |
64 * supported configuration, NULL will be returned. | 60 * supported configuration, NULL will be returned. |
65 */ | 61 */ |
66 static sk_sp<SkSurface> MakeRaster(const SkImageInfo&, size_t rowBytes, cons
t SkSurfaceProps*); | 62 static sk_sp<SkSurface> MakeRaster(const SkImageInfo&, size_t rowBytes, cons
t SkSurfaceProps*); |
67 | 63 |
68 /** | 64 /** |
69 * Allocate a new surface, automatically computing the rowBytes. | 65 * Allocate a new surface, automatically computing the rowBytes. |
70 */ | 66 */ |
71 static sk_sp<SkSurface> MakeRaster(const SkImageInfo& info, | 67 static sk_sp<SkSurface> MakeRaster(const SkImageInfo& info, |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 private: | 389 private: |
394 const SkSurfaceProps fProps; | 390 const SkSurfaceProps fProps; |
395 const int fWidth; | 391 const int fWidth; |
396 const int fHeight; | 392 const int fHeight; |
397 uint32_t fGenerationID; | 393 uint32_t fGenerationID; |
398 | 394 |
399 typedef SkRefCnt INHERITED; | 395 typedef SkRefCnt INHERITED; |
400 }; | 396 }; |
401 | 397 |
402 #endif | 398 #endif |
OLD | NEW |