1#include "eglcommon.h"
2
3#include <VG/openvg.h>
4
5#include <math.h>
6#include <stdlib.h>
7#include <stdio.h>
8
9static void
10init(void)
11{
12
13}
14
15/* new window size or exposure */
16static void
17reshape(int w, int h)
18{
19}
20
21const int subtest = 0;
22static void
23draw(void)
24{
25    VGPath line;
26    VGPaint fillPaint;
27    VGubyte lineCommands[3] = {VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS};
28    VGfloat lineCoords[] =   {-2.0f,-1.0f, 0.0f,0.0f, -1.0f, -2.0f};
29    VGfloat clearColor[] = {0.0f, 0.0f, 0.0f, 1.0f};/* black color */
30    VGfloat fillColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */
31    //VGfloat testRadius = 60.0f;
32    VGfloat testRadius = 10.0f;
33    int WINDSIZEX = window_width();
34    int WINDSIZEY = window_height();
35
36    line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
37                        1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
38    fillPaint = vgCreatePaint();
39
40    vgSetf(VG_STROKE_LINE_WIDTH, 1.0f);
41    //vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_ROUND);
42    vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_BUTT);
43    vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
44    //vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_BEVEL);
45
46    vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
47
48    vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
49    vgLoadIdentity();
50    vgTranslate(60, 60);
51    vgScale(testRadius * 2, testRadius * 2);
52
53    vgAppendPathData(line, 3, lineCommands, lineCoords);
54
55    vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
56
57    vgSetPaint(fillPaint, VG_STROKE_PATH);
58
59    vgSetParameterfv(fillPaint, VG_PAINT_COLOR, 4, fillColor);
60    vgSetParameteri( fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
61
62    vgClear(0, 0, WINDSIZEX, WINDSIZEY);
63    vgDrawPath(line, VG_STROKE_PATH);
64
65    vgDestroyPath(line);
66    vgDestroyPaint(fillPaint);
67}
68
69
70int main(int argc, char **argv)
71{
72   set_window_size(100, 100);
73   return run(argc, argv, init, reshape,
74              draw, 0);
75}
76