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

Side by Side Diff: src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp ('k') | src/gpu/gl/unix/SkNativeGLContext_unix.cpp » ('j') | 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"
12 11
13 #include <GL/glx.h> 12 #include <GL/glx.h>
14 13
15 #define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F)
16 #define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, " gl" #F #S)
17 #define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl " #F)
18
19 #define GET_LINKED GET_PROC
20 #define GET_LINKED_SUFFIX GET_PROC_SUFFIX
21 #define USE_LINKED 0
22
23 #include "gl/GrGLAssembleGLESInterface.h"
24
25 static GrGLFuncPtr glx_get(void* ctx, const char name[]) { 14 static GrGLFuncPtr glx_get(void* ctx, const char name[]) {
26 SkASSERT(NULL == ctx); 15 SkASSERT(NULL == ctx);
27 SkASSERT(NULL != glXGetCurrentContext()); 16 SkASSERT(NULL != glXGetCurrentContext());
28 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name)); 17 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
29 } 18 }
30 19
31 const GrGLInterface* GrGLCreateNativeInterface() { 20 const GrGLInterface* GrGLCreateNativeInterface() {
32 if (NULL == glXGetCurrentContext()) { 21 if (NULL == glXGetCurrentContext()) {
33 return NULL; 22 return NULL;
34 } 23 }
35 24 return GrGLAssembleGLInterface(NULL, glx_get);
36 const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION ));
37 GrGLStandard standard = GrGLGetStandardInUseFromString(verStr);
38
39 if (kGLES_GrGLStandard == standard) {
40 return GrGLAssembleGLESInterface(NULL, glx_get);
41 } else if (kGL_GrGLStandard == standard) {
42 return GrGLAssembleGLInterface(NULL, glx_get);
43 }
44 return NULL;
45 } 25 }
OLDNEW
« no previous file with comments | « src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp ('k') | src/gpu/gl/unix/SkNativeGLContext_unix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698