132001f49Smrg#include "eglcommon.h"
232001f49Smrg
332001f49Smrg#include <VG/openvg.h>
432001f49Smrg
532001f49Smrg#include <math.h>
632001f49Smrg#include <stdlib.h>
732001f49Smrg#include <stdio.h>
832001f49Smrg
932001f49Smrgstatic void
1032001f49Smrginit(void)
1132001f49Smrg{
1232001f49Smrg
1332001f49Smrg}
1432001f49Smrg
1532001f49Smrg/* new window size or exposure */
1632001f49Smrgstatic void
1732001f49Smrgreshape(int w, int h)
1832001f49Smrg{
1932001f49Smrg}
2032001f49Smrg
2132001f49Smrgconst int subtest = 0;
2232001f49Smrgstatic void
2332001f49Smrgdraw(void)
2432001f49Smrg{
2532001f49Smrg    VGPath line;
2632001f49Smrg    VGPaint fillPaint;
2732001f49Smrg    VGubyte lineCommands[3] = {VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS};
2832001f49Smrg    VGfloat lineCoords[] =   {-2.0f,-1.0f, 0.0f,0.0f, -1.0f, -2.0f};
2932001f49Smrg    VGfloat clearColor[] = {0.0f, 0.0f, 0.0f, 1.0f};/* black color */
3032001f49Smrg    VGfloat fillColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */
3132001f49Smrg    //VGfloat testRadius = 60.0f;
3232001f49Smrg    VGfloat testRadius = 10.0f;
3332001f49Smrg    int WINDSIZEX = window_width();
3432001f49Smrg    int WINDSIZEY = window_height();
3532001f49Smrg
3632001f49Smrg    line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
3732001f49Smrg                        1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
3832001f49Smrg    fillPaint = vgCreatePaint();
3932001f49Smrg
4032001f49Smrg    vgSetf(VG_STROKE_LINE_WIDTH, 1.0f);
4132001f49Smrg    //vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_ROUND);
4232001f49Smrg    vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_BUTT);
4332001f49Smrg    vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
4432001f49Smrg    //vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_BEVEL);
4532001f49Smrg
4632001f49Smrg    vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
4732001f49Smrg
4832001f49Smrg    vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
4932001f49Smrg    vgLoadIdentity();
5032001f49Smrg    vgTranslate(60, 60);
5132001f49Smrg    vgScale(testRadius * 2, testRadius * 2);
5232001f49Smrg
5332001f49Smrg    vgAppendPathData(line, 3, lineCommands, lineCoords);
5432001f49Smrg
5532001f49Smrg    vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
5632001f49Smrg
5732001f49Smrg    vgSetPaint(fillPaint, VG_STROKE_PATH);
5832001f49Smrg
5932001f49Smrg    vgSetParameterfv(fillPaint, VG_PAINT_COLOR, 4, fillColor);
6032001f49Smrg    vgSetParameteri( fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
6132001f49Smrg
6232001f49Smrg    vgClear(0, 0, WINDSIZEX, WINDSIZEY);
6332001f49Smrg    vgDrawPath(line, VG_STROKE_PATH);
6432001f49Smrg
6532001f49Smrg    vgDestroyPath(line);
6632001f49Smrg    vgDestroyPaint(fillPaint);
6732001f49Smrg}
6832001f49Smrg
6932001f49Smrg
7032001f49Smrgint main(int argc, char **argv)
7132001f49Smrg{
7232001f49Smrg   set_window_size(100, 100);
7332001f49Smrg   return run(argc, argv, init, reshape,
7432001f49Smrg              draw, 0);
7532001f49Smrg}
76