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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 366543004: Make 1.5x DPI text render crisply. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reorder methods Created 6 years, 5 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index f0cce6521220a903c2b50270e36df23258510291..eaefc275b47d4924d9565e4d6b1b93c19c9f017e 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -547,6 +547,12 @@ class WebContentsViewAura::WindowObserver
if (window != view_->window_)
return;
+ // Use the new parent's root window for calculating HiDPI subpixel offset.
+ RenderWidgetHostViewAura* rwhv = ToRenderWidgetHostViewAura(
+ view_->web_contents_->GetRenderWidgetHostView());
+ if (rwhv)
+ rwhv->SnapToPhysicalPixelBoundary();
+
aura::Window* host_window =
window->GetProperty(aura::client::kHostWindowKey);
if (!host_window)
@@ -561,10 +567,8 @@ class WebContentsViewAura::WindowObserver
for (size_t i = 0; i < children.size(); ++i)
children[i]->RemoveObserver(this);
- RenderWidgetHostViewAura* view = ToRenderWidgetHostViewAura(
- view_->web_contents_->GetRenderWidgetHostView());
- if (view)
- view->UpdateConstrainedWindowRects(std::vector<gfx::Rect>());
+ if (rwhv)
+ rwhv->UpdateConstrainedWindowRects(std::vector<gfx::Rect>());
}
// When we get parented to the root window, the code below will watch the
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698