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

Unified Diff: chrome/browser/download/download_util.cc

Issue 10453101: Convert most of the rest of chrome to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « chrome/browser/download/download_util.h ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698