Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: ui/gl/gl_bindings.cc

Issue 1051253008: gpu: Upgrade to new ANGLE Platform Display init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for ChromeOS build Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE) 5 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE)
6 #include <EGL/egl.h> 6 #include <EGL/egl.h>
7 #endif 7 #endif
8 8
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 10
(...skipping 23 matching lines...) Expand all
34 GLSurfaceWGL::GetDisplayDC()); 34 GLSurfaceWGL::GetDisplayDC());
35 } else if (g_driver_wgl.fn.wglGetExtensionsStringEXTFn) { 35 } else if (g_driver_wgl.fn.wglGetExtensionsStringEXTFn) {
36 str = g_driver_wgl.fn.wglGetExtensionsStringEXTFn(); 36 str = g_driver_wgl.fn.wglGetExtensionsStringEXTFn();
37 } 37 }
38 return str ? std::string(str) : ""; 38 return str ? std::string(str) : "";
39 } 39 }
40 #endif 40 #endif
41 41
42 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE) 42 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE)
43 std::string DriverEGL::GetPlatformExtensions() { 43 std::string DriverEGL::GetPlatformExtensions() {
44 EGLDisplay display = 44 EGLDisplay display = GLSurfaceEGL::InitializeDisplay();
45 #if defined(OS_WIN) 45 if (display == EGL_NO_DISPLAY)
46 GLSurfaceEGL::GetPlatformDisplay(GetPlatformDefaultEGLNativeDisplay()); 46 return "";
47 #else
48 g_driver_egl.fn.eglGetDisplayFn(GetPlatformDefaultEGLNativeDisplay());
49 #endif
50 47
51 DCHECK(g_driver_egl.fn.eglInitializeFn);
52 g_driver_egl.fn.eglInitializeFn(display, NULL, NULL);
53 DCHECK(g_driver_egl.fn.eglQueryStringFn); 48 DCHECK(g_driver_egl.fn.eglQueryStringFn);
54 const char* str = g_driver_egl.fn.eglQueryStringFn(display, EGL_EXTENSIONS); 49 const char* str = g_driver_egl.fn.eglQueryStringFn(display, EGL_EXTENSIONS);
55 return str ? std::string(str) : ""; 50 return str ? std::string(str) : "";
56 } 51 }
57 52
58 // static 53 // static
59 std::string DriverEGL::GetClientExtensions() { 54 std::string DriverEGL::GetClientExtensions() {
55 DCHECK(g_driver_egl.fn.eglQueryStringFn);
60 const char* str = 56 const char* str =
61 g_driver_egl.fn.eglQueryStringFn(EGL_NO_DISPLAY, EGL_EXTENSIONS); 57 g_driver_egl.fn.eglQueryStringFn(EGL_NO_DISPLAY, EGL_EXTENSIONS);
62 return str ? std::string(str) : ""; 58 return str ? std::string(str) : "";
63 } 59 }
64 #endif 60 #endif
65 61
66 #if defined(USE_X11) 62 #if defined(USE_X11)
67 std::string DriverGLX::GetPlatformExtensions() { 63 std::string DriverGLX::GetPlatformExtensions() {
68 DCHECK(g_driver_glx.fn.glXQueryExtensionsStringFn); 64 DCHECK(g_driver_glx.fn.glXQueryExtensionsStringFn);
69 const char* str = 65 const char* str =
70 g_driver_glx.fn.glXQueryExtensionsStringFn(gfx::GetXDisplay(), 0); 66 g_driver_glx.fn.glXQueryExtensionsStringFn(gfx::GetXDisplay(), 0);
71 return str ? std::string(str) : ""; 67 return str ? std::string(str) : "";
72 } 68 }
73 #endif 69 #endif
74 70
75 } // namespace gfx 71 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698