Revert "explictly fail to draw unpremul, as this is buggy, incomplete, tricky, and unused"
This reverts commit 1baaacac74d24604e3dfca9857fbd647df375997.
Reason for revert: Failing the roll: https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/3868/layout-test-results/results.html
Original change's description:
> explictly fail to draw unpremul, as this is buggy, incomplete, tricky, and unused
>
> BUG=skia:
>
> Change-Id: Ie9da6015cc4955c0f27f6db53fc6ae532e0132f4
> Reviewed-on: https://skia-review.googlesource.com/7304
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Matt Sarett <msarett@google.com>
>
TBR=bsalomon@google.com,msarett@google.com,brianosman@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Change-Id: Ifc808a430b8afe4fef6df3775c2bfdcede1a2dd7
Reviewed-on: https://skia-review.googlesource.com/7329
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index 0d9c2c5..e954fc3 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -260,37 +260,27 @@
*pm.writable_addr32(x, y) = make_pixel(x, y, alphaType);
}
}
- bm->setImmutable();
}
-DEF_SIMPLE_GM(all_variants_8888, canvas, 4 * SCALE + 30, 4 * SCALE + 30) {
+DEF_SIMPLE_GM(all_variants_8888, canvas, 4 * SCALE + 30, 2 * SCALE + 10) {
sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
sk_sp<SkColorSpace> colorSpaces[] {
SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named),
nullptr,
};
-
- SkPaint rectPaint;
- rectPaint.setColor(0x8000FF00);
- SkRect r = { 0, 0, SCALE, SCALE };
-
for (auto colorSpace : colorSpaces) {
canvas->save();
- // unpremul is expected to *not* draw anything
for (auto alphaType : {kPremul_SkAlphaType, kUnpremul_SkAlphaType}) {
canvas->save();
for (auto colorType : {kRGBA_8888_SkColorType, kBGRA_8888_SkColorType}) {
SkBitmap bm;
make_color_test_bitmap_variant(colorType, alphaType, colorSpace, &bm);
- canvas->drawRect(r, rectPaint);
canvas->drawBitmap(bm, 0.0f, 0.0f);
- canvas->drawRect(r.makeOffset(0, SCALE + 10), rectPaint);
- canvas->drawImage(SkImage::MakeFromBitmap(bm), 0, SCALE + 10, nullptr);
canvas->translate(SCALE + 10, 0.0f);
}
canvas->restore();
- canvas->translate(0.0f, (SCALE + 10) * 2);
+ canvas->translate(0.0f, SCALE + 10);
}
canvas->restore();
canvas->translate(2 * (SCALE + 10), 0.0f);