OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/browser_theme_provider.h" | 5 #include "chrome/browser/browser_theme_provider.h" |
6 | 6 |
7 #include "base/gfx/gtk_util.h" | 7 #include "base/gfx/gtk_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 GdkPixbuf* BrowserThemeProvider::GetPixbufNamed(int id) { | 10 GdkPixbuf* BrowserThemeProvider::GetPixbufNamed(int id) { |
(...skipping 23 matching lines...) Expand all Loading... |
34 // This bitmap will be leaked, but this code should never be hit. | 34 // This bitmap will be leaked, but this code should never be hit. |
35 scoped_ptr<SkBitmap> skia_bitmap(new SkBitmap()); | 35 scoped_ptr<SkBitmap> skia_bitmap(new SkBitmap()); |
36 skia_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32); | 36 skia_bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32); |
37 skia_bitmap->allocPixels(); | 37 skia_bitmap->allocPixels(); |
38 skia_bitmap->eraseARGB(255, 255, 0, 0); | 38 skia_bitmap->eraseARGB(255, 255, 0, 0); |
39 empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap.get()); | 39 empty_bitmap = gfx::GdkPixbufFromSkBitmap(skia_bitmap.get()); |
40 } | 40 } |
41 return empty_bitmap; | 41 return empty_bitmap; |
42 } | 42 } |
43 | 43 |
44 void BrowserThemeProvider::FreePlatformImages() { | 44 void BrowserThemeProvider::FreePlatformCaches() { |
45 DCHECK(CalledOnValidThread()); | 45 DCHECK(CalledOnValidThread()); |
46 | 46 |
47 // Free GdkPixbufs. | 47 // Free GdkPixbufs. |
48 for (GdkPixbufMap::iterator i = gdk_pixbufs_.begin(); | 48 for (GdkPixbufMap::iterator i = gdk_pixbufs_.begin(); |
49 i != gdk_pixbufs_.end(); i++) { | 49 i != gdk_pixbufs_.end(); i++) { |
50 g_object_unref(i->second); | 50 g_object_unref(i->second); |
51 } | 51 } |
52 gdk_pixbufs_.clear(); | 52 gdk_pixbufs_.clear(); |
53 } | 53 } |
OLD | NEW |