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

Unified Diff: tests/SkResourceCacheTest.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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 | « tests/SkImageTest.cpp ('k') | tests/SpecialImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkResourceCacheTest.cpp
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index f9a0e6d505eebf12296f7ebfe4d23ff6bb5b500d..625b98a90332ef4eaa281ea4c584fcbc4e3807f4 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -263,7 +263,7 @@ DEF_TEST(BitmapCache_discarded_bitmap, reporter) {
}
static void test_discarded_image(skiatest::Reporter* reporter, const SkMatrix& transform,
- SkImage* (*buildImage)()) {
+ sk_sp<SkImage> (*buildImage)()) {
SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
@@ -273,7 +273,7 @@ static void test_discarded_image(skiatest::Reporter* reporter, const SkMatrix& t
for (unsigned i = 0; i < kRepeatCount; ++i) {
SkAutoCanvasRestore acr(canvas, true);
- SkAutoTUnref<SkImage> image(buildImage());
+ sk_sp<SkImage> image(buildImage());
// always use high quality to ensure caching when scaled
SkPaint paint;
@@ -315,15 +315,15 @@ DEF_TEST(BitmapCache_discarded_image, reporter) {
test_discarded_image(reporter, xforms[i], []() {
SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10));
surface->getCanvas()->clear(SK_ColorCYAN);
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
});
test_discarded_image(reporter, xforms[i], []() {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(10, 10);
canvas->clear(SK_ColorCYAN);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- return SkImage::NewFromPicture(picture, SkISize::Make(10, 10), nullptr, nullptr);
+ sk_sp<SkPicture> picture(recorder.endRecording());
+ return SkImage::MakeFromPicture(picture, SkISize::Make(10, 10), nullptr, nullptr);
});
}
}
« no previous file with comments | « tests/SkImageTest.cpp ('k') | tests/SpecialImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698