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

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/draw/draw_pipe_wide_line.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:
54
54
 
55
55
/**
56
56
 * Draw a wide line by drawing a quad (two triangles).
57
 
 * XXX need to disable polygon stipple.
58
57
 */
59
58
static void wideline_line( struct draw_stage *stage,
60
59
                           struct prim_header *header )
78
77
   const float dx = fabsf(pos0[0] - pos2[0]);
79
78
   const float dy = fabsf(pos0[1] - pos2[1]);
80
79
 
 
80
   const boolean gl_rasterization_rules =
 
81
      stage->draw->rasterizer->gl_rasterization_rules;
 
82
 
81
83
   /* small tweak to meet GL specification */
82
 
   const float bias = 0.125f;
 
84
   const float bias = gl_rasterization_rules ? 0.125f : 0.0f;
83
85
 
84
86
   /*
85
87
    * Draw wide line as a quad (two tris) by "stretching" the line along
93
95
      pos1[1] = pos1[1] + half_width - bias;
94
96
      pos2[1] = pos2[1] - half_width - bias;
95
97
      pos3[1] = pos3[1] + half_width - bias;
96
 
      if (pos0[0] < pos2[0]) {
97
 
         /* left to right line */
98
 
         pos0[0] -= 0.5f;
99
 
         pos1[0] -= 0.5f;
100
 
         pos2[0] -= 0.5f;
101
 
         pos3[0] -= 0.5f;
102
 
      }
103
 
      else {
104
 
         /* right to left line */
105
 
         pos0[0] += 0.5f;
106
 
         pos1[0] += 0.5f;
107
 
         pos2[0] += 0.5f;
108
 
         pos3[0] += 0.5f;
 
98
      if (gl_rasterization_rules) {
 
99
         if (pos0[0] < pos2[0]) {
 
100
            /* left to right line */
 
101
            pos0[0] -= 0.5f;
 
102
            pos1[0] -= 0.5f;
 
103
            pos2[0] -= 0.5f;
 
104
            pos3[0] -= 0.5f;
 
105
         }
 
106
         else {
 
107
            /* right to left line */
 
108
            pos0[0] += 0.5f;
 
109
            pos1[0] += 0.5f;
 
110
            pos2[0] += 0.5f;
 
111
            pos3[0] += 0.5f;
 
112
         }
109
113
      }
110
114
   }
111
115
   else {
114
118
      pos1[0] = pos1[0] + half_width + bias;
115
119
      pos2[0] = pos2[0] - half_width + bias;
116
120
      pos3[0] = pos3[0] + half_width + bias;
117
 
      if (pos0[1] < pos2[1]) {
118
 
         /* top to bottom line */
119
 
         pos0[1] -= 0.5f;
120
 
         pos1[1] -= 0.5f;
121
 
         pos2[1] -= 0.5f;
122
 
         pos3[1] -= 0.5f;
123
 
      }
124
 
      else {
125
 
         /* bottom to top line */
126
 
         pos0[1] += 0.5f;
127
 
         pos1[1] += 0.5f;
128
 
         pos2[1] += 0.5f;
129
 
         pos3[1] += 0.5f;
 
121
      if (gl_rasterization_rules) {
 
122
         if (pos0[1] < pos2[1]) {
 
123
            /* top to bottom line */
 
124
            pos0[1] -= 0.5f;
 
125
            pos1[1] -= 0.5f;
 
126
            pos2[1] -= 0.5f;
 
127
            pos3[1] -= 0.5f;
 
128
         }
 
129
         else {
 
130
            /* bottom to top line */
 
131
            pos0[1] += 0.5f;
 
132
            pos1[1] += 0.5f;
 
133
            pos2[1] += 0.5f;
 
134
            pos3[1] += 0.5f;
 
135
         }
130
136
      }
131
137
   }
132
138
 
196
202
struct draw_stage *draw_wide_line_stage( struct draw_context *draw )
197
203
{
198
204
   struct wideline_stage *wide = CALLOC_STRUCT(wideline_stage);
199
 
 
200
 
   draw_alloc_temp_verts( &wide->stage, 4 );
 
205
   if (wide == NULL)
 
206
      goto fail;
201
207
 
202
208
   wide->stage.draw = draw;
203
209
   wide->stage.name = "wide-line";
209
215
   wide->stage.reset_stipple_counter = wideline_reset_stipple_counter;
210
216
   wide->stage.destroy = wideline_destroy;
211
217
 
 
218
   if (!draw_alloc_temp_verts( &wide->stage, 4 ))
 
219
      goto fail;
 
220
 
212
221
   return &wide->stage;
 
222
 
 
223
fail:
 
224
   if (wide)
 
225
      wide->stage.destroy( &wide->stage );
 
226
 
 
227
   return NULL;
213
228
}