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

Unified Diff: chrome/browser/icon_loader_chromeos.cc

Issue 10332163: Revert 137075 - Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/browser/history/top_sites_unittest.cc ('k') | chrome/browser/icon_loader_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_chromeos.cc
===================================================================
--- chrome/browser/icon_loader_chromeos.cc (revision 137075)
+++ chrome/browser/icon_loader_chromeos.cc (working copy)
@@ -164,15 +164,15 @@
// Returns a copy of |source| that is |pixel_size| in width and height. If
// |pixel_size| is |kDoNotResize|, returns an unmodified copy of |source|.
// |source| must be a square image (width == height).
-SkBitmap GenerateBitmapWithSize(const SkBitmap& source, int pixel_size) {
- DCHECK(!source.isNull());
- DCHECK(source.width() == source.height());
+SkBitmap* GenerateBitmapWithSize(SkBitmap* source, int pixel_size) {
+ DCHECK(source);
+ DCHECK(source->width() == source->height());
- if (pixel_size == kDoNotResize || source.width() == pixel_size)
- return source;
+ if (pixel_size == kDoNotResize || source->width() == pixel_size)
+ return new SkBitmap(*source);
- return skia::ImageOperations::Resize(
- source, skia::ImageOperations::RESIZE_BEST, pixel_size, pixel_size);
+ return new SkBitmap(skia::ImageOperations::Resize(
+ *source, skia::ImageOperations::RESIZE_BEST, pixel_size, pixel_size));
}
int IconSizeToPixelSize(IconLoader::IconSize size) {
@@ -203,7 +203,7 @@
if (!gfx::PNGCodec::Decode(bytes->front(), bytes->size(), &bitmap))
NOTREACHED();
image_.reset(new gfx::Image(
- GenerateBitmapWithSize(bitmap, IconSizeToPixelSize(icon_size_))));
+ GenerateBitmapWithSize(&bitmap, IconSizeToPixelSize(icon_size_))));
target_message_loop_->PostTask(
FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this));
}
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | chrome/browser/icon_loader_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698