Skia
2D Graphics Library
|
Typedefs | |
using | PixelsReleaseProc = void(void *pixels, void *context) |
Enumerations | |
enum class | BackendSurfaceAccess { kNoAccess , kPresent } |
Functions | |
SK_API sk_sp< SkSurface > | Null (int width, int height) |
Returns SkSurface without backing pixels. More... | |
SK_API sk_sp< SkSurface > | Raster (const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps) |
Allocates raster SkSurface. More... | |
sk_sp< SkSurface > | Raster (const SkImageInfo &imageInfo, const SkSurfaceProps *props=nullptr) |
SK_API sk_sp< SkSurface > | WrapPixels (const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr) |
Allocates raster SkSurface. More... | |
sk_sp< SkSurface > | WrapPixels (const SkPixmap &pm, const SkSurfaceProps *props=nullptr) |
SK_API sk_sp< SkSurface > | WrapPixels (const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, PixelsReleaseProc, void *context, const SkSurfaceProps *surfaceProps=nullptr) |
Allocates raster SkSurface. More... | |
using SkSurfaces::PixelsReleaseProc = typedef void(void* pixels, void* context) |
|
strong |
|
inline |
SK_API sk_sp<SkSurface> SkSurfaces::Raster | ( | const SkImageInfo & | imageInfo, |
size_t | rowBytes, | ||
const SkSurfaceProps * | surfaceProps | ||
) |
Allocates raster SkSurface.
SkCanvas returned by SkSurface draws directly into those allocated pixels, which are zeroed before use. Pixel memory size is imageInfo.height() times imageInfo.minRowBytes() or rowBytes, if provided and non-zero.
Pixel memory is deleted when SkSurface is deleted.
Validity constraints include:
imageInfo | width, height, SkColorType, SkAlphaType, SkColorSpace, of raster surface; width and height must be greater than zero |
rowBytes | interval from one SkSurface row to the next. |
props | LCD striping orientation and setting for device independent fonts; may be nullptr |
SK_API sk_sp<SkSurface> SkSurfaces::WrapPixels | ( | const SkImageInfo & | imageInfo, |
void * | pixels, | ||
size_t | rowBytes, | ||
const SkSurfaceProps * | surfaceProps = nullptr |
||
) |
Allocates raster SkSurface.
SkCanvas returned by SkSurface draws directly into the provided pixels.
SkSurface is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; info contains SkColorType and SkAlphaType supported by raster surface; pixels is not nullptr; rowBytes is large enough to contain info width pixels of SkColorType.
Pixel buffer size should be info height times computed rowBytes. Pixels are not initialized. To access pixels after drawing, peekPixels() or readPixels().
imageInfo | width, height, SkColorType, SkAlphaType, SkColorSpace, of raster surface; width and height must be greater than zero |
pixels | pointer to destination pixels buffer |
rowBytes | interval from one SkSurface row to the next |
surfaceProps | LCD striping orientation and setting for device independent fonts; may be nullptr |
SK_API sk_sp<SkSurface> SkSurfaces::WrapPixels | ( | const SkImageInfo & | imageInfo, |
void * | pixels, | ||
size_t | rowBytes, | ||
PixelsReleaseProc | , | ||
void * | context, | ||
const SkSurfaceProps * | surfaceProps = nullptr |
||
) |
Allocates raster SkSurface.
SkCanvas returned by SkSurface draws directly into the provided pixels. releaseProc is called with pixels and context when SkSurface is deleted.
SkSurface is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; info contains SkColorType and SkAlphaType supported by raster surface; pixels is not nullptr; rowBytes is large enough to contain info width pixels of SkColorType.
Pixel buffer size should be info height times computed rowBytes. Pixels are not initialized. To access pixels after drawing, call flush() or peekPixels().
imageInfo | width, height, SkColorType, SkAlphaType, SkColorSpace, of raster surface; width and height must be greater than zero |
pixels | pointer to destination pixels buffer |
rowBytes | interval from one SkSurface row to the next |
releaseProc | called when SkSurface is deleted; may be nullptr |
context | passed to releaseProc; may be nullptr |
surfaceProps | LCD striping orientation and setting for device independent fonts; may be nullptr |
|
inline |