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

Unified Diff: src/image/SkImage_Generator.cpp

Issue 1783063002: Revert of add Make variations to return SkImage by sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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_Base.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Generator.cpp
diff --git a/src/image/SkImage_Generator.cpp b/src/image/SkImage_Generator.cpp
index 62b492e2881cab8c585174b3ca26c3d613bc7e30..95cc426a43225d8819a107ddf50ae40bbabb0bb1 100644
--- a/src/image/SkImage_Generator.cpp
+++ b/src/image/SkImage_Generator.cpp
@@ -25,7 +25,7 @@
SkImageCacherator* peekCacherator() const override { return fCache; }
SkData* onRefEncoded(GrContext*) const override;
bool isOpaque() const override { return fCache->info().isOpaque(); }
- sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
+ SkImage* onNewSubset(const SkIRect&) const override;
bool getROPixels(SkBitmap*, CachingHint) const override;
GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const override;
bool onIsLazyGenerated() const override { return true; }
@@ -73,7 +73,7 @@
return fCache->lockAsTexture(ctx, params, this);
}
-sk_sp<SkImage> SkImage_Generator::onMakeSubset(const SkIRect& subset) const {
+SkImage* SkImage_Generator::onNewSubset(const SkIRect& subset) const {
// TODO: make this lazy, by wrapping the subset inside a new generator or something
// For now, we do effectively what we did before, make it a raster
@@ -86,16 +86,13 @@
surface->getCanvas()->clear(0);
surface->getCanvas()->drawImage(this, SkIntToScalar(-subset.x()), SkIntToScalar(-subset.y()),
nullptr);
- return sk_sp<SkImage>(surface->newImageSnapshot());
+ return surface->newImageSnapshot();
}
-sk_sp<SkImage> SkImage::MakeFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
- if (!generator) {
- return nullptr;
- }
+SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
SkImageCacherator* cache = SkImageCacherator::NewFromGenerator(generator, subset);
if (!cache) {
return nullptr;
}
- return sk_make_sp<SkImage_Generator>(cache);
+ return new SkImage_Generator(cache);
}
« no previous file with comments | « src/image/SkImage_Base.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698