summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-05-31 12:38:21 +0800
committerChia-I Wu <olv@lunarg.com>2010-05-31 13:28:01 +0800
commite5b5d84e8a87a5603a84f8c4625592a278bcf9af (patch)
treea5d482b763b9844676445bcaa469fb6f65bad3ee /src/gallium
parenta2f311530790d7499cec3ee22132d7f391c850f3 (diff)
st/vega: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/SConscript1
-rw-r--r--src/gallium/state_trackers/vega/SConscript51
-rw-r--r--src/gallium/state_trackers/vega/api_filters.c11
-rw-r--r--src/gallium/state_trackers/vega/arc.c3
-rw-r--r--src/gallium/state_trackers/vega/stroker.c5
5 files changed, 62 insertions, 9 deletions
diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index f47907eed3..c0d48a8268 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -16,6 +16,7 @@ if platform != 'embedded':
SConscript('state_trackers/dri/SConscript')
SConscript('state_trackers/xorg/SConscript')
SConscript('state_trackers/egl/SConscript')
+ SConscript('state_trackers/vega/SConscript')
if platform == 'windows':
SConscript('state_trackers/wgl/SConscript')
diff --git a/src/gallium/state_trackers/vega/SConscript b/src/gallium/state_trackers/vega/SConscript
new file mode 100644
index 0000000000..548053eb64
--- /dev/null
+++ b/src/gallium/state_trackers/vega/SConscript
@@ -0,0 +1,51 @@
+#######################################################################
+# SConscript for vega state_tracker
+
+Import('*')
+
+if 'egl' in env['statetrackers']:
+
+ env = env.Clone()
+
+ env.Append(CPPPATH = [
+ '#/src/mapi',
+ ])
+
+ vega_sources = [
+ 'api.c',
+ 'api_context.c',
+ 'api_filters.c',
+ 'api_images.c',
+ 'api_masks.c',
+ 'api_misc.c',
+ 'api_paint.c',
+ 'api_params.c',
+ 'api_path.c',
+ 'api_text.c',
+ 'api_transform.c',
+ 'vgu.c',
+ 'vg_context.c',
+ 'vg_manager.c',
+ 'vg_state.c',
+ 'vg_translate.c',
+ 'polygon.c',
+ 'bezier.c',
+ 'path.c',
+ 'paint.c',
+ 'arc.c',
+ 'image.c',
+ 'renderer.c',
+ 'stroker.c',
+ 'mask.c',
+ 'shader.c',
+ 'shaders_cache.c',
+ ]
+
+ # vgapi_header must be generated first
+ env.Depends(vega_sources, vgapi_header)
+
+ st_vega = env.ConvenienceLibrary(
+ target = 'st_vega',
+ source = vega_sources,
+ )
+ Export('st_vega')
diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c
index 144fb8f323..8ace985336 100644
--- a/src/gallium/state_trackers/vega/api_filters.c
+++ b/src/gallium/state_trackers/vega/api_filters.c
@@ -42,6 +42,7 @@
#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_sampler.h"
+#include "util/u_string.h"
#include "asm_filters.h"
@@ -271,7 +272,7 @@ static struct vg_shader * setup_convolution(struct vg_context *ctx, void *user_d
VGint num_consts = (VGint)(long)(user_data);
struct vg_shader *shader;
- snprintf(buffer, 1023, convolution_asm, num_consts, num_consts / 2 + 1);
+ util_snprintf(buffer, 1023, convolution_asm, num_consts, num_consts / 2 + 1);
shader = shader_create_from_text(ctx->pipe, buffer, 200,
PIPE_SHADER_FRAGMENT);
@@ -299,16 +300,16 @@ static struct vg_shader * setup_lookup_single(struct vg_context *ctx, void *user
switch(channel) {
case VG_RED:
- snprintf(buffer, 1023, lookup_single_asm, "xxxx");
+ util_snprintf(buffer, 1023, lookup_single_asm, "xxxx");
break;
case VG_GREEN:
- snprintf(buffer, 1023, lookup_single_asm, "yyyy");
+ util_snprintf(buffer, 1023, lookup_single_asm, "yyyy");
break;
case VG_BLUE:
- snprintf(buffer, 1023, lookup_single_asm, "zzzz");
+ util_snprintf(buffer, 1023, lookup_single_asm, "zzzz");
break;
case VG_ALPHA:
- snprintf(buffer, 1023, lookup_single_asm, "wwww");
+ util_snprintf(buffer, 1023, lookup_single_asm, "wwww");
break;
default:
debug_assert(!"Unknown color channel");
diff --git a/src/gallium/state_trackers/vega/arc.c b/src/gallium/state_trackers/vega/arc.c
index 2d12340870..65a985fbbb 100644
--- a/src/gallium/state_trackers/vega/arc.c
+++ b/src/gallium/state_trackers/vega/arc.c
@@ -33,8 +33,7 @@
#include "path.h"
#include "util/u_debug.h"
-
-#include <math.h>
+#include "util/u_math.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
diff --git a/src/gallium/state_trackers/vega/stroker.c b/src/gallium/state_trackers/vega/stroker.c
index 68a52029db..d89b6cf25c 100644
--- a/src/gallium/state_trackers/vega/stroker.c
+++ b/src/gallium/state_trackers/vega/stroker.c
@@ -35,7 +35,7 @@
#include "path_utils.h"
#include "polygon.h"
-#include "math.h"
+#include "util/u_math.h"
#ifndef M_2PI
#define M_2PI 6.28318530717958647692528676655900576
@@ -870,7 +870,7 @@ static VGboolean vg_stroke_outline(struct stroke_iterator *it,
VGboolean cap_first,
VGfloat *start_tangent)
{
- const int MAX_OFFSET = 16;
+#define MAX_OFFSET 16
struct bezier offset_curves[MAX_OFFSET];
VGPathCommand first_element;
VGfloat start[2], prev[2];
@@ -1017,6 +1017,7 @@ static VGboolean vg_stroke_outline(struct stroke_iterator *it,
#endif
return VG_FALSE;
}
+#undef MAX_OFFSET
}
static void stroker_process_subpath(struct stroker *stroker)