From a76554d2ae7f676776c1d472aa433b048f418ea9 Mon Sep 17 00:00:00 2001 From: brianosman Date: Fri, 23 Sep 2016 08:49:50 -0700 Subject: Revert of Create special surfaces according to original device (not always in N32) (patchset #9 id:160001 of https://codereview.chromium.org/2349373004/ ) Reason for revert: DM crash and/or TSAN failure Original issue's description: > Change SkSpecialImage::makeSurface and makeTightSurface to take output > properties (color space), bounds, and (optional) alphaType. > > We were being pretty inconsistent before. Raster was honoring all > components of the info. GPU was using the supplied color type, but > propagating the source's color space. All call sites were saying N32. > > What we want to do is propagate the original device's color space, and > pick a good format from that. Rather than force all the clients to > jump through hoops constructing an SkImageInfo that meets our criteria, > just have them supply the few bits we care about, and do everything else > internally. > > This also lets us always use RGBA on GPU, but N32 on raster. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349373004 > > Committed: https://skia.googlesource.com/skia/+/53c38087949252d27cde668368a3eeb59cc2eb00 TBR=robertphillips@google.com,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2366723004 --- tests/SpecialImageTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/SpecialImageTest.cpp') diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index e992177430..ba0eb58f4e 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -85,9 +85,9 @@ static void test_image(const sk_sp& img, skiatest::Reporter* rep //-------------- // Test that draw restricts itself to the subset - SkImageFilter::OutputProperties outProps(img->getColorSpace()); - sk_sp surf(img->makeSurface(outProps, SkISize::Make(kFullSize, kFullSize), - kOpaque_SkAlphaType)); + SkImageInfo info = SkImageInfo::MakeN32(kFullSize, kFullSize, kOpaque_SkAlphaType); + + sk_sp surf(img->makeSurface(info)); SkCanvas* canvas = surf->getCanvas(); @@ -122,8 +122,9 @@ static void test_image(const sk_sp& img, skiatest::Reporter* rep REPORTER_ASSERT(reporter, peekTextureSucceeds != !!tightImg->peekPixels(&tmpPixmap)); } { - SkImageFilter::OutputProperties outProps(img->getColorSpace()); - sk_sp tightSurf(img->makeTightSurface(outProps, subset.size())); + SkImageInfo info = SkImageInfo::MakeN32(subset.width(), subset.height(), + kPremul_SkAlphaType); + sk_sp tightSurf(img->makeTightSurface(info)); REPORTER_ASSERT(reporter, tightSurf->width() == subset.width()); REPORTER_ASSERT(reporter, tightSurf->height() == subset.height()); -- cgit v1.2.3