diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/desktop_background/wallpaper_resizer_unittest.cc | 6 | ||||
-rw-r--r-- | ash/display/mirror_window_controller.cc | 5 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller_unittest.cc | 2 | ||||
-rw-r--r-- | ash/drag_drop/drag_image_view.cc | 8 | ||||
-rw-r--r-- | ash/launcher/launcher_delegate.h | 4 | ||||
-rw-r--r-- | ash/launcher/launcher_item_delegate_manager.cc | 2 | ||||
-rw-r--r-- | ash/shell/app_list.cc | 3 | ||||
-rw-r--r-- | ash/shell/window_watcher.cc | 3 | ||||
-rw-r--r-- | ash/system/chromeos/network/network_icon.cc | 14 | ||||
-rw-r--r-- | ash/wm/frame_painter.cc | 2 |
10 files changed, 21 insertions, 28 deletions
diff --git a/ash/desktop_background/wallpaper_resizer_unittest.cc b/ash/desktop_background/wallpaper_resizer_unittest.cc index 5761b67..8447307 100644 --- a/ash/desktop_background/wallpaper_resizer_unittest.cc +++ b/ash/desktop_background/wallpaper_resizer_unittest.cc @@ -104,16 +104,14 @@ TEST_F(WallpaperResizerTest, BasicResize) { for (int i = 0; i < length; i++) { WallpaperLayout layout = layouts[i]; - gfx::ImageSkia small_image(gfx::ImageSkiaRep(gfx::Size(10, 20), - ui::SCALE_FACTOR_100P)); + gfx::ImageSkia small_image(gfx::ImageSkiaRep(gfx::Size(10, 20), 1.0f)); gfx::ImageSkia resized_small = Resize(small_image, gfx::Size(800, 600), layout); EXPECT_EQ(10, resized_small.width()); EXPECT_EQ(20, resized_small.height()); - gfx::ImageSkia large_image(gfx::ImageSkiaRep(gfx::Size(1000, 1000), - ui::SCALE_FACTOR_100P)); + gfx::ImageSkia large_image(gfx::ImageSkiaRep(gfx::Size(1000, 1000), 1.0f)); gfx::ImageSkia resized_large = Resize(large_image, gfx::Size(800, 600), layout); EXPECT_EQ(800, resized_large.width()); diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc index 5ca7cec..3429df7 100644 --- a/ash/display/mirror_window_controller.cc +++ b/ash/display/mirror_window_controller.cc @@ -127,10 +127,8 @@ class CursorWindowDelegate : public aura::WindowDelegate { // take 2x's image and paint as if it's 1x image. void SetCursorImage(const gfx::ImageSkia& image, const gfx::Display& display) { - device_scale_factor_ = - ui::GetScaleFactorFromScale(display.device_scale_factor()); const gfx::ImageSkiaRep& image_rep = - image.GetRepresentation(device_scale_factor_); + image.GetRepresentation(display.device_scale_factor()); size_ = image_rep.pixel_size(); cursor_image_ = gfx::ImageSkia::CreateFrom1xBitmap(image_rep.sk_bitmap()); } @@ -139,7 +137,6 @@ class CursorWindowDelegate : public aura::WindowDelegate { private: gfx::ImageSkia cursor_image_; - ui::ScaleFactor device_scale_factor_; gfx::Size size_; DISALLOW_COPY_AND_ASSIGN(CursorWindowDelegate); diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index ba46192..0cd770e 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -77,7 +77,7 @@ class DragTestView : public views::View { virtual void WriteDragData(const gfx::Point& p, OSExchangeData* data) OVERRIDE { data->SetString(UTF8ToUTF16("I am being dragged")); - gfx::ImageSkiaRep image_rep(gfx::Size(10, 20), ui::SCALE_FACTOR_100P); + gfx::ImageSkiaRep image_rep(gfx::Size(10, 20), 1.0f); gfx::ImageSkia image_skia(image_rep); drag_utils::SetDragImageOnDataObject( diff --git a/ash/drag_drop/drag_image_view.cc b/ash/drag_drop/drag_image_view.cc index 5d0f2be..84eef1e 100644 --- a/ash/drag_drop/drag_image_view.cc +++ b/ash/drag_drop/drag_image_view.cc @@ -90,21 +90,17 @@ void DragImageView::OnPaint(gfx::Canvas* canvas) { device_scale = ui::GetDeviceScaleFactor( widget_->GetNativeView()->layer()); } - ui::ScaleFactor device_scale_factor = - ui::GetScaleFactorFromScale(device_scale); - // The drag image already has device scale factor applied. But // |widget_size_| is in DIP units. gfx::Size scaled_widget_size = gfx::ToRoundedSize( gfx::ScaleSize(widget_size_, device_scale)); - gfx::ImageSkiaRep image_rep = GetImage().GetRepresentation( - device_scale_factor); + gfx::ImageSkiaRep image_rep = GetImage().GetRepresentation(device_scale); if (image_rep.is_null()) return; SkBitmap scaled = skia::ImageOperations::Resize( image_rep.sk_bitmap(), skia::ImageOperations::RESIZE_LANCZOS3, scaled_widget_size.width(), scaled_widget_size.height()); - gfx::ImageSkia image_skia(gfx::ImageSkiaRep(scaled, device_scale_factor)); + gfx::ImageSkia image_skia(gfx::ImageSkiaRep(scaled, device_scale)); canvas->DrawImageInt(image_skia, 0, 0); } } diff --git a/ash/launcher/launcher_delegate.h b/ash/launcher/launcher_delegate.h index 06e0445..41d0c29 100644 --- a/ash/launcher/launcher_delegate.h +++ b/ash/launcher/launcher_delegate.h @@ -8,6 +8,10 @@ #include "ash/ash_export.h" #include "ash/launcher/launcher_types.h" +namespace aura { +class Window; +} + namespace ash { class Launcher; diff --git a/ash/launcher/launcher_item_delegate_manager.cc b/ash/launcher/launcher_item_delegate_manager.cc index 65fb0f0..1708fe6 100644 --- a/ash/launcher/launcher_item_delegate_manager.cc +++ b/ash/launcher/launcher_item_delegate_manager.cc @@ -4,6 +4,8 @@ #include "ash/launcher/launcher_item_delegate_manager.h" +#include "base/logging.h" + namespace ash { LauncherItemDelegateManager::LauncherItemDelegateManager() { diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc index f0dae34..25306b3 100644 --- a/ash/shell/app_list.cc +++ b/ash/shell/app_list.cc @@ -204,8 +204,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { const base::string16 icon_text = ASCIIToUTF16("ash"); const gfx::Size icon_size(32, 32); - gfx::Canvas canvas(icon_size, ui::SCALE_FACTOR_100P, - false /* is_opaque */); + gfx::Canvas canvas(icon_size, 1.0f, false /* is_opaque */); canvas.DrawStringInt(icon_text, gfx::Font(), SK_ColorBLACK, diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc index 4dfcea4..f076483 100644 --- a/ash/shell/window_watcher.cc +++ b/ash/shell/window_watcher.cc @@ -118,8 +118,7 @@ void WindowWatcher::OnWindowAdded(aura::Window* new_window) { image_count == 1 ? 255 : 0, image_count == 2 ? 255 : 0); image_count = (image_count + 1) % 3; - item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, - ui::SCALE_FACTOR_100P)); + item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f)); model->Add(item); } diff --git a/ash/system/chromeos/network/network_icon.cc b/ash/system/chromeos/network/network_icon.cc index 5e914e7..d3c4899 100644 --- a/ash/system/chromeos/network/network_icon.cc +++ b/ash/system/chromeos/network/network_icon.cc @@ -196,13 +196,12 @@ class EmptyImageSource: public gfx::ImageSkiaSource { : size_(size) { } - virtual gfx::ImageSkiaRep GetImageForScale( - ui::ScaleFactor scale_factor) OVERRIDE { - gfx::Size pixel_size = gfx::ToFlooredSize( - gfx::ScaleSize(size_, ui::GetScaleFactorScale(scale_factor))); + virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { + gfx::Size pixel_size = gfx::ToFlooredSize(gfx::ScaleSize(size_, scale)); SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size); - return gfx::ImageSkiaRep(empty_bitmap, scale_factor); + return gfx::ImageSkiaRep(empty_bitmap, scale); } + private: const gfx::Size size_; @@ -220,9 +219,8 @@ class NetworkIconImageSource : public gfx::ImageSkiaSource { // TODO(pkotwicz): Figure out what to do when a new image resolution becomes // available. - virtual gfx::ImageSkiaRep GetImageForScale( - ui::ScaleFactor scale_factor) OVERRIDE { - gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale_factor); + virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { + gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale); if (icon_rep.is_null()) return gfx::ImageSkiaRep(); gfx::Canvas canvas(icon_rep, false); diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc index b27fc7b..0e53e33 100644 --- a/ash/wm/frame_painter.cc +++ b/ash/wm/frame_painter.cc @@ -136,7 +136,7 @@ void PaintFrameImagesInRoundRect(gfx::Canvas* canvas, top_left_corner_radius, top_right_corner_radius, 0); } } else { - gfx::Canvas temporary_canvas(bounds.size(), canvas->scale_factor(), false); + gfx::Canvas temporary_canvas(bounds.size(), canvas->image_scale(), false); temporary_canvas.TileImageInt(*frame_image, image_inset_x, 0, 0, 0, |