Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: tests/SpecialImageTest.cpp

Issue 2349373004: Create special surfaces according to original device (not always in N32) (Closed)
Patch Set: Remove copy-pasted default parameter, expand comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SpecialImageTest.cpp
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index ba0eb58f4eb1a930ce9f4ef7beddcba5297b7cb7..e992177430c6a01f50b59a4a65f6bd5d52cc7279 100644
--- a/tests/SpecialImageTest.cpp
+++ b/tests/SpecialImageTest.cpp
@@ -85,9 +85,9 @@ static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* rep
//--------------
// Test that draw restricts itself to the subset
- SkImageInfo info = SkImageInfo::MakeN32(kFullSize, kFullSize, kOpaque_SkAlphaType);
-
- sk_sp<SkSpecialSurface> surf(img->makeSurface(info));
+ SkImageFilter::OutputProperties outProps(img->getColorSpace());
+ sk_sp<SkSpecialSurface> surf(img->makeSurface(outProps, SkISize::Make(kFullSize, kFullSize),
+ kOpaque_SkAlphaType));
SkCanvas* canvas = surf->getCanvas();
@@ -122,9 +122,8 @@ static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* rep
REPORTER_ASSERT(reporter, peekTextureSucceeds != !!tightImg->peekPixels(&tmpPixmap));
}
{
- SkImageInfo info = SkImageInfo::MakeN32(subset.width(), subset.height(),
- kPremul_SkAlphaType);
- sk_sp<SkSurface> tightSurf(img->makeTightSurface(info));
+ SkImageFilter::OutputProperties outProps(img->getColorSpace());
+ sk_sp<SkSurface> tightSurf(img->makeTightSurface(outProps, subset.size()));
REPORTER_ASSERT(reporter, tightSurf->width() == subset.width());
REPORTER_ASSERT(reporter, tightSurf->height() == subset.height());
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698