Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/drm/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <gbm.h> | 9 #include <gbm.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 if (drm_thread_proxy_) | 117 if (drm_thread_proxy_) |
| 118 drm_thread_proxy_->AddBinding(std::move(request)); | 118 drm_thread_proxy_->AddBinding(std::move(request)); |
| 119 else | 119 else |
| 120 pending_cursor_requests_.push_back(std::move(request)); | 120 pending_cursor_requests_.push_back(std::move(request)); |
| 121 } | 121 } |
| 122 std::unique_ptr<PlatformWindow> CreatePlatformWindow( | 122 std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
| 123 PlatformWindowDelegate* delegate, | 123 PlatformWindowDelegate* delegate, |
| 124 const gfx::Rect& bounds) override { | 124 const gfx::Rect& bounds) override { |
| 125 GpuThreadAdapter* adapter = gpu_platform_support_host_.get(); | 125 GpuThreadAdapter* adapter = gpu_platform_support_host_.get(); |
| 126 if (using_mojo_ || single_process_) { | 126 if (using_mojo_ || single_process_) { |
| 127 DCHECK(drm_thread_proxy_) | |
| 128 << "drm_thread_proxy_ should exist (and be running) here."; | |
| 129 adapter = mus_thread_proxy_.get(); | 127 adapter = mus_thread_proxy_.get(); |
| 130 } | 128 } |
| 131 | 129 |
| 132 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( | 130 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( |
| 133 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), | 131 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), |
| 134 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); | 132 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); |
| 135 platform_window->Initialize(); | 133 platform_window->Initialize(); |
| 136 return std::move(platform_window); | 134 return std::move(platform_window); |
| 137 } | 135 } |
| 138 std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() | 136 std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 GpuThreadAdapter* adapter; | 170 GpuThreadAdapter* adapter; |
| 173 | 171 |
| 174 // TODO(rjkroege): Once mus is split, only do this for single_process. | 172 // TODO(rjkroege): Once mus is split, only do this for single_process. |
| 175 if (single_process_ || using_mojo_) | 173 if (single_process_ || using_mojo_) |
| 176 gl_api_loader_.reset(new GlApiLoader()); | 174 gl_api_loader_.reset(new GlApiLoader()); |
| 177 | 175 |
| 178 if (using_mojo_) { | 176 if (using_mojo_) { |
| 179 DCHECK(args.connector); | 177 DCHECK(args.connector); |
| 180 mus_thread_proxy_.reset(new MusThreadProxy()); | 178 mus_thread_proxy_.reset(new MusThreadProxy()); |
| 181 adapter = mus_thread_proxy_.get(); | 179 adapter = mus_thread_proxy_.get(); |
| 182 cursor_->SetDrmCursorProxy(new CursorProxyMojo(args.connector)); | 180 cursor_->SetDrmCursorProxy(new CursorProxyMojo(args.connector)); |
|
sadrul
2017/05/25 22:37:00
Since we already know that this |mus_thread_proxy_
rjkroege
2017/05/25 22:52:49
I'd prefer not to do this because:
* the "unfortun
sadrul
2017/05/26 01:46:56
In split-process mode, the MusThreadProxy created
dnicoara
2017/05/26 15:51:04
I share Sadrul's concern. It feels like you're run
| |
| 183 } else if (single_process_) { | 181 } else if (single_process_) { |
| 184 mus_thread_proxy_.reset(new MusThreadProxy()); | 182 mus_thread_proxy_.reset(new MusThreadProxy()); |
| 185 adapter = mus_thread_proxy_.get(); | 183 adapter = mus_thread_proxy_.get(); |
| 186 cursor_->SetDrmCursorProxy( | 184 cursor_->SetDrmCursorProxy( |
| 187 new CursorProxyThread(mus_thread_proxy_.get())); | 185 new CursorProxyThread(mus_thread_proxy_.get())); |
| 188 } else { | 186 } else { |
| 189 gpu_platform_support_host_.reset( | 187 gpu_platform_support_host_.reset( |
| 190 new DrmGpuPlatformSupportHost(cursor_.get())); | 188 new DrmGpuPlatformSupportHost(cursor_.get())); |
| 191 adapter = gpu_platform_support_host_.get(); | 189 adapter = gpu_platform_support_host_.get(); |
| 192 } | 190 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 267 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
| 270 }; | 268 }; |
| 271 | 269 |
| 272 } // namespace | 270 } // namespace |
| 273 | 271 |
| 274 OzonePlatform* CreateOzonePlatformGbm() { | 272 OzonePlatform* CreateOzonePlatformGbm() { |
| 275 return new OzonePlatformGbm; | 273 return new OzonePlatformGbm; |
| 276 } | 274 } |
| 277 | 275 |
| 278 } // namespace ui | 276 } // namespace ui |
| OLD | NEW |