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

Unified Diff: chrome/browser/thumbnails/thumbnail_tab_helper.cc

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseTOGO Created 8 years, 1 month 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
Index: chrome/browser/thumbnails/thumbnail_tab_helper.cc
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
index 992a695526707f659bf7afc4e6bb4284418eac7d..933ff2807c1ca7e3bd4230317403d81b0ec2f1df 100644
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
@@ -88,8 +88,8 @@ gfx::Size GetCopySizeForThumbnail(content::RenderWidgetHostView* view) {
ui::GetScaleFactorForNativeView(view->GetNativeView());
switch (scale_factor) {
case ui::SCALE_FACTOR_100P:
- copy_size = gfx::ToFlooredSize(
- copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
+ copy_size = gfx::ToFlooredSize(gfx::ScaleSize(
+ copy_size, ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
break;
case ui::SCALE_FACTOR_200P:
// Use the size as-is.
@@ -97,8 +97,8 @@ gfx::Size GetCopySizeForThumbnail(content::RenderWidgetHostView* view) {
default:
DLOG(WARNING) << "Unsupported scale factor. Use the same copy size as "
<< "ui::SCALE_FACTOR_100P";
- copy_size = gfx::ToFlooredSize(
- copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
+ copy_size = gfx::ToFlooredSize(gfx::ScaleSize(
+ copy_size, ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
break;
}
return copy_size;
@@ -113,7 +113,7 @@ gfx::Size GetThumbnailSizeInPixel() {
// crbug.com/159157.
float max_scale_factor =
ui::GetScaleFactorScale(ui::GetMaxScaleFactor());
- return gfx::ToFlooredSize(thumbnail_size.Scale(max_scale_factor));
+ return gfx::ToFlooredSize(gfx::ScaleSize(thumbnail_size, max_scale_factor));
}
// Returns the clipping rectangle that is used for creating a thumbnail with
« no previous file with comments | « chrome/browser/thumbnails/render_widget_snapshot_taker.cc ('k') | content/browser/renderer_host/backing_store_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698