Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
ganesh
gl
glx
GrGLMakeGLXInterface.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2014 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
include/gpu/gl/GrGLAssembleInterface.h
"
9
#include "
include/gpu/gl/GrGLInterface.h
"
10
#include "
include/gpu/ganesh/gl/glx/GrGLMakeGLXInterface.h
"
11
#include "
src/gpu/ganesh/gl/GrGLUtil.h
"
12
13
// Define this to get a prototype for glXGetProcAddress on some systems
14
#define GLX_GLXEXT_PROTOTYPES 1
15
#include <GL/glx.h>
16
17
static
GrGLFuncPtr
glx_get
(
void
* ctx,
const
char
name
[]) {
18
// Avoid calling glXGetProcAddress() for EGL procs.
19
// We don't expect it to ever succeed, but somtimes it returns non-null anyway.
20
if
(0 == strncmp(
name
,
"egl"
, 3)) {
21
return
nullptr
;
22
}
23
24
SkASSERT
(
nullptr
== ctx);
25
SkASSERT
(glXGetCurrentContext());
26
return
glXGetProcAddress(
reinterpret_cast<
const
GLubyte*
>
(
name
));
27
}
28
29
namespace
GrGLInterfaces
{
30
sk_sp<const GrGLInterface>
MakeGLX
() {
31
if
(
nullptr
== glXGetCurrentContext()) {
32
return
nullptr
;
33
}
34
35
return
GrGLMakeAssembledInterface
(
nullptr
,
glx_get
);
36
}
37
}
// namespace GrGLInterfaces
38
39
#if !defined(SK_DISABLE_LEGACY_GLXINTERFACE_FACTORY)
40
sk_sp<const GrGLInterface>
GrGLMakeGLXInterface
() {
return
GrGLInterfaces::MakeGLX
(); }
41
#endif
GrGLAssembleInterface.h
GrGLMakeAssembledInterface
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get)
Definition
GrGLAssembleInterface.cpp:16
GrGLInterface.h
GrGLFuncPtr
void(* GrGLFuncPtr)()
Definition
GrGLInterface.h:17
GrGLMakeGLXInterface
sk_sp< const GrGLInterface > GrGLMakeGLXInterface()
Definition
GrGLMakeGLXInterface.cpp:40
glx_get
static GrGLFuncPtr glx_get(void *ctx, const char name[])
Definition
GrGLMakeGLXInterface.cpp:17
GrGLUtil.h
SkASSERT
#define SkASSERT(cond)
Definition
SkAssert.h:116
sk_sp
Definition
SkRefCnt.h:220
name
const char * name
Definition
fuchsia.cc:50
GrGLMakeGLXInterface.h
GrGLInterfaces
Definition
GrGLMakeEGLInterface.h:15
GrGLInterfaces::MakeGLX
SK_API sk_sp< const GrGLInterface > MakeGLX()
Definition
GrGLMakeGLXInterface.cpp:30
Generated on Fri Apr 26 2024 06:16:59 for Flutter Engine by
1.9.8