OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/local/window_port_local.h" | 5 #include "ui/aura/local/window_port_local.h" |
6 | 6 |
7 #include "cc/surfaces/surface_manager.h" | 7 #include "cc/surfaces/surface_manager.h" |
8 #include "ui/aura/client/cursor_client.h" | 8 #include "ui/aura/client/cursor_client.h" |
9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
10 #include "ui/aura/local/compositor_frame_sink_local.h" | 10 #include "ui/aura/local/compositor_frame_sink_local.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const void* key) { | 86 const void* key) { |
87 return nullptr; | 87 return nullptr; |
88 } | 88 } |
89 | 89 |
90 void WindowPortLocal::OnPropertyChanged( | 90 void WindowPortLocal::OnPropertyChanged( |
91 const void* key, | 91 const void* key, |
92 int64_t old_value, | 92 int64_t old_value, |
93 std::unique_ptr<ui::PropertyData> data) {} | 93 std::unique_ptr<ui::PropertyData> data) {} |
94 | 94 |
95 std::unique_ptr<cc::CompositorFrameSink> | 95 std::unique_ptr<cc::CompositorFrameSink> |
96 WindowPortLocal::CreateCompositorFrameSink() { | 96 WindowPortLocal::CreateCompositorFrameSink( |
| 97 scoped_refptr<cc::ContextProvider> context_provider, |
| 98 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { |
97 DCHECK(!frame_sink_id_.is_valid()); | 99 DCHECK(!frame_sink_id_.is_valid()); |
98 auto* context_factory_private = | 100 auto* context_factory_private = |
99 aura::Env::GetInstance()->context_factory_private(); | 101 aura::Env::GetInstance()->context_factory_private(); |
100 frame_sink_id_ = context_factory_private->AllocateFrameSinkId(); | 102 frame_sink_id_ = context_factory_private->AllocateFrameSinkId(); |
101 auto frame_sink = base::MakeUnique<CompositorFrameSinkLocal>( | 103 auto frame_sink = base::MakeUnique<CompositorFrameSinkLocal>( |
102 frame_sink_id_, context_factory_private->GetSurfaceManager()); | 104 frame_sink_id_, context_factory_private->GetSurfaceManager()); |
103 frame_sink->SetSurfaceChangedCallback(base::Bind( | 105 frame_sink->SetSurfaceChangedCallback(base::Bind( |
104 &WindowPortLocal::OnSurfaceChanged, weak_factory_.GetWeakPtr())); | 106 &WindowPortLocal::OnSurfaceChanged, weak_factory_.GetWeakPtr())); |
105 if (window_->GetRootWindow()) | 107 if (window_->GetRootWindow()) |
106 window_->layer()->GetCompositor()->AddFrameSink(frame_sink_id_); | 108 window_->layer()->GetCompositor()->AddFrameSink(frame_sink_id_); |
(...skipping 25 matching lines...) Expand all Loading... |
132 gfx::Rect(window_->layer()->bounds().origin(), surface_size)); | 134 gfx::Rect(window_->layer()->bounds().origin(), surface_size)); |
133 window_->layer()->SetShowPrimarySurface( | 135 window_->layer()->SetShowPrimarySurface( |
134 cc::SurfaceInfo(surface_id, 1.0f, surface_size), | 136 cc::SurfaceInfo(surface_id, 1.0f, surface_size), |
135 aura::Env::GetInstance() | 137 aura::Env::GetInstance() |
136 ->context_factory_private() | 138 ->context_factory_private() |
137 ->GetSurfaceManager() | 139 ->GetSurfaceManager() |
138 ->reference_factory()); | 140 ->reference_factory()); |
139 } | 141 } |
140 | 142 |
141 } // namespace aura | 143 } // namespace aura |
OLD | NEW |