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

Unified Diff: bench/ImageBench.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 | « bench/DisplacementBench.cpp ('k') | bench/MergeBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ImageBench.cpp
diff --git a/bench/ImageBench.cpp b/bench/ImageBench.cpp
index 097ed91d5de45f36d6d07fd4428693184a46067e..b07d267b6038b449d5b85584fa519e9be3d6b82b 100644
--- a/bench/ImageBench.cpp
+++ b/bench/ImageBench.cpp
@@ -33,7 +33,7 @@ protected:
SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
SkAutoTUnref<SkSurface> surface(canvas->newSurface(info));
canvas->drawColor(SK_ColorRED);
- fImage.reset(surface->newImageSnapshot());
+ fImage = surface->makeImageSnapshot();
// create a cpu-backed Surface
fRasterSurface.reset(SkSurface::NewRaster(info));
@@ -49,14 +49,14 @@ protected:
void onDraw(int loops, SkCanvas*) override {
for (int i = 0; i < loops; i++) {
for (int inner = 0; inner < 10; ++inner) {
- fRasterSurface->getCanvas()->drawImage(fImage, 0, 0);
+ fRasterSurface->getCanvas()->drawImage(fImage.get(), 0, 0);
}
}
}
private:
SkString fName;
- SkAutoTUnref<SkImage> fImage;
+ sk_sp<SkImage> fImage;
SkAutoTUnref<SkSurface> fRasterSurface;
typedef Benchmark INHERITED;
« no previous file with comments | « bench/DisplacementBench.cpp ('k') | bench/MergeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698