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

Unified Diff: content/renderer/render_widget.cc

Issue 2258493002: Use ScaleToEnclosingRect when converting the viewport to window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index c9e985fad75c4b9c652c2f98d429a97ecca5f54f..f590cfa7689141d617bc8c3b0e7feded4733294a 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1515,15 +1515,10 @@ void RenderWidget::UpdateCompositionInfo(bool immediate_request) {
void RenderWidget::convertViewportToWindow(blink::WebRect* rect) {
if (IsUseZoomForDSFEnabled()) {
- float reverse = 1 / GetOriginalDeviceScaleFactor();
// TODO(oshima): We may need to allow pixel precision here as the the
// anchor element can be placed at half pixel.
- gfx::Rect window_rect =
- gfx::ScaleToEnclosedRect(gfx::Rect(*rect), reverse);
- rect->x = window_rect.x();
- rect->y = window_rect.y();
- rect->width = window_rect.width();
- rect->height = window_rect.height();
+ *rect =
+ gfx::ScaleToEnclosingRect(*rect, 1.f / GetOriginalDeviceScaleFactor());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698