| Index: ui/app_list/app_list_item_view.cc
|
| diff --git a/ui/app_list/app_list_item_view.cc b/ui/app_list/app_list_item_view.cc
|
| index 714bf327055da6d1584f493bc6aa10bac00752a6..516769598db2590953dba072c31b40c0e4998b0d 100644
|
| --- a/ui/app_list/app_list_item_view.cc
|
| +++ b/ui/app_list/app_list_item_view.cc
|
| @@ -11,7 +11,6 @@
|
| #include "base/synchronization/cancellation_flag.h"
|
| #include "base/threading/worker_pool.h"
|
| #include "base/utf_string_conversions.h"
|
| -#include "skia/ext/image_operations.h"
|
| #include "ui/app_list/app_list_item_model.h"
|
| #include "ui/app_list/apps_grid_view.h"
|
| #include "ui/app_list/drop_shadow_label.h"
|
| @@ -21,7 +20,8 @@
|
| #include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/font.h"
|
| -#include "ui/gfx/skbitmap_operations.h"
|
| +#include "ui/gfx/image/image_skia_operations.h"
|
| +#include "ui/gfx/screen.h"
|
| #include "ui/views/controls/image_view.h"
|
| #include "ui/views/controls/menu/menu_item_view.h"
|
| #include "ui/views/controls/menu/menu_model_adapter.h"
|
| @@ -85,10 +85,10 @@ const char AppListItemView::kViewClassName[] = "ui/app_list/AppListItemView";
|
| class AppListItemView::IconOperation
|
| : public base::RefCountedThreadSafe<AppListItemView::IconOperation> {
|
| public:
|
| - IconOperation(const SkBitmap& bitmap,
|
| + IconOperation(const gfx::ImageSkia& image,
|
| const gfx::Size& size,
|
| const gfx::ShadowValues& shadows)
|
| - : bitmap_(bitmap),
|
| + : image_(image),
|
| size_(size),
|
| shadows_(shadows) {
|
| }
|
| @@ -101,23 +101,22 @@ class AppListItemView::IconOperation
|
| if (cancel_flag_.IsSet())
|
| return;
|
|
|
| - if (size_ != gfx::Size(bitmap_.width(), bitmap_.height())) {
|
| - bitmap_ = skia::ImageOperations::Resize(bitmap_,
|
| - skia::ImageOperations::RESIZE_BEST, size_.width(), size_.height());
|
| - }
|
| + gfx::ImageSkia resized(
|
| + gfx::ImageSkiaOperations::CreateResizedImage(image_, size_));
|
| + gfx::ImageSkia shadow(
|
| + gfx::ImageSkiaOperations::CreateDropShadowImage(resized, shadows_));
|
|
|
| - if (cancel_flag_.IsSet())
|
| - return;
|
| -
|
| - bitmap_ = SkBitmapOperations::CreateDropShadow(bitmap_, shadows_);
|
| + // The following statement causes shadowed image being generated.
|
| + image_ = shadow.GetRepresentation(gfx::Screen::IsDIPEnabled() ?
|
| + ui::SCALE_FACTOR_200P : ui::SCALE_FACTOR_100P);
|
| }
|
|
|
| void Cancel() {
|
| cancel_flag_.Set();
|
| }
|
|
|
| - const SkBitmap& bitmap() const {
|
| - return bitmap_;
|
| + const gfx::ImageSkia& image() const {
|
| + return image_;
|
| }
|
|
|
| private:
|
| @@ -126,7 +125,7 @@ class AppListItemView::IconOperation
|
|
|
| base::CancellationFlag cancel_flag_;
|
|
|
| - SkBitmap bitmap_;
|
| + gfx::ImageSkia image_;
|
| const gfx::Size size_;
|
| const gfx::ShadowValues shadows_;
|
|
|
| @@ -180,7 +179,7 @@ void AppListItemView::UpdateIcon() {
|
| if (icon_size_.IsEmpty())
|
| return;
|
|
|
| - SkBitmap icon = model_->icon();
|
| + gfx::ImageSkia icon = model_->icon();
|
| // Clear icon and bail out if model icon is empty.
|
| if (icon.empty()) {
|
| icon_->SetImage(NULL);
|
| @@ -189,7 +188,7 @@ void AppListItemView::UpdateIcon() {
|
|
|
| CancelPendingIconOperation();
|
|
|
| - SkBitmap shadow;
|
| + gfx::ImageSkia shadow;
|
| if (IconCache::GetInstance()->Get(icon, icon_size_, &shadow)) {
|
| icon_->SetImage(shadow);
|
| } else {
|
| @@ -215,8 +214,8 @@ void AppListItemView::CancelPendingIconOperation() {
|
| }
|
|
|
| void AppListItemView::ApplyShadow(scoped_refptr<IconOperation> op) {
|
| - icon_->SetImage(op->bitmap());
|
| - IconCache::GetInstance()->Put(model_->icon(), icon_size_, op->bitmap());
|
| + icon_->SetImage(op->image());
|
| + IconCache::GetInstance()->Put(model_->icon(), icon_size_, op->image());
|
|
|
| DCHECK(op.get() == icon_op_.get());
|
| icon_op_ = NULL;
|
|
|