| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // request a CompositorFrameSink from the aura::Window. Setting up the | 173 // request a CompositorFrameSink from the aura::Window. Setting up the |
| 174 // BeginFrame hierarchy should be an internal implementation detail of aura or | 174 // BeginFrame hierarchy should be an internal implementation detail of aura or |
| 175 // mus in aura-mus. | 175 // mus in aura-mus. |
| 176 Surface::Surface() | 176 Surface::Surface() |
| 177 : window_(new aura::Window(new CustomWindowDelegate(this))), | 177 : window_(new aura::Window(new CustomWindowDelegate(this))), |
| 178 frame_sink_id_(aura::Env::GetInstance() | 178 frame_sink_id_(aura::Env::GetInstance() |
| 179 ->context_factory_private() | 179 ->context_factory_private() |
| 180 ->AllocateFrameSinkId()) { | 180 ->AllocateFrameSinkId()) { |
| 181 cc::mojom::MojoCompositorFrameSinkClientPtr frame_sink_holder_ptr; | 181 cc::mojom::MojoCompositorFrameSinkClientPtr frame_sink_holder_ptr; |
| 182 cc::mojom::MojoCompositorFrameSinkClientRequest frame_sink_client_request = | 182 cc::mojom::MojoCompositorFrameSinkClientRequest frame_sink_client_request = |
| 183 mojo::GetProxy(&frame_sink_holder_ptr); | 183 mojo::MakeRequest(&frame_sink_holder_ptr); |
| 184 std::unique_ptr<CompositorFrameSink> frame_sink(new CompositorFrameSink( | 184 std::unique_ptr<CompositorFrameSink> frame_sink(new CompositorFrameSink( |
| 185 frame_sink_id_, | 185 frame_sink_id_, |
| 186 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(), | 186 aura::Env::GetInstance()->context_factory_private()->GetSurfaceManager(), |
| 187 std::move(frame_sink_holder_ptr))); | 187 std::move(frame_sink_holder_ptr))); |
| 188 compositor_frame_sink_holder_ = new CompositorFrameSinkHolder( | 188 compositor_frame_sink_holder_ = new CompositorFrameSinkHolder( |
| 189 this, std::move(frame_sink), std::move(frame_sink_client_request)); | 189 this, std::move(frame_sink), std::move(frame_sink_client_request)); |
| 190 surface_reference_factory_ = | 190 surface_reference_factory_ = |
| 191 new CustomSurfaceReferenceFactory(compositor_frame_sink_holder_.get()); | 191 new CustomSurfaceReferenceFactory(compositor_frame_sink_holder_.get()); |
| 192 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); | 192 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); |
| 193 window_->SetName("ExoSurface"); | 193 window_->SetName("ExoSurface"); |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 795 |
| 796 int64_t Surface::GetPropertyInternal(const void* key, | 796 int64_t Surface::GetPropertyInternal(const void* key, |
| 797 int64_t default_value) const { | 797 int64_t default_value) const { |
| 798 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 798 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
| 799 if (iter == prop_map_.end()) | 799 if (iter == prop_map_.end()) |
| 800 return default_value; | 800 return default_value; |
| 801 return iter->second.value; | 801 return iter->second.value; |
| 802 } | 802 } |
| 803 | 803 |
| 804 } // namespace exo | 804 } // namespace exo |
| OLD | NEW |