| Index: chrome/browser/download/download_util.cc
|
| diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
|
| index 4d2e3ca229ca2bf5208a45a5a6fc2b36e37daeba..1119df0b9e25d909481f9a8b415a8fed7bb3d179 100644
|
| --- a/chrome/browser/download/download_util.cc
|
| +++ b/chrome/browser/download/download_util.cc
|
| @@ -183,13 +183,13 @@ void GenerateFileNameFromRequest(const DownloadItem& download_item,
|
|
|
| // Download progress painting --------------------------------------------------
|
|
|
| -// Common bitmaps used for download progress animations. We load them once the
|
| +// Common images used for download progress animations. We load them once the
|
| // first time we do a progress paint, then reuse them as they are always the
|
| // same.
|
| -SkBitmap* g_foreground_16 = NULL;
|
| -SkBitmap* g_background_16 = NULL;
|
| -SkBitmap* g_foreground_32 = NULL;
|
| -SkBitmap* g_background_32 = NULL;
|
| +gfx::ImageSkia* g_foreground_16 = NULL;
|
| +gfx::ImageSkia* g_background_16 = NULL;
|
| +gfx::ImageSkia* g_foreground_32 = NULL;
|
| +gfx::ImageSkia* g_background_32 = NULL;
|
|
|
| void PaintDownloadProgress(gfx::Canvas* canvas,
|
| #if defined(TOOLKIT_VIEWS)
|
| @@ -200,22 +200,24 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
|
| int start_angle,
|
| int percent_done,
|
| PaintDownloadProgressSize size) {
|
| - // Load up our common bitmaps
|
| + // Load up our common images
|
| if (!g_background_16) {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| - g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| - g_background_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
|
| - g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| - g_background_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
|
| + g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| + g_background_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
|
| + g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| + g_background_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
|
| }
|
|
|
| - SkBitmap* background = (size == BIG) ? g_background_32 : g_background_16;
|
| - SkBitmap* foreground = (size == BIG) ? g_foreground_32 : g_foreground_16;
|
| + gfx::ImageSkia* background =
|
| + (size == BIG) ? g_background_32 : g_background_16;
|
| + gfx::ImageSkia* foreground =
|
| + (size == BIG) ? g_foreground_32 : g_foreground_16;
|
|
|
| const int kProgressIconSize = (size == BIG) ? kBigProgressIconSize :
|
| kSmallProgressIconSize;
|
|
|
| - // We start by storing the bounds of the background and foreground bitmaps
|
| + // We start by storing the bounds of the background and foreground images
|
| // so that it is easy to mirror the bounds if the UI layout is RTL.
|
| gfx::Rect background_bounds(origin_x, origin_y,
|
| background->width(), background->height());
|
| @@ -298,14 +300,14 @@ void PaintDownloadComplete(gfx::Canvas* canvas,
|
| int origin_y,
|
| double animation_progress,
|
| PaintDownloadProgressSize size) {
|
| - // Load up our common bitmaps.
|
| + // Load up our common images.
|
| if (!g_foreground_16) {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| - g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| - g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| + g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| + g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| }
|
|
|
| - SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
|
| + gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
|
|
|
| gfx::Rect complete_bounds(origin_x, origin_y,
|
| complete->width(), complete->height());
|
| @@ -330,14 +332,14 @@ void PaintDownloadInterrupted(gfx::Canvas* canvas,
|
| int origin_y,
|
| double animation_progress,
|
| PaintDownloadProgressSize size) {
|
| - // Load up our common bitmaps.
|
| + // Load up our common images.
|
| if (!g_foreground_16) {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| - g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| - g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| + g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
|
| + g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
|
| }
|
|
|
| - SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
|
| + gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
|
|
|
| gfx::Rect complete_bounds(origin_x, origin_y,
|
| complete->width(), complete->height());
|
|
|