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

Unified Diff: chrome/browser/ui/views/tabs/tab.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/ui/views/tabs/tab.h ('k') | chrome/browser/ui/views/tabs/tab_drag_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 2056aac3cddc4849978da0321e4e648c0f804c35..4e0cfd153aacbbb22f096f454683d0d612f7e3b9 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -262,7 +262,7 @@ gfx::Size Tab::GetBasicMinimumUnselectedSize() {
gfx::Size minimum_size;
minimum_size.set_width(left_padding() + right_padding());
- // Since we use bitmap images, the real minimum height of the image is
+ // Since we use image images, the real minimum height of the image is
// defined most accurately by the height of the end cap images.
minimum_size.set_height(tab_active_.image_l->height());
return minimum_size;
@@ -518,7 +518,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
gfx::Canvas background_canvas(size(), false);
PaintInactiveTabBackground(&background_canvas);
- SkBitmap background_image = background_canvas.ExtractBitmap();
+ gfx::ImageSkia background_image = background_canvas.ExtractBitmap();
// Draw a radial gradient to hover_canvas.
gfx::Canvas hover_canvas(size(), false);
@@ -547,7 +547,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
paint);
// Draw the radial gradient clipped to the background into hover_image.
- SkBitmap hover_image = SkBitmapOperations::CreateMaskedBitmap(
+ gfx::ImageSkia hover_image = SkBitmapOperations::CreateMaskedBitmap(
hover_canvas.ExtractBitmap(), background_image);
// Draw the tab background to the canvas.
@@ -577,7 +577,7 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
IDR_THEME_TAB_BACKGROUND;
}
- SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(tab_id);
+ gfx::ImageSkia* tab_bg = GetThemeProvider()->GetImageSkiaNamed(tab_id);
TabImage* tab_image = &tab_active_;
TabImage* tab_inactive_image = &tab_inactive_;
@@ -589,16 +589,16 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
int bg_offset_y = GetThemeProvider()->HasCustomImage(tab_id) ?
0 : background_offset_.y();
- // We need a gfx::Canvas object to be able to extract the bitmap from.
+ // We need a gfx::Canvas object to be able to extract the image from.
// We draw everything to this canvas and then output it to the canvas
// parameter in addition to using it to mask the hover glow if needed.
gfx::Canvas background_canvas(size(), false);
// Draw left edge. Don't draw over the toolbar, as we're not the foreground
// tab.
- SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
+ gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, bg_offset_y, tab_image->l_width, height());
- SkBitmap theme_l =
+ gfx::ImageSkia theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
background_canvas.DrawBitmapInt(theme_l,
0, 0, theme_l.width(), theme_l.height() - kToolbarOverlap,
@@ -606,10 +606,10 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
false);
// Draw right edge. Again, don't draw over the toolbar.
- SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, bg_offset_y,
tab_image->r_width, height());
- SkBitmap theme_r =
+ gfx::ImageSkia theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
background_canvas.DrawBitmapInt(theme_r,
0, 0, theme_r.width(), theme_r.height() - kToolbarOverlap,
@@ -650,22 +650,23 @@ void Tab::PaintActiveTabBackground(gfx::Canvas* canvas) {
ui::ThemeProvider* tp = GetThemeProvider();
DCHECK(tp) << "Unable to get theme provider";
- SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR);
+ gfx::ImageSkia* tab_bg =
+ GetThemeProvider()->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
TabImage* tab_image = &tab_active_;
TabImage* alpha = &tab_alpha_;
// Draw left edge.
- SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
+ gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, 0, tab_image->l_width, height());
- SkBitmap theme_l =
+ gfx::ImageSkia theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
canvas->DrawBitmapInt(theme_l, 0, 0);
// Draw right edge.
- SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, 0, tab_image->r_width, height());
- SkBitmap theme_r =
+ gfx::ImageSkia theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
canvas->DrawBitmapInt(theme_r, width() - tab_image->r_width, 0);
@@ -746,18 +747,18 @@ void Tab::LoadTabImages() {
// We're not letting people override tab images just yet.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- tab_alpha_.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_LEFT);
- tab_alpha_.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_RIGHT);
+ tab_alpha_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_LEFT);
+ tab_alpha_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_RIGHT);
- tab_active_.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT);
- tab_active_.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER);
- tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT);
+ tab_active_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_LEFT);
+ tab_active_.image_c = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_CENTER);
+ tab_active_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT);
tab_active_.l_width = tab_active_.image_l->width();
tab_active_.r_width = tab_active_.image_r->width();
- tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
- tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
- tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
+ tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT);
+ tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER);
+ tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT);
tab_inactive_.l_width = tab_inactive_.image_l->width();
tab_inactive_.r_width = tab_inactive_.image_r->width();
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.h ('k') | chrome/browser/ui/views/tabs/tab_drag_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698