25 for (
int i = 0;
i < 256;
i++) {
39 p.append(SkRasterPipelineOp::load_8888, &ptr);
42 p.append(SkRasterPipelineOp::store_8888, &ptr);
46 for (
int i = 0;
i < 256;
i++) {
47 if (reds[
i] != (uint32_t)
i) {
48 ERRORF(r,
"%d doesn't round trip, %u",
i, reds[
i]);
55 float colors[4][4] = { {0,1,1,1}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} };
68 p.appendConstantColor(&alloc,
color);
70 p.append(SkRasterPipelineOp::store_f32, &
dst);
73 if (
color[0] != 0.0f) {
74 ERRORF(r,
"expected to_srgb() to map 0.0f to 0.0f, got %f",
color[0]);
76 if (
color[1] != 1.0f) {
80 ERRORF(r,
"expected to_srgb() to map 1.0f to 1.0f, got %f (%08x)",
color[1],
x);
86 static const int kSteps = 128;
89 auto expected = [=](
int i) {
90 float scale = 10000.0f / (3*kSteps);
99 for (
int i = 0;
i < kSteps;
i++) {
113 p.append(SkRasterPipelineOp::load_f32, &ptr);
116 p.append(SkRasterPipelineOp::store_f32, &ptr);
119 auto close = [=](
float x,
float y) {
121 || (
x/
y < 1.001f &&
y/
x < 1.001f);
124 for (
int i = 0;
i < kSteps;
i++) {
127 SkDebugf(
"got %g %g %g, want %g %g %g\n",
129 want.fR, want.fG, want.fB);
static const uint32_t rgba[kNumPixels]
DEF_TEST(srgb_roundtrip, r)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define REPORTER_ASSERT(r, cond,...)
sk_sp< SkColorSpace > makeLinearGamma() const
static sk_sp< SkColorSpace > MakeSRGB()
PODArray< SkColor > colors
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)