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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 10837154: Mac HiDPI: Fix scale factor on external display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 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 | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 7408ae19a590733ec0cd67cdaa08c006277cbc2f..faf4d6a102fd35a713d587a1135e2f936c0a5286 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -368,10 +368,6 @@ void RenderWidgetHostViewMac::WasShown() {
if (!is_hidden_)
return;
- // Check if the backing scale factor changed while the tab was in the
- // background.
- [cocoa_view_ updateTabBackingStoreScaleFactor];
-
if (web_contents_switch_paint_time_.is_null())
web_contents_switch_paint_time_ = base::TimeTicks::Now();
is_hidden_ = false;
@@ -1436,6 +1432,7 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
renderWidgetHostView_.reset(r);
canBeKeyView_ = YES;
focusedPluginIdentifier_ = -1;
+ deviceScaleFactor_ = ScaleFactor(self);
// OpenGL support:
if ([self respondsToSelector:
@@ -2029,6 +2026,10 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
return;
float scaleFactor = ScaleFactor(self);
+ if (scaleFactor == deviceScaleFactor_)
+ return;
+ deviceScaleFactor_ = scaleFactor;
+
BackingStoreMac* backingStore = static_cast<BackingStoreMac*>(
renderWidgetHostView_->render_widget_host_->GetBackingStore(false));
if (backingStore) // NULL in hardware path.
@@ -2992,6 +2993,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
if (newWindow != lastWindow_) {
lastWindow_ = newWindow;
renderWidgetHostView_->WindowFrameChanged();
+ [self updateTabBackingStoreScaleFactor];
Nico 2012/08/08 00:35:17 why only for key views?
sail 2012/08/08 00:45:00 Oops. Fixed.
}
renderWidgetHostView_->ForceTextureReload();
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698