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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/display/multi_display_manager_unittest.cc » ('j') | ui/gfx/display.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/multi_display_manager.h" 5 #include "ash/display/multi_display_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/display/display_controller.h" 10 #include "ash/display/display_controller.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 new_displays.push_back(*internal_display_.get()); 190 new_displays.push_back(*internal_display_.get());
191 } 191 }
192 } else { 192 } else {
193 new_displays = updated_displays; 193 new_displays = updated_displays;
194 } 194 }
195 195
196 for (DisplayList::iterator iter = new_displays.begin(); 196 for (DisplayList::iterator iter = new_displays.begin();
197 iter != new_displays.end(); ++iter) { 197 iter != new_displays.end(); ++iter) {
198 std::map<int64, gfx::Insets>::const_iterator overscan_insets = 198 std::map<int64, gfx::Insets>::const_iterator overscan_insets =
199 overscan_mapping_.find(iter->id()); 199 overscan_mapping_.find(iter->id());
200 if (overscan_insets != overscan_mapping_.end()) { 200 if (overscan_insets != overscan_mapping_.end())
201 gfx::Rect bounds = iter->bounds_in_pixel(); 201 iter->SetOverscanInsets(overscan_insets->second);
202 bounds.Inset(overscan_insets->second.Scale(iter->device_scale_factor()));
203 iter->SetScaleAndBounds(iter->device_scale_factor(), bounds);
204 }
205 } 202 }
206 203
207 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); 204 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor());
208 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor()); 205 std::sort(new_displays.begin(), new_displays.end(), DisplaySortFunctor());
209 DisplayList removed_displays; 206 DisplayList removed_displays;
210 std::vector<size_t> changed_display_indices; 207 std::vector<size_t> changed_display_indices;
211 std::vector<size_t> added_display_indices; 208 std::vector<size_t> added_display_indices;
212 gfx::Display current_primary; 209 gfx::Display current_primary;
213 if (Shell::HasInstance()) 210 if (Shell::HasInstance())
214 current_primary = Shell::GetScreen()->GetPrimaryDisplay(); 211 current_primary = Shell::GetScreen()->GetPrimaryDisplay();
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 DisplayList::iterator iter_to_update = to_update->begin(); 466 DisplayList::iterator iter_to_update = to_update->begin();
470 DisplayList::const_iterator iter = displays_.begin(); 467 DisplayList::const_iterator iter = displays_.begin();
471 for (; iter != displays_.end() && iter_to_update != to_update->end(); 468 for (; iter != displays_.end() && iter_to_update != to_update->end();
472 ++iter, ++iter_to_update) { 469 ++iter, ++iter_to_update) {
473 (*iter_to_update).set_id((*iter).id()); 470 (*iter_to_update).set_id((*iter).id());
474 } 471 }
475 } 472 }
476 473
477 } // namespace internal 474 } // namespace internal
478 } // namespace ash 475 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/multi_display_manager_unittest.cc » ('j') | ui/gfx/display.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698