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

Unified Diff: chrome/browser/themes/theme_service_gtk.cc

Issue 10377122: Convert GdkPixbufFromSkBitmap and GdkPixbufToSkBitmap (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
Index: chrome/browser/themes/theme_service_gtk.cc
diff --git a/chrome/browser/themes/theme_service_gtk.cc b/chrome/browser/themes/theme_service_gtk.cc
index e096898a7af390be8e7a31cf96cb520546ea1729..4cd16df22393ec1e00764162c72ce5957208cca4 100644
--- a/chrome/browser/themes/theme_service_gtk.cc
+++ b/chrome/browser/themes/theme_service_gtk.cc
@@ -27,7 +27,7 @@ GdkPixbuf* ThemeService::GetPixbufImpl(int id, bool rtl_enabled) const {
return pixbufs_iter->second;
SkBitmap* bitmap = GetBitmapNamed(id);
- GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(bitmap);
+ GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(*bitmap);
// We loaded successfully. Cache the pixbuf.
if (pixbuf) {
@@ -48,12 +48,11 @@ GdkPixbuf* ThemeService::GetPixbufImpl(int id, bool rtl_enabled) const {
static GdkPixbuf* empty_bitmap = NULL;
if (!empty_bitmap) {
// The placeholder bitmap is bright red so people notice the problem.
- // This bitmap will be leaked, but this code should never be hit.
- scoped_ptr<SkBitmap> skia_bitmap(new SkBitmap());
- skia_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32);
- skia_bitmap->allocPixels();
- skia_bitmap->eraseARGB(255, 255, 0, 0);
- empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap.get());
+ SkBitmap skia_bitmap;
+ skia_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32);
+ skia_bitmap.allocPixels();
+ skia_bitmap.eraseARGB(255, 255, 0, 0);
+ empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap);
}
return empty_bitmap;
}
« no previous file with comments | « chrome/browser/speech/speech_recognition_bubble_gtk.cc ('k') | chrome/browser/ui/gtk/avatar_menu_item_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698