@@ -261,8 +261,10 @@ _cairo_gl_ensure_framebuffer (cairo_gl_context_t *ctx,
ctx->tex_target,
surface->tex,
0);
+#if CAIRO_HAS_GL_SURFACE
glDrawBuffer (GL_COLOR_ATTACHMENT0);
glReadBuffer (GL_COLOR_ATTACHMENT0);
+#endif
status = dispatch->CheckFramebufferStatus (GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
@@ -342,8 +344,10 @@ _cairo_gl_context_set_destination (cairo_gl_context_t *ctx,
} else {
ctx->make_current (ctx, surface);
ctx->dispatch.BindFramebuffer (GL_FRAMEBUFFER, 0);
+#if CAIRO_HAS_GL_SURFACE
glDrawBuffer (GL_BACK_LEFT);
glReadBuffer (GL_BACK_LEFT);
+#endif
}
glViewport (0, 0, surface->width, surface->height);
@@ -136,4 +136,8 @@
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#endif
+#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#endif
+
#endif /* CAIRO_GL_EXT_DEF_PRIVATE_H */
@@ -50,8 +50,13 @@
#include "cairo-gl.h"
+#if CAIRO_HAS_GL_SURFACE
#include <GL/gl.h>
#include <GL/glext.h>
+#elif CAIRO_HAS_GLESV2_SURFACE
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#endif
#define CAIRO_GL_GRADIENT_CACHE_SIZE 4096
@@ -58,8 +58,14 @@
#include "cairo-gl.h"
+#if CAIRO_HAS_GL_SURFACE
#include <GL/gl.h>
#include <GL/glext.h>
+#elif CAIRO_HAS_GLESV2_SURFACE
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#endif
+
#include "cairo-gl-ext-def-private.h"
#define DEBUG_GL 0
@@ -62,7 +62,7 @@
#include "cairo.h"
-#if CAIRO_HAS_GL_SURFACE
+#if CAIRO_HAS_GL_SURFACE || CAIRO_HAS_GLESV2_SURFACE
CAIRO_BEGIN_DECLS