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

Unified Diff: ash/launcher/launcher_button.cc

Issue 10453035: Clean up SkBitmapOperations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_button.cc
diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc
index 562b308a581b2d09bc55c446e313a0d4106b2eee..e7718453a68ee87c0d05cf6ab8fbbee44d74c02c 100644
--- a/ash/launcher/launcher_button.cc
+++ b/ash/launcher/launcher_button.cc
@@ -8,6 +8,7 @@
#include "ash/launcher/launcher_button_host.h"
#include "grit/ui_resources.h"
+#include "skia/ext/image_operations.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/throb_animation.h"
@@ -16,6 +17,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/shadow_value.h"
#include "ui/gfx/skbitmap_operations.h"
#include "ui/views/controls/image_view.h"
@@ -123,28 +125,14 @@ LauncherButton::~LauncherButton() {
}
void LauncherButton::SetShadowedImage(const SkBitmap& bitmap) {
- const SkColor kShadowColor[] = {
- SkColorSetARGB(0x1A, 0, 0, 0),
- SkColorSetARGB(0x1A, 0, 0, 0),
- SkColorSetARGB(0x54, 0, 0, 0),
- };
- const gfx::Point kShadowOffset[] = {
- gfx::Point(0, 2),
- gfx::Point(0, 3),
- gfx::Point(0, 0),
- };
- const SkScalar kShadowRadius[] = {
- SkIntToScalar(0),
- SkIntToScalar(1),
- SkIntToScalar(1),
+ const gfx::ShadowValue kShadows[] = {
+ gfx::ShadowValue(gfx::Point(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)),
+ gfx::ShadowValue(gfx::Point(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)),
+ gfx::ShadowValue(gfx::Point(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)),
};
SkBitmap shadowed_bitmap = SkBitmapOperations::CreateDropShadow(
- bitmap,
- arraysize(kShadowColor) - 1,
- kShadowColor,
- kShadowOffset,
- kShadowRadius);
+ bitmap, gfx::ShadowValues(kShadows, kShadows + arraysize(kShadows)));
icon_view_->SetImage(shadowed_bitmap);
}
@@ -176,8 +164,8 @@ void LauncherButton::SetImage(const SkBitmap& image) {
return;
}
- SkBitmap resized_image = SkBitmapOperations::CreateResizedBitmap(
- image, gfx::Size(width, height));
+ SkBitmap resized_image = skia::ImageOperations::Resize(
+ image, skia::ImageOperations::RESIZE_BEST, width, height);
SetShadowedImage(resized_image);
}
« no previous file with comments | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698