blob: d67cf0c3173cbd6470740a65223bd837c73485ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef SkEGLContext_DEFINED
#define SkEGLContext_DEFINED
#if defined(SK_MESA)
#include "GL/osmesa.h"
#elif defined(SK_BUILD_FOR_MAC)
#include <AGL/agl.h>
#elif defined(SK_BUILD_FOR_UNIX)
#include <X11/Xlib.h>
#include <GL/glx.h>
#else
#endif
/**
* Create an offscreen opengl context
*/
class SkEGLContext {
public:
SkEGLContext();
~SkEGLContext();
bool init(const int width, const int height);
private:
#if defined(SK_MESA)
OSMesaContext context;
GLfloat *image;
#elif defined(SK_BUILD_FOR_MAC)
AGLContext context;
#elif defined(SK_BUILD_FOR_UNIX)
GLXContext context;
Display *display;
Pixmap pixmap;
GLXPixmap glxPixmap;
#else
#endif
};
#endif
|