OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/surface.h" | 5 #include "components/exo/surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); | 139 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); |
140 }; | 140 }; |
141 | 141 |
142 } // namespace | 142 } // namespace |
143 | 143 |
144 //////////////////////////////////////////////////////////////////////////////// | 144 //////////////////////////////////////////////////////////////////////////////// |
145 // Surface, public: | 145 // Surface, public: |
146 | 146 |
147 Surface::Surface() | 147 Surface::Surface() |
148 : window_(new aura::Window(new CustomWindowDelegate(this))), | 148 : window_(new aura::Window(new CustomWindowDelegate(this))), |
149 frame_sink_id_( | 149 frame_sink_id_(aura::Env::GetInstance() |
150 aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId()) { | 150 ->context_factory_private() |
rjkroege
2016/12/14 00:15:31
exo should not require this. Is there a separate b
Fady Samuel
2016/12/14 01:27:12
I added a TODO. https://bugs.chromium.org/p/chromi
| |
151 ->AllocateFrameSinkId()) { | |
151 cc::mojom::MojoCompositorFrameSinkClientPtr frame_sink_holder_ptr; | 152 cc::mojom::MojoCompositorFrameSinkClientPtr frame_sink_holder_ptr; |
152 cc::mojom::MojoCompositorFrameSinkClientRequest frame_sink_client_request = | 153 cc::mojom::MojoCompositorFrameSinkClientRequest frame_sink_client_request = |
153 mojo::GetProxy(&frame_sink_holder_ptr); | 154 mojo::GetProxy(&frame_sink_holder_ptr); |
154 std::unique_ptr<CompositorFrameSink> frame_sink(new CompositorFrameSink( | 155 std::unique_ptr<CompositorFrameSink> frame_sink(new CompositorFrameSink( |
155 frame_sink_id_, | 156 frame_sink_id_, |
156 aura::Env::GetInstance()->context_factory()->GetSurfaceManager(), | 157 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(), |
157 std::move(frame_sink_holder_ptr))); | 158 std::move(frame_sink_holder_ptr))); |
158 compositor_frame_sink_holder_ = new CompositorFrameSinkHolder( | 159 compositor_frame_sink_holder_ = new CompositorFrameSinkHolder( |
159 this, std::move(frame_sink), std::move(frame_sink_client_request)); | 160 this, std::move(frame_sink), std::move(frame_sink_client_request)); |
160 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); | 161 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); |
161 window_->SetName("ExoSurface"); | 162 window_->SetName("ExoSurface"); |
162 window_->SetProperty(kSurfaceKey, this); | 163 window_->SetProperty(kSurfaceKey, this); |
163 window_->Init(ui::LAYER_SOLID_COLOR); | 164 window_->Init(ui::LAYER_SOLID_COLOR); |
164 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); | 165 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); |
165 window_->set_owned_by_parent(false); | 166 window_->set_owned_by_parent(false); |
166 window_->AddObserver(this); | 167 window_->AddObserver(this); |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 | 766 |
766 int64_t Surface::GetPropertyInternal(const void* key, | 767 int64_t Surface::GetPropertyInternal(const void* key, |
767 int64_t default_value) const { | 768 int64_t default_value) const { |
768 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 769 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
769 if (iter == prop_map_.end()) | 770 if (iter == prop_map_.end()) |
770 return default_value; | 771 return default_value; |
771 return iter->second.value; | 772 return iter->second.value; |
772 } | 773 } |
773 | 774 |
774 } // namespace exo | 775 } // namespace exo |
OLD | NEW |