Flutter Engine
The Flutter Engine
|
#include <SkAutoPixmapStorage.h>
Public Member Functions | |
SkAutoPixmapStorage () | |
~SkAutoPixmapStorage () | |
SkAutoPixmapStorage (SkAutoPixmapStorage &&other) | |
SkAutoPixmapStorage & | operator= (SkAutoPixmapStorage &&other) |
bool | tryAlloc (const SkImageInfo &) |
void | alloc (const SkImageInfo &) |
void * | detachPixels () |
sk_sp< SkData > | detachPixelsAsData () |
void | reset () |
void | reset (const SkImageInfo &info, const void *addr, size_t rb) |
bool | reset (const SkMask &mask) |
Public Member Functions inherited from SkPixmap | |
SkPixmap () | |
SkPixmap (const SkImageInfo &info, const void *addr, size_t rowBytes) | |
void | reset () |
void | reset (const SkImageInfo &info, const void *addr, size_t rowBytes) |
void | setColorSpace (sk_sp< SkColorSpace > colorSpace) |
bool | reset (const SkMask &mask) |
bool | extractSubset (SkPixmap *subset, const SkIRect &area) const |
const SkImageInfo & | info () const |
size_t | rowBytes () const |
const void * | addr () const |
int | width () const |
int | height () const |
SkISize | dimensions () const |
SkColorType | colorType () const |
SkAlphaType | alphaType () const |
SkColorSpace * | colorSpace () const |
sk_sp< SkColorSpace > | refColorSpace () const |
bool | isOpaque () const |
SkIRect | bounds () const |
int | rowBytesAsPixels () const |
int | shiftPerPixel () const |
size_t | computeByteSize () const |
bool | computeIsOpaque () const |
SkColor | getColor (int x, int y) const |
SkColor4f | getColor4f (int x, int y) const |
float | getAlphaf (int x, int y) const |
const void * | addr (int x, int y) const |
const uint8_t * | addr8 () const |
const uint16_t * | addr16 () const |
const uint32_t * | addr32 () const |
const uint64_t * | addr64 () const |
const uint16_t * | addrF16 () const |
const uint8_t * | addr8 (int x, int y) const |
const uint16_t * | addr16 (int x, int y) const |
const uint32_t * | addr32 (int x, int y) const |
const uint64_t * | addr64 (int x, int y) const |
const uint16_t * | addrF16 (int x, int y) const |
void * | writable_addr () const |
void * | writable_addr (int x, int y) const |
uint8_t * | writable_addr8 (int x, int y) const |
uint16_t * | writable_addr16 (int x, int y) const |
uint32_t * | writable_addr32 (int x, int y) const |
uint64_t * | writable_addr64 (int x, int y) const |
uint16_t * | writable_addrF16 (int x, int y) const |
bool | readPixels (const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes) const |
bool | readPixels (const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const |
bool | readPixels (const SkPixmap &dst, int srcX, int srcY) const |
bool | readPixels (const SkPixmap &dst) const |
bool | scalePixels (const SkPixmap &dst, const SkSamplingOptions &) const |
bool | erase (SkColor color, const SkIRect &subset) const |
bool | erase (SkColor color) const |
bool | erase (const SkColor4f &color, const SkIRect *subset=nullptr) const |
Static Public Member Functions | |
static size_t | AllocSize (const SkImageInfo &info, size_t *rowBytes) |
Definition at line 21 of file SkAutoPixmapStorage.h.
SkAutoPixmapStorage::SkAutoPixmapStorage | ( | ) |
Definition at line 15 of file SkAutoPixmapStorage.cpp.
SkAutoPixmapStorage::~SkAutoPixmapStorage | ( | ) |
Definition at line 17 of file SkAutoPixmapStorage.cpp.
SkAutoPixmapStorage::SkAutoPixmapStorage | ( | SkAutoPixmapStorage && | other | ) |
Definition at line 21 of file SkAutoPixmapStorage.cpp.
void SkAutoPixmapStorage::alloc | ( | const SkImageInfo & | info | ) |
Allocate memory for the pixels needed to match the specified Info and fill out the pixmap to point to that memory. The storage will be freed when this object is destroyed, or if another call to tryAlloc() or alloc() is made.
If the memory cannot be allocated, calls SK_ABORT().
Definition at line 60 of file SkAutoPixmapStorage.cpp.
|
static |
Gets the size and optionally the rowBytes that would be allocated by SkAutoPixmapStorage if alloc/tryAlloc was called.
Definition at line 35 of file SkAutoPixmapStorage.cpp.
void * SkAutoPixmapStorage::detachPixels | ( | ) |
Returns a void* of the allocated pixel memory and resets the pixmap. If the storage hasn't been allocated, the result is NULL. The caller is responsible for calling sk_free to free the returned memory.
Definition at line 64 of file SkAutoPixmapStorage.cpp.
Returns an SkData object wrapping the allocated pixels memory, and resets the pixmap. If the storage hasn't been allocated, the result is NULL.
Definition at line 76 of file SkAutoPixmapStorage.cpp.
SkAutoPixmapStorage & SkAutoPixmapStorage::operator= | ( | SkAutoPixmapStorage && | other | ) |
Leave the moved-from object in a free-but-valid state.
Definition at line 25 of file SkAutoPixmapStorage.cpp.
|
inline |
Definition at line 72 of file SkAutoPixmapStorage.h.
|
inline |
Definition at line 76 of file SkAutoPixmapStorage.h.
|
inline |
Definition at line 81 of file SkAutoPixmapStorage.h.
bool SkAutoPixmapStorage::tryAlloc | ( | const SkImageInfo & | info | ) |
Try to allocate memory for the pixels needed to match the specified Info. On success return true and fill out the pixmap to point to that memory. The storage will be freed when this object is destroyed, or if another call to tryAlloc() or alloc() is made.
On failure, return false and reset() the pixmap to empty.
Definition at line 43 of file SkAutoPixmapStorage.cpp.