summaryrefslogtreecommitdiff
path: root/src/cairo-gl-dispatch.c
diff options
context:
space:
mode:
authorChuanbo Weng <chuanbo.weng@intel.com>2012-10-02 13:58:49 +0200
committerMartin Robinson <mrobinson@igalia.com>2012-12-05 16:17:10 -0800
commitba4a4eae051cd932e59e3092ef36d4f6cded0159 (patch)
tree42abc23906b9cc247bcb6ac1cfc79729deff75f8 /src/cairo-gl-dispatch.c
parent3bedff0c009e645fff2d6f40976b4483871e73e1 (diff)
gl/msaa: Use GL_IMG_multisampled_render_to_texture when available
Some OpenGLES platforms support GL_IMG_multisampled_render_to_texture instead of GL_EXT_multisampled_render_to_texture.
Diffstat (limited to 'src/cairo-gl-dispatch.c')
-rw-r--r--src/cairo-gl-dispatch.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cairo-gl-dispatch.c b/src/cairo-gl-dispatch.c
index 5bffddda..76c3115b 100644
--- a/src/cairo-gl-dispatch.c
+++ b/src/cairo-gl-dispatch.c
@@ -205,6 +205,27 @@ _cairo_gl_dispatch_init_fbo (cairo_gl_dispatch_t *dispatch,
return CAIRO_STATUS_SUCCESS;
}
+static cairo_status_t
+_cairo_gl_dispatch_init_multisampling (cairo_gl_dispatch_t *dispatch,
+ cairo_gl_get_proc_addr_func_t get_proc_addr,
+ int gl_version,
+ cairo_gl_flavor_t gl_flavor)
+{
+ /* For the multisampling table, there are two GLES versions of the
+ * extension, so we put one in the EXT slot and one in the real ES slot.*/
+ cairo_gl_dispatch_name_t dispatch_name = CAIRO_GL_DISPATCH_NAME_CORE;
+ if (gl_flavor == CAIRO_GL_FLAVOR_ES) {
+ if (_cairo_gl_has_extension ("GL_EXT_multisampled_render_to_texture"))
+ dispatch_name = CAIRO_GL_DISPATCH_NAME_EXT;
+ else if (_cairo_gl_has_extension ("GL_IMG_multisampled_render_to_texture"))
+ dispatch_name = CAIRO_GL_DISPATCH_NAME_ES;
+ }
+ _cairo_gl_dispatch_init_entries (dispatch, get_proc_addr,
+ dispatch_multisampling_entries,
+ dispatch_name);
+ return CAIRO_STATUS_SUCCESS;
+}
+
cairo_status_t
_cairo_gl_dispatch_init (cairo_gl_dispatch_t *dispatch,
cairo_gl_get_proc_addr_func_t get_proc_addr)
@@ -231,5 +252,10 @@ _cairo_gl_dispatch_init (cairo_gl_dispatch_t *dispatch,
if (status != CAIRO_STATUS_SUCCESS)
return status;
+ status = _cairo_gl_dispatch_init_multisampling (dispatch, get_proc_addr,
+ gl_version, gl_flavor);
+ if (status != CAIRO_STATUS_SUCCESS)
+ return status;
+
return CAIRO_STATUS_SUCCESS;
}