summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background/wallpaper_resizer.h
diff options
context:
space:
mode:
authorbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:20:19 +0000
committerbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:20:19 +0000
commitb6f09df67c0633dfaa0ef049c13df29e0b91e043 (patch)
treeb05401169da46cbe3184540bc9ece5d75efeb5cc /ash/desktop_background/wallpaper_resizer.h
parent2c3a4ab5b18a52414ff824c186e22d551a1b83ce (diff)
downloadchromium_src-b6f09df67c0633dfaa0ef049c13df29e0b91e043.zip
chromium_src-b6f09df67c0633dfaa0ef049c13df29e0b91e043.tar.gz
chromium_src-b6f09df67c0633dfaa0ef049c13df29e0b91e043.tar.bz2
Fix wrong CENTER_CROPPED resize in wallpaper_resizer and add some unittests
BUG=244629 Review URL: https://chromiumcodereview.appspot.com/15979025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background/wallpaper_resizer.h')
-rw-r--r--ash/desktop_background/wallpaper_resizer.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/ash/desktop_background/wallpaper_resizer.h b/ash/desktop_background/wallpaper_resizer.h
index eb7e1d5..9b47b7c 100644
--- a/ash/desktop_background/wallpaper_resizer.h
+++ b/ash/desktop_background/wallpaper_resizer.h
@@ -11,17 +11,19 @@
#include "base/observer_list.h"
#include "skia/ext/image_operations.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/size.h"
namespace ash {
class WallpaperResizerObserver;
-// Stores the current wallpaper data and resize it to fit all screens if needed.
+// Stores the current wallpaper data and resize it to |target_size| if needed.
class ASH_EXPORT WallpaperResizer {
public:
- explicit WallpaperResizer(const WallpaperInfo& info);
+ WallpaperResizer(const WallpaperInfo& info, const gfx::Size& target_size);
- WallpaperResizer(const WallpaperInfo& info, const gfx::ImageSkia& image);
+ WallpaperResizer(const WallpaperInfo& info, const gfx::Size& target_size,
+ const gfx::ImageSkia& image);
virtual ~WallpaperResizer();
@@ -44,6 +46,8 @@ class ASH_EXPORT WallpaperResizer {
const WallpaperInfo wallpaper_info_;
+ gfx::Size target_size_;
+
gfx::ImageSkia wallpaper_image_;
base::WeakPtrFactory<WallpaperResizer> weak_ptr_factory_;