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

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..ef71b50d261a3b56243621cc3f8aee82dd93f160 100644
--- a/ash/display/multi_display_manager.cc
+++ b/ash/display/multi_display_manager.cc
@@ -148,6 +148,22 @@ 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;
+ for (DisplayList::iterator iter = displays_.begin();
oshima 2012/10/16 23:54:17 FindDisplayForId
Jun Mukai 2012/10/17 00:07:49 Thanks. But as far as I see, it returns a const r
oshima 2012/10/17 01:09:40 FindDisplayId returns non const reference. GetDisp
Jun Mukai 2012/10/17 15:45:46 Done.
+ iter != displays_.end(); ++iter) {
+ if (iter->id() == display_id) {
+ // Reimburse the existing insets before applying the new insets.
+ gfx::Rect bounds = iter->bounds_in_pixel();
+ gfx::Insets negated_insets = old_insets.Scale(-1);
+ bounds.Inset(negated_insets.Scale(iter->device_scale_factor()));
oshima 2012/10/16 23:54:17 Scale(- iter->device_scale_factor()); (or -1 *)
Jun Mukai 2012/10/17 00:07:49 Done.
+ iter->SetScaleAndBounds(iter->device_scale_factor(), bounds);
+ break;
+ }
+ }
+ }
overscan_mapping_[display_id] = insets_in_dip;
OnNativeDisplaysChanged(displays_);
}
« 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