From 61624f0c716b576706659750d87b6956f4c15722 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 9 Dec 2016 14:51:59 -0500 Subject: Plumb dst color space in many places, rather than "mode" This is less to type in most cases, and gives us more information (for things like picture-backed images, where we need to know all about the destination surface). Additionally, strip out the plumbing entirely for bitmap sources, where we don't need to know anything. BUG=skia: Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da Reviewed-on: https://skia-review.googlesource.com/5748 Reviewed-by: Mike Klein Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- tests/SpecialImageTest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tests/SpecialImageTest.cpp') diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 8cd874a3c8..b0915f073f 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -155,20 +155,20 @@ DEF_TEST(SpecialImage_Raster, reporter) { } } -static void test_specialimage_image(skiatest::Reporter* reporter, - SkDestinationSurfaceColorMode colorMode) { +static void test_specialimage_image(skiatest::Reporter* reporter, SkColorSpace* dstColorSpace) { SkBitmap bm = create_bm(); sk_sp fullImage(SkImage::MakeFromBitmap(bm)); sk_sp fullSImage(SkSpecialImage::MakeFromImage( SkIRect::MakeWH(kFullSize, kFullSize), - fullImage, colorMode)); + fullImage, dstColorSpace)); const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); { - sk_sp subSImg1(SkSpecialImage::MakeFromImage(subset, fullImage, colorMode)); + sk_sp subSImg1(SkSpecialImage::MakeFromImage(subset, fullImage, + dstColorSpace)); test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize); } @@ -179,11 +179,13 @@ static void test_specialimage_image(skiatest::Reporter* reporter, } DEF_TEST(SpecialImage_Image_Legacy, reporter) { - test_specialimage_image(reporter, SkDestinationSurfaceColorMode::kLegacy); + SkColorSpace* legacyColorSpace = nullptr; + test_specialimage_image(reporter, legacyColorSpace); } DEF_TEST(SpecialImage_Image_ColorSpaceAware, reporter) { - test_specialimage_image(reporter, SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware); + sk_sp srgbColorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); + test_specialimage_image(reporter, srgbColorSpace.get()); } #if SK_SUPPORT_GPU -- cgit v1.2.3