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 drm_ = dri; | 82 drm_ = dri; |
83 device_ = device; | 83 device_ = device; |
84 screen_manager_ = screen_manager; | 84 screen_manager_ = screen_manager; |
85 window_manager_ = window_manager; | 85 window_manager_ = window_manager; |
86 } | 86 } |
87 | 87 |
88 intptr_t GbmSurfaceFactory::GetNativeDisplay() { | 88 intptr_t GbmSurfaceFactory::GetNativeDisplay() { |
89 return reinterpret_cast<intptr_t>(device_); | 89 return reinterpret_cast<intptr_t>(device_); |
90 } | 90 } |
91 | 91 |
92 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( | 92 void* GbmSurfaceFactory::GetEGLSurfaceConfig(const EglConfigInfo& egl, |
93 const int32* desired_list) { | 93 SurfaceOzoneEGL* surface) { |
94 static const int32 kConfigAttribs[] = { | 94 static const int32 kConfigAttribs[] = { |
95 EGL_BUFFER_SIZE, 32, | 95 EGL_BUFFER_SIZE, 32, |
96 EGL_ALPHA_SIZE, 8, | 96 EGL_ALPHA_SIZE, 8, |
97 EGL_BLUE_SIZE, 8, | 97 EGL_BLUE_SIZE, 8, |
98 EGL_GREEN_SIZE, 8, | 98 EGL_GREEN_SIZE, 8, |
99 EGL_RED_SIZE, 8, | 99 EGL_RED_SIZE, 8, |
100 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | 100 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, |
101 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | 101 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
102 EGL_NONE | 102 EGL_NONE |
103 }; | 103 }; |
104 | 104 return ChooseEGLConfig(egl, kConfigAttribs); |
105 return kConfigAttribs; | |
106 } | 105 } |
107 | 106 |
108 bool GbmSurfaceFactory::LoadEGLGLES2Bindings( | 107 bool GbmSurfaceFactory::LoadEGLGLES2Bindings( |
109 AddGLLibraryCallback add_gl_library, | 108 AddGLLibraryCallback add_gl_library, |
110 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { | 109 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { |
111 return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address); | 110 return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address); |
112 } | 111 } |
113 | 112 |
114 scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( | 113 scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget( |
115 gfx::AcceleratedWidget widget) { | 114 gfx::AcceleratedWidget widget) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl( | 205 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl( |
207 widget, drm_, window_manager_, screen_manager_)); | 206 widget, drm_, window_manager_, screen_manager_)); |
208 delegate->Initialize(); | 207 delegate->Initialize(); |
209 window_manager_->AddWindowDelegate(widget, delegate.Pass()); | 208 window_manager_->AddWindowDelegate(widget, delegate.Pass()); |
210 } | 209 } |
211 | 210 |
212 return window_manager_->GetWindowDelegate(widget); | 211 return window_manager_->GetWindowDelegate(widget); |
213 } | 212 } |
214 | 213 |
215 } // namespace ui | 214 } // namespace ui |
OLD | NEW |