34 uint8_t*
byte =
reinterpret_cast<uint8_t*
>(&packed);
44 uint8_t*
byte =
reinterpret_cast<uint8_t*
>(&packed);
67 for (
int a = 0;
a < 256; ++
a) {
69 for (
int r = 0; r < 256; ++r) {
97 for (
int y = 0;
y < 256 && success; ++
y) {
98 const uint32_t* pixels1 = readBmp1.
getAddr32(0,
y);
99 const uint32_t* pixels2 = readBmp2.
getAddr32(0,
y);
100 for (
int x = 0;
x < 256 && success; ++
x) {
102 if (pixels1[
x] != pixels2[
x]) {
103 SkDebugf(
"%x != %x, x = %d, y = %d\n", pixels1[
x], pixels2[
x],
x,
y);
139 uint32_t* srcPixels = (uint32_t*)
src.addr();
140 for (
int y = 0;
y < 256; ++
y) {
141 for (
int x = 0;
x < 256; ++
x) {
158 auto get_pixel = [](
const GrPixmap& pm,
int x,
int y) {
159 const uint32_t*
addr = (
const uint32_t*)pm.
addr();
162 auto dump_pixel_history = [&](
int x,
int y) {
163 SkDebugf(
"Pixel history for (%d, %d):\n",
x,
y);
165 SkDebugf(
" -> : %08x\n", get_pixel(surf,
x,
y));
166 SkDebugf(
" <- : %08x\n", get_pixel(read1,
x,
y));
167 SkDebugf(
" -> : %08x\n", get_pixel(surf2,
x,
y));
168 SkDebugf(
" <- : %08x\n", get_pixel(read2,
x,
y));
172 for (
int y = 0;
y < 256 && success; ++
y) {
173 const uint32_t* pixels1 = (
const uint32_t*) read1.
addr();
174 const uint32_t* pixels2 = (
const uint32_t*) read2.
addr();
175 for (
int x = 0;
x < 256 && success; ++
x) {
176 uint32_t c1 = pixels1[
y * 256 +
x],
177 c2 = pixels2[
y * 256 +
x];
180 dump_pixel_history(
x,
y);
195 uint32_t* srcPixels =
src.getAddr32(0, 0);
196 for (
int y = 0;
y < 256; ++
y) {
197 for (
int x = 0;
x < 256; ++
x) {
204 src.info(),
src.getAddr(0, 0),
src.rowBytes()));
219 auto dump_pixel_history = [&](
int x,
int y) {
220 SkDebugf(
"Pixel history for (%d, %d):\n",
x,
y);
229 for (
int y = 0;
y < 256 && success; ++
y) {
230 const uint32_t* pixels1 = read1.
getAddr32(0, 0);
231 const uint32_t* pixels2 = read2.
getAddr32(0, 0);
232 for (
int x = 0;
x < 256 && success; ++
x) {
233 uint32_t c1 = pixels1[
y * 256 +
x],
234 c2 = pixels2[
y * 256 +
x];
237 dump_pixel_history(
x,
y);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
bool GrConvertPixels(const GrPixmap &dst, const GrCPixmap &src, bool flipY)
static void test_premul_alpha_roundtrip(skiatest::Reporter *reporter, SkSurface *surf)
uint32_t(* PackUnpremulProc)(SkColor)
static void fill_surface(SkSurface *surf, SkColorType colorType, PackUnpremulProc proc)
const struct @436 gUnpremul[]
static uint32_t pack_unpremul_bgra(SkColor c)
static uint32_t pack_unpremul_rgba(SkColor c)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
PackUnpremulProc fPackProc
DEF_TEST(PremulAlphaRoundTrip, reporter)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define SkColorGetR(color)
#define SkColorGetG(color)
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#define SkColorGetA(color)
#define SkColorGetB(color)
bool SkConvertPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRB, const SkImageInfo &srcInfo, const void *srcPixels, size_t srcRB)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
#define REPORTER_ASSERT(r, cond,...)
static GrPixmap Allocate(const GrImageInfo &info)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
SkISize dimensions() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
uint32_t * getAddr32(int x, int y) const
void eraseColor(SkColor4f) const
void writePixels(const SkPixmap &src, int dstX, int dstY)
bool readPixels(const SkPixmap &dst, int srcX, int srcY)
static Editor::Movement convert(skui::Key key)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
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
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)