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

Side by Side Diff: src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp

Issue 2168293003: Don't ask GLX for EGL procs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "gl/GrGLInterface.h" 9 #include "gl/GrGLInterface.h"
10 #include "gl/GrGLAssembleInterface.h" 10 #include "gl/GrGLAssembleInterface.h"
11 #include "gl/GrGLUtil.h" 11 #include "gl/GrGLUtil.h"
12 12
13 #include <GL/glx.h> 13 #include <GL/glx.h>
14 14
15 static GrGLFuncPtr glx_get(void* ctx, const char name[]) { 15 static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
16 // Avoid calling glXGetProcAddress() for EGL procs.
17 // We don't expect it to ever succeed, but somtimes it returns non-null anyw ay.
18 if (0 == strncmp(name, "egl", 3)) {
19 return nullptr;
20 }
21
16 SkASSERT(nullptr == ctx); 22 SkASSERT(nullptr == ctx);
17 SkASSERT(glXGetCurrentContext()); 23 SkASSERT(glXGetCurrentContext());
18 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name)); 24 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
19 } 25 }
20 26
21 const GrGLInterface* GrGLCreateNativeInterface() { 27 const GrGLInterface* GrGLCreateNativeInterface() {
22 if (nullptr == glXGetCurrentContext()) { 28 if (nullptr == glXGetCurrentContext()) {
23 return nullptr; 29 return nullptr;
24 } 30 }
25 31
26 return GrGLAssembleInterface(nullptr, glx_get); 32 return GrGLAssembleInterface(nullptr, glx_get);
27 } 33 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698