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

Unified Diff: src/image/SkSurface.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 | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface.cpp
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 9bec562df90a90a590062eb59a28ae0fabe7445e..bb807ba7a555ea3bea979f414a8989ee112967a1 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -79,10 +79,9 @@ SkSurface_Base::~SkSurface_Base() {
}
void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) {
- SkImage* image = this->newImageSnapshot(SkBudgeted::kYes);
+ auto image = this->makeImageSnapshot(SkBudgeted::kYes);
if (image) {
canvas->drawImage(image, x, y, paint);
- image->unref();
}
}
@@ -163,12 +162,12 @@ SkCanvas* SkSurface::getCanvas() {
return asSB(this)->getCachedCanvas();
}
-SkImage* SkSurface::newImageSnapshot(SkBudgeted budgeted) {
+sk_sp<SkImage> SkSurface::makeImageSnapshot(SkBudgeted budgeted) {
// the caller will call unref() to balance this
return asSB(this)->refCachedImage(budgeted, kNo_ForceUnique);
}
-SkImage* SkSurface::newImageSnapshot(SkBudgeted budgeted, ForceUnique unique) {
+sk_sp<SkImage> SkSurface::makeImageSnapshot(SkBudgeted budgeted, ForceUnique unique) {
// the caller will call unref() to balance this
return asSB(this)->refCachedImage(budgeted, unique);
}
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698