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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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.cc ('k') | chrome/browser/ui/web_applications/web_app_ui.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_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index f59e661c16492ab8beadb07e7d08bb10c42039b6..5e40997df46ccecaa29823894266503ba9d431c0 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -394,7 +394,8 @@ void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) {
#endif
void NewTabButton::OnPaint(gfx::Canvas* canvas) {
- gfx::ImageSkia image = GetImageForScale(canvas->scale_factor());
+ gfx::ImageSkia image =
+ GetImageForScale(ui::GetSupportedScaleFactor(canvas->image_scale()));
canvas->DrawImageInt(image, 0, height() - image.height());
}
@@ -444,12 +445,12 @@ gfx::ImageSkia NewTabButton::GetBackgroundImage(
GetThemeProvider()->GetImageSkiaNamed(IDR_NEWTAB_BUTTON_MASK);
int height = mask->height();
int width = mask->width();
-
+ float scale = ui::GetImageScale(scale_factor);
// The canvas and mask has to use the same scale factor.
- if (!mask->HasRepresentation(scale_factor))
+ if (!mask->HasRepresentation(scale))
scale_factor = ui::SCALE_FACTOR_100P;
- gfx::Canvas canvas(gfx::Size(width, height), scale_factor, false);
+ gfx::Canvas canvas(gfx::Size(width, height), scale, false);
// For custom images the background starts at the top of the tab strip.
// Otherwise the background starts at the top of the frame.
@@ -495,7 +496,9 @@ gfx::ImageSkia NewTabButton::GetImageForState(
gfx::ImageSkia* overlay = GetThemeProvider()->GetImageSkiaNamed(overlay_id);
gfx::Canvas canvas(
- gfx::Size(overlay->width(), overlay->height()), scale_factor, false);
+ gfx::Size(overlay->width(), overlay->height()),
+ ui::GetImageScale(scale_factor),
+ false);
canvas.DrawImageInt(GetBackgroundImage(state, scale_factor), 0, 0);
// Draw the button border with a slight alpha.
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/web_applications/web_app_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698