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" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 device_ = device; | 82 device_ = device; |
83 screen_manager_ = screen_manager; | 83 screen_manager_ = screen_manager; |
84 window_manager_ = window_manager; | 84 window_manager_ = window_manager; |
85 } | 85 } |
86 | 86 |
87 intptr_t GbmSurfaceFactory::GetNativeDisplay() { | 87 intptr_t GbmSurfaceFactory::GetNativeDisplay() { |
88 DCHECK(state_ == INITIALIZED); | 88 DCHECK(state_ == INITIALIZED); |
89 return reinterpret_cast<intptr_t>(device_); | 89 return reinterpret_cast<intptr_t>(device_); |
90 } | 90 } |
91 | 91 |
| 92 int GbmSurfaceFactory::GetDrmFd() { |
| 93 DCHECK(state_ == INITIALIZED); |
| 94 return gbm_device_get_fd(device_); |
| 95 } |
| 96 |
92 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( | 97 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( |
93 const int32* desired_list) { | 98 const int32* desired_list) { |
94 static const int32 kConfigAttribs[] = { | 99 static const int32 kConfigAttribs[] = { |
95 EGL_BUFFER_SIZE, 32, | 100 EGL_BUFFER_SIZE, 32, |
96 EGL_ALPHA_SIZE, 8, | 101 EGL_ALPHA_SIZE, 8, |
97 EGL_BLUE_SIZE, 8, | 102 EGL_BLUE_SIZE, 8, |
98 EGL_GREEN_SIZE, 8, | 103 EGL_GREEN_SIZE, 8, |
99 EGL_RED_SIZE, 8, | 104 EGL_RED_SIZE, 8, |
100 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | 105 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, |
101 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | 106 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 scoped_ptr<DriWindowDelegate> delegate( | 228 scoped_ptr<DriWindowDelegate> delegate( |
224 new DriWindowDelegateImpl(widget, screen_manager_)); | 229 new DriWindowDelegateImpl(widget, screen_manager_)); |
225 delegate->Initialize(); | 230 delegate->Initialize(); |
226 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 231 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
227 } | 232 } |
228 | 233 |
229 return window_manager_->GetWindowDelegate(widget); | 234 return window_manager_->GetWindowDelegate(widget); |
230 } | 235 } |
231 | 236 |
232 } // namespace ui | 237 } // namespace ui |
OLD | NEW |