[cairo] [patch] gl: re-enable gl-surface-source test for nsgl
Henry (Yu) Song - SISA
hsong at sisa.samsung.com
Tue Jan 8 10:01:20 PST 2013
>From 4d4559ce571a789105376311f1eecbe6031cbf02 Mon Sep 17 00:00:00 2001
From: Henry Song <hsong at sisa.samsung.com>
Date: Tue, 8 Jan 2013 09:57:32 -0800
Subject: [PATCH] gl: re-enable gl-surface-source test for nsgl, and a little
bug fix in cairo_nsgl_device_create(), we need to retain it before
makecurrent
---
src/cairo-nsgl-context.m | 3 +--
test/Makefile.am | 8 +++++++-
test/Makefile.sources | 5 ++++-
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/cairo-nsgl-context.m b/src/cairo-nsgl-context.m
index b3e893c..b40e035 100644
--- a/src/cairo-nsgl-context.m
+++ b/src/cairo-nsgl-context.m
@@ -121,9 +121,8 @@ cairo_nsgl_device_create (void *abstract_ctx)
if (unlikely (ctx == NULL))
return _cairo_gl_context_create_in_error (CAIRO_STATUS_NO_MEMORY);
- [ctx->context makeCurrentContext];
-
ctx->context = [nsgl_ctx retain];
+ [ctx->context makeCurrentContext];
ctx->base.acquire = _nsgl_acquire;
ctx->base.release = _nsgl_release;
diff --git a/test/Makefile.am b/test/Makefile.am
index 1e148d7..472d1b4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -17,7 +17,13 @@ endif
endif
if CAIRO_HAS_GL_SURFACE
-test_sources += $(gl_surface_test_sources)
+if CAIRO_HAS_GLX_FUNCTIONS
+ test_sources += $(gl_surface_test_sources)
+else
+if CAIRO_HAS_NSGL_FUNCTIONS
+ test_sources += $(nsgl_surface_test_sources)
+endif
+endif
endif
# Need to add quartz-surface-source
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 74a3623..fc0625c 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -390,9 +390,12 @@ ft_font_test_sources = \
ft-text-vertical-layout-type3.c \
ft-text-antialias-none.c
-#gl_surface_test_sources = \
+gl_surface_test_sources = \
gl-surface-source.c
+nsgl_surface_test_sources = \
+ nsgl-surface-source.m
+
quartz_surface_test_sources = quartz-surface-source.c
pdf_surface_test_sources = \
--
1.8.0.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130108/618e1504/attachment.html>
More information about the cairo
mailing list