| 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/ozone/platform/x11/x11_surface_factory.h" | 5 #include "ui/ozone/platform/x11/x11_surface_factory.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include "third_party/khronos/EGL/egl.h" | 9 #include "third_party/khronos/EGL/egl.h" |
| 10 #include "ui/gfx/x/x11_types.h" | 10 #include "ui/gfx/x/x11_types.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { | 118 GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { |
| 119 Destroy(); | 119 Destroy(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace | 122 } // namespace |
| 123 | 123 |
| 124 X11SurfaceFactory::X11SurfaceFactory() {} | 124 X11SurfaceFactory::X11SurfaceFactory() {} |
| 125 | 125 |
| 126 X11SurfaceFactory::~X11SurfaceFactory() {} | 126 X11SurfaceFactory::~X11SurfaceFactory() {} |
| 127 | 127 |
| 128 bool X11SurfaceFactory::UseNewSurfaceAPI() { | |
| 129 return true; | |
| 130 } | |
| 131 | |
| 132 scoped_refptr<gl::GLSurface> X11SurfaceFactory::CreateViewGLSurface( | 128 scoped_refptr<gl::GLSurface> X11SurfaceFactory::CreateViewGLSurface( |
| 133 gl::GLImplementation implementation, | 129 gl::GLImplementation implementation, |
| 134 gfx::AcceleratedWidget widget) { | 130 gfx::AcceleratedWidget widget) { |
| 135 if (implementation != gl::kGLImplementationEGLGLES2) { | 131 if (implementation != gl::kGLImplementationEGLGLES2) { |
| 136 NOTREACHED(); | 132 NOTREACHED(); |
| 137 return nullptr; | 133 return nullptr; |
| 138 } | 134 } |
| 139 | 135 |
| 140 return gl::InitializeGLSurface(new GLSurfaceEGLOzoneX11(widget)); | 136 return gl::InitializeGLSurface(new GLSurfaceEGLOzoneX11(widget)); |
| 141 } | 137 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 155 AddGLLibraryCallback add_gl_library, | 151 AddGLLibraryCallback add_gl_library, |
| 156 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { | 152 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { |
| 157 return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address); | 153 return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address); |
| 158 } | 154 } |
| 159 | 155 |
| 160 intptr_t X11SurfaceFactory::GetNativeDisplay() { | 156 intptr_t X11SurfaceFactory::GetNativeDisplay() { |
| 161 return reinterpret_cast<intptr_t>(gfx::GetXDisplay()); | 157 return reinterpret_cast<intptr_t>(gfx::GetXDisplay()); |
| 162 } | 158 } |
| 163 | 159 |
| 164 } // namespace ui | 160 } // namespace ui |
| OLD | NEW |