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

Unified Diff: ash/display/multi_display_manager.cc

Issue 11140006: Fix code around display overscan settings. (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
« no previous file with comments | « no previous file | ash/display/multi_display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/multi_display_manager.cc
diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc
index aba85f02e5af38321ebd2485eeec50d0a70b6d03..9bda2d721808e61be3b5fa52c1181ebd3307d762 100644
--- a/ash/display/multi_display_manager.cc
+++ b/ash/display/multi_display_manager.cc
@@ -148,6 +148,18 @@ const gfx::Display& MultiDisplayManager::FindDisplayContainingPoint(
void MultiDisplayManager::SetOverscanInsets(int64 display_id,
const gfx::Insets& insets_in_dip) {
+ std::map<int64, gfx::Insets>::const_iterator old_overscan =
+ overscan_mapping_.find(display_id);
+ if (old_overscan != overscan_mapping_.end()) {
+ gfx::Insets old_insets = old_overscan->second;
+ gfx::Display& display = FindDisplayForId(display_id);
+ if (display.id() != gfx::Display::kInvalidDisplayID) {
oshima 2012/10/17 16:34:09 Can you add Display::is_valid() and use here?
Jun Mukai 2012/10/17 16:53:40 Done.
+ // Reimburse the existing insets before applying the new insets.
+ gfx::Rect bounds = display.bounds_in_pixel();
+ bounds.Inset(old_insets.Scale(-display.device_scale_factor()));
+ display.SetScaleAndBounds(display.device_scale_factor(), bounds);
+ }
+ }
overscan_mapping_[display_id] = insets_in_dip;
OnNativeDisplaysChanged(displays_);
}
@@ -446,7 +458,7 @@ gfx::Display& MultiDisplayManager::FindDisplayForId(int64 id) {
if ((*iter).id() == id)
return *iter;
}
- DLOG(FATAL) << "Could not find display:" << id;
+ DLOG(WARNING) << "Could not find display:" << id;
return GetInvalidDisplay();
}
« no previous file with comments | « no previous file | ash/display/multi_display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698