aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-17 14:24:46 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-17 14:24:46 +0000
commit16bab87a78cfaf6a4f334e1af910c46883f460af (patch)
treed3673b82876bca69b03b1eaf04d3f0fdc16ee622 /include/utils
parent1dd17a133f4fa5c5a0c752e6b9a6f7af6f329fb8 (diff)
Add GL context creation for X so that gm can run GPU on Linux.
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/SkEGLContext.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/utils/SkEGLContext.h b/include/utils/SkEGLContext.h
index 4b17be1d4a..6aa8518e53 100644
--- a/include/utils/SkEGLContext.h
+++ b/include/utils/SkEGLContext.h
@@ -1,20 +1,36 @@
#ifndef SkEGLContext_DEFINED
#define SkEGLContext_DEFINED
-#include "SkTypes.h"
+#if 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();
+ SkEGLContext();
+ ~SkEGLContext();
- bool init(int width, int height);
+ bool init(int width, int height);
private:
- void* fContext;
+#if defined(SK_BUILD_FOR_MAC)
+ AGLContext context;
+#elif defined(SK_BUILD_FOR_UNIX)
+ GLXContext context;
+ Display *display;
+ Pixmap pixmap;
+ GLXPixmap glxPixmap;
+#else
+
+#endif
};
#endif