Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_ozone.h" | 5 #include "ui/aura/window_tree_host_ozone.h" |
| 6 | 6 |
| 7 #include "ui/aura/window_event_dispatcher.h" | 7 #include "ui/aura/window_event_dispatcher.h" |
| 8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" | 8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" |
| 9 #include "ui/events/ozone/event_factory_ozone.h" | 9 #include "ui/events/ozone/event_factory_ozone.h" |
| 10 #include "ui/gfx/ozone/surface_factory_ozone.h" | 10 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| 11 #include "ui/ozone/ozone_platform.h" | 11 #include "ui/ozone/ozone_platform.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 | 14 |
| 15 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) | 15 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) |
| 16 : widget_(0), | 16 : widget_(0), |
| 17 bounds_(bounds) { | 17 bounds_(bounds) { |
| 18 ui::OzonePlatform::Initialize(); | 18 ui::OzonePlatform::Initialize(); |
| 19 | 19 |
| 20 // EventFactoryOzone creates converters that obtain input events from the | 20 // EventFactoryOzone creates converters that obtain input events from the |
| 21 // underlying input system and dispatch them as |ui::Event| instances into | 21 // underlying input system and dispatch them as |ui::Event| instances into |
| 22 // Aura. | 22 // Aura. |
| 23 ui::EventFactoryOzone::GetInstance()->StartProcessingEvents(); | 23 ui::EventFactoryOzone::GetInstance()->StartProcessingEvents(); |
| 24 | 24 |
| 25 gfx::SurfaceFactoryOzone* surface_factory = | 25 gfx::SurfaceFactoryOzone* surface_factory = |
| 26 gfx::SurfaceFactoryOzone::GetInstance(); | 26 gfx::SurfaceFactoryOzone::GetInstance(); |
| 27 widget_ = surface_factory->GetAcceleratedWidget(); | 27 widget_ = surface_factory->GetAcceleratedWidget(); |
| 28 | 28 |
| 29 surface_factory->AttemptToResizeAcceleratedWidget(widget_, bounds_); | |
|
rjkroege
2014/03/24 16:07:04
I see that this change is necessary to compile but
spang
2014/03/24 16:42:11
This is redundant. The surface gets its size from
rjkroege
2014/03/24 20:23:15
in implementations where it matters, how does the
spang
2014/03/24 21:58:28
Sizing upon initialization goes this way:
1. Wi
| |
| 30 | |
| 31 base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this); | 29 base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this); |
| 32 CreateCompositor(GetAcceleratedWidget()); | 30 CreateCompositor(GetAcceleratedWidget()); |
| 33 } | 31 } |
| 34 | 32 |
| 35 WindowTreeHostOzone::~WindowTreeHostOzone() { | 33 WindowTreeHostOzone::~WindowTreeHostOzone() { |
| 36 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); | 34 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); |
| 37 DestroyCompositor(); | 35 DestroyCompositor(); |
| 38 DestroyDispatcher(); | 36 DestroyDispatcher(); |
| 39 } | 37 } |
| 40 | 38 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 return new WindowTreeHostOzone(bounds); | 119 return new WindowTreeHostOzone(bounds); |
| 122 } | 120 } |
| 123 | 121 |
| 124 // static | 122 // static |
| 125 gfx::Size WindowTreeHost::GetNativeScreenSize() { | 123 gfx::Size WindowTreeHost::GetNativeScreenSize() { |
| 126 NOTIMPLEMENTED(); | 124 NOTIMPLEMENTED(); |
| 127 return gfx::Size(); | 125 return gfx::Size(); |
| 128 } | 126 } |
| 129 | 127 |
| 130 } // namespace aura | 128 } // namespace aura |
| OLD | NEW |