22 , fFlushesSinceLastUse(0)
23 , fPageIndex(pageIndex)
24 , fPlotIndex(plotIndex)
25 , fGenerationCounter(generationCounter)
26 , fGenID(fGenerationCounter->
next())
27 , fPlotLocator(fPageIndex, fPlotIndex, fGenID)
45 SkASSERT(fBytesPerPixel != 3 && fBytesPerPixel <= 4);
73 fData =
reinterpret_cast<unsigned char*
>(
77 unsigned char* dataPtr = fData;
81 topLeft.
fY >= fOffset.
fY && topLeft.
fY < fOffset.
fY + fHeight);
83 dataPtr += fBytesPerPixel * fWidth * topLeft.
fY;
84 dataPtr += fBytesPerPixel * topLeft.
fX;
91 fData =
reinterpret_cast<unsigned char*
>(
95 fData, fBytesPerPixel * fWidth);
100 const unsigned char* imagePtr = (
const unsigned char*)
image;
101 unsigned char* dataPtr = (
unsigned char*)this->
dataAt(al);
104 size_t rowBytes =
width * fBytesPerPixel;
108 if (4 == fBytesPerPixel && kBGRAIsNative) {
111 dataPtr += fBytesPerPixel * fWidth;
112 imagePtr += rowBytes;
116 memcpy(dataPtr, imagePtr, rowBytes);
117 dataPtr += fBytesPerPixel * fWidth;
118 imagePtr += rowBytes;
136 return {
nullptr, {}};
138 size_t rowBytes = fBytesPerPixel * fWidth;
139 const unsigned char* dataPtr;
142 unsigned int clearBits = 0x3 / fBytesPerPixel;
143 fDirtyRect.
fLeft &= ~clearBits;
144 fDirtyRect.
fRight += clearBits;
145 fDirtyRect.
fRight &= ~clearBits;
149 dataPtr += rowBytes * fDirtyRect.
fTop;
150 dataPtr += fBytesPerPixel * fDirtyRect.
fLeft;
157 return { dataPtr, offsetRect };
162 fGenID = fGenerationCounter->
next();
169 sk_bzero(fData, fBytesPerPixel * fWidth * fHeight);
sk_bzero(glyphs, sizeof(glyphs))
skgpu::PlotLocator PlotLocator
static float next(float f)
@ kOpaque_SkAlphaType
pixel is opaque
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static void * sk_calloc_throw(size_t size)
SK_API void sk_free(void *)
void updateRect(skgpu::IRect16 rect)
static AtlasToken InvalidToken()
Plot(int pageIndex, int plotIndex, AtlasGenerationCounter *generationCounter, int offX, int offY, int width, int height, SkColorType colorType, size_t bpp)
bool addSubImage(int width, int height, const void *image, AtlasLocator *atlasLocator)
int AtlasLocator * atlasLocator
SkDEBUGCODE(size_t bpp() const { return fBytesPerPixel;}) bool addRect(int width
SkIPoint prepForRender(const AtlasLocator &, SkAutoPixmapStorage *)
const uint32_t fPageIndex
void * dataAt(const AtlasLocator &atlasLocator)
std::pair< const void *, SkIRect > prepareForUpload()
void copySubImage(const AtlasLocator &atlasLocator, const void *image)
const uint32_t fPlotIndex
bool addRect(int w, int h, SkIPoint16 *loc) final
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Swizzle_8888_u32 RGBA_to_BGRA
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
int16_t fY
y-axis value used by SkIPoint16
int16_t fX
x-axis value used by SkIPoint16
static constexpr SkIPoint Make(int32_t x, int32_t y)
int32_t fTop
smaller y-axis bounds
void join(const SkIRect &r)
constexpr SkIRect makeOffset(int32_t dx, int32_t dy) const
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static IRect16 MakeXYWH(int16_t x, int16_t y, int16_t w, int16_t h)