| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/system/chromeos/network/network_icon.h" | 5 #include "ash/system/chromeos/network/network_icon.h" |
| 6 | 6 |
| 7 #include "ash/system/chromeos/network/network_icon_animation.h" | 7 #include "ash/system/chromeos/network/network_icon_animation.h" |
| 8 #include "ash/system/chromeos/network/network_icon_animation_observer.h" | 8 #include "ash/system/chromeos/network/network_icon_animation_observer.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chromeos/network/device_state.h" | 10 #include "chromeos/network/device_state.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 typedef std::map<SizeKey, SkBitmap> SizeBitmapMap; | 195 typedef std::map<SizeKey, SkBitmap> SizeBitmapMap; |
| 196 static SizeBitmapMap* s_empty_bitmaps = new SizeBitmapMap; | 196 static SizeBitmapMap* s_empty_bitmaps = new SizeBitmapMap; |
| 197 | 197 |
| 198 SizeKey key(pixel_size.width(), pixel_size.height()); | 198 SizeKey key(pixel_size.width(), pixel_size.height()); |
| 199 | 199 |
| 200 SizeBitmapMap::iterator iter = s_empty_bitmaps->find(key); | 200 SizeBitmapMap::iterator iter = s_empty_bitmaps->find(key); |
| 201 if (iter != s_empty_bitmaps->end()) | 201 if (iter != s_empty_bitmaps->end()) |
| 202 return iter->second; | 202 return iter->second; |
| 203 | 203 |
| 204 SkBitmap empty; | 204 SkBitmap empty; |
| 205 empty.setConfig(SkBitmap::kARGB_8888_Config, key.first, key.second); | 205 empty.allocN32Pixels(key.first, key.second); |
| 206 empty.allocPixels(); | |
| 207 empty.eraseARGB(0, 0, 0, 0); | 206 empty.eraseARGB(0, 0, 0, 0); |
| 208 (*s_empty_bitmaps)[key] = empty; | 207 (*s_empty_bitmaps)[key] = empty; |
| 209 return empty; | 208 return empty; |
| 210 } | 209 } |
| 211 | 210 |
| 212 class EmptyImageSource: public gfx::ImageSkiaSource { | 211 class EmptyImageSource: public gfx::ImageSkiaSource { |
| 213 public: | 212 public: |
| 214 explicit EmptyImageSource(const gfx::Size& size) | 213 explicit EmptyImageSource(const gfx::Size& size) |
| 215 : size_(size) { | 214 : size_(size) { |
| 216 } | 215 } |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 iter != networks.end(); ++iter) { | 953 iter != networks.end(); ++iter) { |
| 955 network_paths.insert((*iter)->path()); | 954 network_paths.insert((*iter)->path()); |
| 956 } | 955 } |
| 957 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 956 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 958 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 957 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 959 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 958 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 960 } | 959 } |
| 961 | 960 |
| 962 } // namespace network_icon | 961 } // namespace network_icon |
| 963 } // namespace ash | 962 } // namespace ash |
| OLD | NEW |