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

Side by Side Diff: ash/display/display_controller.cc

Issue 1016033006: Enable BeginFrame scheduling on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac build Created 5 years, 9 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
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/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 18 matching lines...) Expand all
29 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
30 #include "ui/aura/client/capture_client.h" 30 #include "ui/aura/client/capture_client.h"
31 #include "ui/aura/client/focus_client.h" 31 #include "ui/aura/client/focus_client.h"
32 #include "ui/aura/client/screen_position_client.h" 32 #include "ui/aura/client/screen_position_client.h"
33 #include "ui/aura/window.h" 33 #include "ui/aura/window.h"
34 #include "ui/aura/window_event_dispatcher.h" 34 #include "ui/aura/window_event_dispatcher.h"
35 #include "ui/aura/window_property.h" 35 #include "ui/aura/window_property.h"
36 #include "ui/aura/window_tracker.h" 36 #include "ui/aura/window_tracker.h"
37 #include "ui/aura/window_tree_host.h" 37 #include "ui/aura/window_tree_host.h"
38 #include "ui/compositor/compositor.h" 38 #include "ui/compositor/compositor.h"
39 #include "ui/compositor/compositor_vsync_manager.h"
40 #include "ui/gfx/display.h" 39 #include "ui/gfx/display.h"
41 #include "ui/gfx/screen.h" 40 #include "ui/gfx/screen.h"
42 #include "ui/wm/core/coordinate_conversion.h" 41 #include "ui/wm/core/coordinate_conversion.h"
43 #include "ui/wm/public/activation_client.h" 42 #include "ui/wm/public/activation_client.h"
44 43
45 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
46 #include "ash/display/display_configurator_animation.h" 45 #include "ash/display/display_configurator_animation.h"
47 #include "base/sys_info.h" 46 #include "base/sys_info.h"
48 #include "base/time/time.h" 47 #include "base/time/time.h"
49 #endif // defined(OS_CHROMEOS) 48 #endif // defined(OS_CHROMEOS)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 host->GetAcceleratedWidget(), info.rotation(), scale); 142 host->GetAcceleratedWidget(), info.rotation(), scale);
144 #endif 143 #endif
145 #endif 144 #endif
146 scoped_ptr<RootWindowTransformer> transformer( 145 scoped_ptr<RootWindowTransformer> transformer(
147 CreateRootWindowTransformerForDisplay(host->window(), display)); 146 CreateRootWindowTransformerForDisplay(host->window(), display));
148 ash_host->SetRootWindowTransformer(transformer.Pass()); 147 ash_host->SetRootWindowTransformer(transformer.Pass());
149 148
150 DisplayMode mode = 149 DisplayMode mode =
151 GetDisplayManager()->GetActiveModeForDisplayId(display.id()); 150 GetDisplayManager()->GetActiveModeForDisplayId(display.id());
152 if (mode.refresh_rate > 0.0f) { 151 if (mode.refresh_rate > 0.0f) {
153 host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( 152 host->compositor()->SetAuthoritativeVSyncInterval(
154 base::TimeDelta::FromMicroseconds( 153 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
155 base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); 154 mode.refresh_rate));
156 } 155 }
157 156
158 // Just movnig the display requires the full redraw. 157 // Just movnig the display requires the full redraw.
159 // chrome-os-partner:33558. 158 // chrome-os-partner:33558.
160 host->compositor()->ScheduleFullRedraw(); 159 host->compositor()->ScheduleFullRedraw();
161 } 160 }
162 161
163 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, 162 void ClearDisplayPropertiesOnHost(AshWindowTreeHost* ash_host,
164 const gfx::Display& display) { 163 const gfx::Display& display) {
165 #if defined(OS_CHROMEOS) && defined(USE_OZONE) 164 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 std::string name = 848 std::string name =
850 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; 849 root_windows[i] == primary ? "aura_root_0" : "aura_root_x";
851 gfx::AcceleratedWidget xwindow = 850 gfx::AcceleratedWidget xwindow =
852 root_windows[i]->GetHost()->GetAcceleratedWidget(); 851 root_windows[i]->GetHost()->GetAcceleratedWidget();
853 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); 852 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str());
854 } 853 }
855 #endif 854 #endif
856 } 855 }
857 856
858 } // namespace ash 857 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698