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/dri/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h" |
6 | 6 |
7 #include <gbm.h> | 7 #include <gbm.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "third_party/khronos/EGL/egl.h" | 11 #include "third_party/khronos/EGL/egl.h" |
12 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" | 12 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" |
13 #include "ui/ozone/platform/dri/dri_window_manager.h" | 13 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" |
14 #include "ui/ozone/platform/dri/gbm_buffer.h" | 14 #include "ui/ozone/platform/dri/gbm_buffer.h" |
15 #include "ui/ozone/platform/dri/gbm_surface.h" | 15 #include "ui/ozone/platform/dri/gbm_surface.h" |
16 #include "ui/ozone/platform/dri/gbm_surfaceless.h" | 16 #include "ui/ozone/platform/dri/gbm_surfaceless.h" |
17 #include "ui/ozone/platform/dri/screen_manager.h" | 17 #include "ui/ozone/platform/dri/screen_manager.h" |
18 #include "ui/ozone/public/native_pixmap.h" | 18 #include "ui/ozone/public/native_pixmap.h" |
19 #include "ui/ozone/public/overlay_candidates_ozone.h" | 19 #include "ui/ozone/public/overlay_candidates_ozone.h" |
20 #include "ui/ozone/public/ozone_switches.h" | 20 #include "ui/ozone/public/ozone_switches.h" |
21 #include "ui/ozone/public/surface_ozone_egl.h" | 21 #include "ui/ozone/public/surface_ozone_egl.h" |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless) | 69 GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless) |
70 : DriSurfaceFactory(NULL, NULL, NULL), | 70 : DriSurfaceFactory(NULL, NULL, NULL), |
71 device_(NULL), | 71 device_(NULL), |
72 allow_surfaceless_(allow_surfaceless) { | 72 allow_surfaceless_(allow_surfaceless) { |
73 } | 73 } |
74 | 74 |
75 GbmSurfaceFactory::~GbmSurfaceFactory() {} | 75 GbmSurfaceFactory::~GbmSurfaceFactory() {} |
76 | 76 |
77 void GbmSurfaceFactory::InitializeGpu(DriWrapper* dri, | 77 void GbmSurfaceFactory::InitializeGpu( |
78 gbm_device* device, | 78 DriWrapper* dri, |
79 ScreenManager* screen_manager, | 79 gbm_device* device, |
80 DriWindowManager* window_manager) { | 80 ScreenManager* screen_manager, |
| 81 DriWindowDelegateManager* window_manager) { |
81 drm_ = dri; | 82 drm_ = dri; |
82 device_ = device; | 83 device_ = device; |
83 screen_manager_ = screen_manager; | 84 screen_manager_ = screen_manager; |
84 window_manager_ = window_manager; | 85 window_manager_ = window_manager; |
85 } | 86 } |
86 | 87 |
87 intptr_t GbmSurfaceFactory::GetNativeDisplay() { | 88 intptr_t GbmSurfaceFactory::GetNativeDisplay() { |
88 DCHECK(state_ == INITIALIZED); | 89 DCHECK(state_ == INITIALIZED); |
89 return reinterpret_cast<intptr_t>(device_); | 90 return reinterpret_cast<intptr_t>(device_); |
90 } | 91 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 scoped_ptr<DriWindowDelegate> delegate( | 222 scoped_ptr<DriWindowDelegate> delegate( |
222 new DriWindowDelegateImpl(widget, screen_manager_)); | 223 new DriWindowDelegateImpl(widget, screen_manager_)); |
223 delegate->Initialize(); | 224 delegate->Initialize(); |
224 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 225 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
225 } | 226 } |
226 | 227 |
227 return window_manager_->GetWindowDelegate(widget); | 228 return window_manager_->GetWindowDelegate(widget); |
228 } | 229 } |
229 | 230 |
230 } // namespace ui | 231 } // namespace ui |
OLD | NEW |