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

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 1373033004: aura: Defer OutputSurface creation until widget is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/aura/window_tree_host.h" 5 #include "ui/aura/window_tree_host.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 window()->Init(ui::LAYER_NOT_DRAWN); 249 window()->Init(ui::LAYER_NOT_DRAWN);
250 window()->set_host(this); 250 window()->set_host(this);
251 window()->SetName("RootWindow"); 251 window()->SetName("RootWindow");
252 window()->SetEventTargeter( 252 window()->SetEventTargeter(
253 scoped_ptr<ui::EventTargeter>(new WindowTargeter())); 253 scoped_ptr<ui::EventTargeter>(new WindowTargeter()));
254 dispatcher_.reset(new WindowEventDispatcher(this)); 254 dispatcher_.reset(new WindowEventDispatcher(this));
255 } 255 }
256 } 256 }
257 257
258 void WindowTreeHost::OnAcceleratedWidgetAvailable() { 258 void WindowTreeHost::OnAcceleratedWidgetAvailable() {
259 compositor_->SetAcceleratedWidgetAndStartCompositor(GetAcceleratedWidget()); 259 compositor_->SetAcceleratedWidget(GetAcceleratedWidget());
260 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(), 260 prop_.reset(new ui::ViewProp(GetAcceleratedWidget(),
261 kWindowTreeHostForAcceleratedWidget, this)); 261 kWindowTreeHostForAcceleratedWidget, this));
262 } 262 }
263 263
264 void WindowTreeHost::OnHostMoved(const gfx::Point& new_location) { 264 void WindowTreeHost::OnHostMoved(const gfx::Point& new_location) {
265 TRACE_EVENT1("ui", "WindowTreeHost::OnHostMoved", 265 TRACE_EVENT1("ui", "WindowTreeHost::OnHostMoved",
266 "origin", new_location.ToString()); 266 "origin", new_location.ToString());
267 267
268 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, 268 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_,
269 OnHostMoved(this, new_location)); 269 OnHostMoved(this, new_location));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 client::CursorClient* cursor_client = client::GetCursorClient(window()); 311 client::CursorClient* cursor_client = client::GetCursorClient(window());
312 if (cursor_client) { 312 if (cursor_client) {
313 const gfx::Display& display = 313 const gfx::Display& display =
314 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); 314 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window());
315 cursor_client->SetDisplay(display); 315 cursor_client->SetDisplay(display);
316 } 316 }
317 dispatcher()->OnCursorMovedToRootLocation(root_location); 317 dispatcher()->OnCursorMovedToRootLocation(root_location);
318 } 318 }
319 319
320 } // namespace aura 320 } // namespace aura
OLDNEW
« no previous file with comments | « content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698