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

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

Issue 11081007: Remove implicit flooring Scale() method from Point and Size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
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 fc08f8db4f1a960492225fc6782b6fc8f6c935a9..b17b1648d777bbff3cdb7fa08ab9a57301c3cd75 100644
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc
@@ -16,6 +16,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/color_utils.h"
+#include "ui/gfx/size_conversions.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/scrollbar_size.h"
#include "ui/gfx/skbitmap_operations.h"
@@ -86,8 +87,8 @@ gfx::Size GetCopySizeForThumbnail(content::RenderWidgetHostView* view) {
ui::GetScaleFactorForNativeView(view->GetNativeView());
switch (scale_factor) {
case ui::SCALE_FACTOR_100P:
- copy_size =
- copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P));
+ copy_size = gfx::ToFlooredSize(
+ copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
break;
case ui::SCALE_FACTOR_200P:
// Use the size as-is.
@@ -95,8 +96,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 =
- copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P));
+ copy_size = gfx::ToFlooredSize(
+ copy_size.Scale(ui::GetScaleFactorScale(ui::SCALE_FACTOR_200P)));
break;
}
return copy_size;
@@ -108,7 +109,8 @@ gfx::Size GetThumbnailSizeInPixel() {
// Determine the resolution of the thumbnail based on the primary monitor.
// TODO(oshima): Use device's default scale factor.
gfx::Display primary_display = gfx::Screen::GetPrimaryDisplay();
- return thumbnail_size.Scale(primary_display.device_scale_factor());
+ return gfx::ToFlooredSize(
+ thumbnail_size.Scale(primary_display.device_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