22 , fFlushesSinceLastUse(0)
23 , fPageIndex(pageIndex)
24 , fPlotIndex(plotIndex)
25 , fGenerationCounter(generationCounter)
26 , fGenID(fGenerationCounter->
next())
27 , fPlotLocator(fPageIndex, fPlotIndex, fGenID)
44 SkASSERT(fBytesPerPixel != 3 && fBytesPerPixel <= 4);
61 fDirtyRect.
join({rect.fLeft, rect.fTop, rect.fRight, rect.fBottom});
72 fData =
reinterpret_cast<unsigned char*
>(
76 unsigned char* dataPtr = fData;
80 topLeft.
fY >= fOffset.
fY && topLeft.
fY < fOffset.
fY + fHeight);
82 dataPtr += fBytesPerPixel * fWidth * topLeft.
fY;
83 dataPtr += fBytesPerPixel * topLeft.
fX;
90 fData =
reinterpret_cast<unsigned char*
>(
94 fData, fBytesPerPixel * fWidth);
99 const unsigned char* imagePtr = (
const unsigned char*)
image;
100 unsigned char* dataPtr = (
unsigned char*)this->
dataAt(al);
103 size_t rowBytes =
width * fBytesPerPixel;
107 if (4 == fBytesPerPixel && kBGRAIsNative) {
108 for (
int i = 0; i <
height; ++i) {
110 dataPtr += fBytesPerPixel * fWidth;
111 imagePtr += rowBytes;
114 for (
int i = 0; i <
height; ++i) {
115 memcpy(dataPtr, imagePtr, rowBytes);
116 dataPtr += fBytesPerPixel * fWidth;
117 imagePtr += rowBytes;
135 return {
nullptr, {}};
137 size_t rowBytes = fBytesPerPixel * fWidth;
138 const unsigned char* dataPtr;
141 unsigned int clearBits = 0x3 / fBytesPerPixel;
142 fDirtyRect.
fLeft &= ~clearBits;
143 fDirtyRect.
fRight += clearBits;
144 fDirtyRect.
fRight &= ~clearBits;
148 dataPtr += rowBytes * fDirtyRect.
fTop;
149 dataPtr += fBytesPerPixel * fDirtyRect.
fLeft;
155 return { dataPtr, offsetRect };
160 fGenID = fGenerationCounter->
next();
167 sk_bzero(fData, fBytesPerPixel * fWidth * fHeight);
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 std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
static void * sk_calloc_throw(size_t size)
static void sk_bzero(void *buffer, 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
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
Swizzle_8888_u32 RGBA_to_BGRA
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)