#include <SkMask.h>
|
| SkMaskBuilder () |
|
| SkMaskBuilder (const SkMaskBuilder &)=delete |
|
| SkMaskBuilder (SkMaskBuilder &&)=default |
|
SkMaskBuilder & | operator= (const SkMaskBuilder &)=delete |
|
SkMaskBuilder & | operator= (SkMaskBuilder &&that) |
|
| SkMaskBuilder (uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format) |
|
uint8_t *& | image () |
|
SkIRect & | bounds () |
|
uint32_t & | rowBytes () |
|
Format & | format () |
|
uint8_t * | getAddr1 (int x, int y) |
|
uint8_t * | getAddr8 (int x, int y) |
|
uint16_t * | getAddrLCD16 (int x, int y) |
|
uint32_t * | getAddr32 (int x, int y) |
|
void * | getAddr (int x, int y) |
|
| SkMask (const uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format) |
|
bool | isEmpty () const |
|
size_t | computeImageSize () const |
|
size_t | computeTotalImageSize () const |
|
const uint8_t * | getAddr1 (int x, int y) const |
|
const uint8_t * | getAddr8 (int x, int y) const |
|
const uint16_t * | getAddrLCD16 (int x, int y) const |
|
const uint32_t * | getAddr32 (int x, int y) const |
|
const void * | getAddr (int x, int y) const |
|
Definition at line 219 of file SkMask.h.
◆ AllocType
Enumerator |
---|
kUninit_Alloc | |
kZeroInit_Alloc | |
Definition at line 291 of file SkMask.h.
◆ CreateMode
Enumerator |
---|
kJustComputeBounds_CreateMode | compute bounds and return
|
kJustRenderImage_CreateMode | render into preallocate mask
|
kComputeBoundsAndRenderImage_CreateMode | compute bounds, alloc image and render into it
|
Definition at line 298 of file SkMask.h.
298 {
302 };
@ kComputeBoundsAndRenderImage_CreateMode
compute bounds, alloc image and render into it
@ kJustRenderImage_CreateMode
render into preallocate mask
@ kJustComputeBounds_CreateMode
compute bounds and return
◆ SkMaskBuilder() [1/4]
SkMaskBuilder::SkMaskBuilder |
( |
| ) |
|
|
inline |
Definition at line 220 of file SkMask.h.
220:
SkMask(
nullptr, {0}, 0, SkMask::Format::kBW_Format) {}
SkMask(const uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format)
◆ SkMaskBuilder() [2/4]
◆ SkMaskBuilder() [3/4]
◆ SkMaskBuilder() [4/4]
SkMaskBuilder::SkMaskBuilder |
( |
uint8_t * |
img, |
|
|
const SkIRect & |
bounds, |
|
|
uint32_t |
rowBytes, |
|
|
Format |
format |
|
) |
| |
|
inline |
◆ AllocImage()
We explicitly use this allocator for SkBimap pixels, so that we can freely assign memory allocated by one class to the other.
Definition at line 45 of file SkMask.cpp.
45 {
50 }
52}
SK_API void * sk_malloc_flags(size_t size, unsigned flags)
@ SK_MALLOC_ZERO_INITIALIZE
static size_t Align4(size_t x)
FlutterSemanticsFlag flags
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
◆ bounds()
SkIRect & SkMaskBuilder::bounds |
( |
| ) |
|
|
inline |
◆ format()
Format & SkMaskBuilder::format |
( |
| ) |
|
|
inline |
◆ FreeImage()
void SkMaskBuilder::FreeImage |
( |
void * |
image | ) |
|
|
static |
We explicitly use this allocator for SkBimap pixels, so that we can freely assign memory allocated by one class to the other.
Definition at line 57 of file SkMask.cpp.
57 {
59}
SK_API void sk_free(void *)
◆ getAddr()
void * SkMaskBuilder::getAddr |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Returns the address of the specified pixel, computing the pixel-size at runtime based on the mask format. This will be slightly slower than using one of the routines where the format is implied by the name e.g. getAddr8 or getAddr32.
x,y must be contained by the mask's bounds (this is asserted in the debug build, but not checked in the release build.)
This should not be called with kBW_Format, as it will give unspecified results (and assert in the debug build).
Definition at line 287 of file SkMask.h.
287 {
289 }
const void * getAddr(int x, int y) const
◆ getAddr1()
uint8_t * SkMaskBuilder::getAddr1 |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Returns the address of the byte that holds the specified bit. Asserts that the mask is kBW_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.
Definition at line 245 of file SkMask.h.
245 {
247 }
const uint8_t * getAddr1(int x, int y) const
◆ getAddr32()
uint32_t * SkMaskBuilder::getAddr32 |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Return the address of the specified 32bit mask. In the debug build, this asserts that the mask's format is 32bits, and that (x,y) are contained in the mask's fBounds.
Definition at line 271 of file SkMask.h.
271 {
273 }
const uint32_t * getAddr32(int x, int y) const
◆ getAddr8()
uint8_t * SkMaskBuilder::getAddr8 |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Returns the address of the specified byte. Asserts that the mask is kA8_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.
Definition at line 253 of file SkMask.h.
253 {
255 }
const uint8_t * getAddr8(int x, int y) const
◆ getAddrLCD16()
uint16_t * SkMaskBuilder::getAddrLCD16 |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Return the address of the specified 16bit mask. In the debug build, this asserts that the mask's format is kLCD16_Format, and that (x,y) are contained in the mask's fBounds.
Definition at line 262 of file SkMask.h.
262 {
264 }
const uint16_t * getAddrLCD16(int x, int y) const
◆ image()
uint8_t *& SkMaskBuilder::image |
( |
| ) |
|
|
inline |
Definition at line 236 of file SkMask.h.
236{
return *
const_cast<uint8_t**
>(&
fImage); }
uint8_t const *const fImage
◆ operator=() [1/2]
◆ operator=() [2/2]
Definition at line 224 of file SkMask.h.
224 {
229 that.
image() =
nullptr;
230 return *this;
231 }
◆ PrepareDestination()
Returns initial destination mask data padded by radiusX and radiusY
Definition at line 61 of file SkMask.cpp.
61 {
63
65 dst.image() =
nullptr;
67
68
69 size_t dstW = safe.
add(
src.fBounds.width(), safe.
add(radiusX, radiusX));
70
71 size_t dstH = safe.
add(
src.fBounds.height(), safe.
add(radiusY, radiusY));
72
73 size_t toAlloc = safe.
mul(dstW, dstH);
74
75
76 if (!SkTFitsIn<int>(dstW) || !SkTFitsIn<int>(dstH) || toAlloc > INT_MAX || !safe) {
77 dst.bounds().setEmpty();
80 }
81
82 dst.bounds().setWH(SkTo<int>(dstW), SkTo<int>(dstH));
83 dst.bounds().offset(
src.fBounds.x(),
src.fBounds.y());
84 dst.bounds().offset(-radiusX, -radiusY);
85 dst.rowBytes() = SkTo<uint32_t>(dstW);
86
87 if (
src.fImage !=
nullptr) {
89 }
90
92}
size_t add(size_t x, size_t y)
size_t mul(size_t x, size_t y)
static uint8_t * AllocImage(size_t bytes, AllocType=kUninit_Alloc)
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
◆ rowBytes()
uint32_t & SkMaskBuilder::rowBytes |
( |
| ) |
|
|
inline |
The documentation for this struct was generated from the following files: