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

Unified Diff: ash/system/power/tray_power.cc

Issue 10824359: Remove ImageSkia::empty and ImageSkia::extractSubset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « ash/launcher/tabbed_launcher_button.cc ('k') | chrome/browser/chromeos/login/user_image.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/tray_power.cc
diff --git a/ash/system/power/tray_power.cc b/ash/system/power/tray_power.cc
index 09ac2d95f09ba7caea1292532ae838d2b2d44219..48d3f3c7a123ac8e2420f538c873337ad84c08ea 100644
--- a/ash/system/power/tray_power.cc
+++ b/ash/system/power/tray_power.cc
@@ -24,6 +24,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/size.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/text_button.h"
@@ -126,7 +127,6 @@ TrayPower::~TrayPower() {
gfx::ImageSkia TrayPower::GetBatteryImage(
const PowerSupplyStatus& supply_status,
IconSet icon_set) {
- gfx::ImageSkia image;
gfx::Image all = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
icon_set == ICON_DARK ?
IDR_AURA_UBER_TRAY_POWER_SMALL_DARK : IDR_AURA_UBER_TRAY_POWER_SMALL);
@@ -145,12 +145,11 @@ gfx::ImageSkia TrayPower::GetBatteryImage(
// TODO(mbolohan): Remove the 2px offset when the assets are centered. See
// crbug.com/119832.
- SkIRect region = SkIRect::MakeXYWH(
+ gfx::Rect region(
(supply_status.line_power_on ? kBatteryImageWidth : 0) + 2,
image_index * kBatteryImageHeight,
kBatteryImageWidth - 2, kBatteryImageHeight);
- all.ToImageSkia()->extractSubset(&image, region);
- return image;
+ return gfx::ImageSkiaOperations::ExtractSubset(*all.ToImageSkia(), region);
}
views::View* TrayPower::CreateTrayView(user::LoginStatus status) {
« no previous file with comments | « ash/launcher/tabbed_launcher_button.cc ('k') | chrome/browser/chromeos/login/user_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698