~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to progs/openvg/trivial/ellipse.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "eglcommon.h"
2
 
 
3
 
#include <VG/openvg.h>
4
 
 
5
 
#include <math.h>
6
 
#include <stdlib.h>
7
 
 
8
 
const VGfloat white_color[4] = {1.0, 1.0, 1.0, 1.0};
9
 
const VGfloat color[4] = {0.0, 0.0, 0.0, 1.0};
10
 
 
11
 
VGPath path;
12
 
VGPaint paint;
13
 
 
14
 
static void
15
 
init(void)
16
 
{
17
 
   VGfloat clearColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */
18
 
   VGfloat fillColor[] = {1.0f, 0.0f, 0.0f, 1.0f};/* red color */
19
 
   static const VGubyte segments[4] = {VG_MOVE_TO_ABS,
20
 
                                       VG_SCCWARC_TO_ABS,
21
 
                                       VG_SCCWARC_TO_ABS,
22
 
                                       VG_CLOSE_PATH};
23
 
   VGfloat data[12];
24
 
   const VGfloat cx = 0, cy=29, width=80, height=40;
25
 
   const VGfloat hw = width * 0.5f;
26
 
   const VGfloat hh = height * 0.5f;
27
 
 
28
 
   data[0] = cx + hw;
29
 
   data[1] = cy;
30
 
   data[2] = hw;
31
 
   data[3] = hh;
32
 
   data[4] = 0;
33
 
   data[5] = cx - hw;
34
 
   data[6] = cy;
35
 
   data[7] = hw;
36
 
   data[8] = hh;
37
 
   data[9] = 0;
38
 
   data[10] = data[0];
39
 
   data[11] = cy;
40
 
 
41
 
   vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
42
 
   vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_NONANTIALIASED);
43
 
 
44
 
 
45
 
   path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
46
 
                       1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
47
 
   if (path == VG_INVALID_HANDLE) {
48
 
      return;
49
 
   }
50
 
   paint = vgCreatePaint();
51
 
   if (paint == VG_INVALID_HANDLE) {
52
 
      vgDestroyPath(path);
53
 
      return;
54
 
   }
55
 
 
56
 
   vgAppendPathData(path, 4, segments, data);
57
 
   vgSetParameterfv(paint, VG_PAINT_COLOR, 4, fillColor);
58
 
   vgSetParameteri( paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
59
 
   vgSetPaint(paint, VG_FILL_PATH);
60
 
}
61
 
 
62
 
/* new window size or exposure */
63
 
static void
64
 
reshape(int w, int h)
65
 
{
66
 
}
67
 
 
68
 
static void
69
 
draw(void)
70
 
{
71
 
   vgClear(0, 0, window_width(), window_height());
72
 
   vgLoadIdentity();
73
 
   vgTranslate(50, 21);
74
 
   vgDrawPath(path, VG_FILL_PATH);
75
 
   vgFlush();
76
 
}
77
 
 
78
 
 
79
 
int main(int argc, char **argv)
80
 
{
81
 
   set_window_size(100, 100);
82
 
   return run(argc, argv, init, reshape,
83
 
              draw, 0);
84
 
}