add Leon's gradient to p3 GM

Running...

  $ ninja -C out dm
  $ out/dm -m p3 --config 8888 srgb f16 esrgb p3 glp3 glesrgb glf16 -w foo
  $ open foo/*/gm/p3.png

... looks like esrgb and f16 are marked wrong, and all others right,
which points to a problem specific to the software backend.

Bug: skia:8730
Change-Id: Ibffe3014e6ed1ade9c04381530a3c84a690e6469
Reviewed-on: https://skia-review.googlesource.com/c/188028
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-01-30 11:43:47 -05:00 committed by Skia Commit-Bot
parent 70ebd9ca06
commit b0243b29cb

View File

@ -300,6 +300,34 @@ DEF_SIMPLE_GM(p3, canvas, 450, 1300) {
canvas->translate(0,80);
// Leon's blue -> green -> red gradient, interpolating in premul.
{
SkPoint points[] = {{10.5,10.5}, {10.5,69.5}};
SkColor4f colors[] = { {0,0,1,1}, {0,1,0,1}, {1,0,0,1} };
SkPaint paint;
paint.setShader(
SkGradientShader::MakeLinear(points, colors, p3,
nullptr, SK_ARRAY_COUNT(colors),
SkShader::kClamp_TileMode,
SkGradientShader::kInterpolateColorsInPremul_Flag,
nullptr/*local matrix*/));
canvas->drawRect({10,10,70,70}, paint);
canvas->save();
compare_pixel("Leon's gradient, P3 blue",
canvas, 10,10,
{0,0,1,1}, p3.get());
canvas->translate(180, 0);
compare_pixel("Leon's gradient, P3 red",
canvas, 10,69,
{1,0,0,1}, p3.get());
canvas->restore();
}
canvas->translate(0,80);
// Draw an A8 image with a P3 red, scaled and not, as a shader or bitmap.
{
uint8_t mask[256];