/**************************************************************************
- *
+ *
* Copyright 2007 VMware, Inc.
* All Rights Reserved.
*
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
/* Authors: Keith Whitwell <keithw@vmware.com>
/**
- * Compute interpolated vertex attributes for 'dst' at position 't'
+ * Compute interpolated vertex attributes for 'dst' at position 't'
* between 'v0' and 'v1'.
* XXX using linear interpolation for all attribs at this time.
*/
static void
-screen_interp( struct draw_context *draw,
- struct vertex_header *dst,
- float t,
- const struct vertex_header *v0,
- const struct vertex_header *v1 )
+screen_interp(struct draw_context *draw,
+ struct vertex_header *dst,
+ float t,
+ const struct vertex_header *v0,
+ const struct vertex_header *v1)
{
uint attr;
uint num_outputs = draw_current_shader_outputs(draw);
struct prim_header newprim = *header;
if (t0 > 0.0) {
- screen_interp( stage->draw, v0new, t0, header->v[0], header->v[1] );
+ screen_interp(stage->draw, v0new, t0, header->v[0], header->v[1]);
newprim.v[0] = v0new;
}
if (t1 < 1.0) {
- screen_interp( stage->draw, v1new, t1, header->v[0], header->v[1] );
+ screen_interp(stage->draw, v1new, t1, header->v[0], header->v[1]);
newprim.v[1] = v1new;
}
- stage->next->line( stage->next, &newprim );
+ stage->next->line(stage->next, &newprim);
}
{
struct stipple_stage *stipple = stipple_stage(stage);
stipple->counter = 0;
- stage->next->reset_stipple_counter( stage->next );
+ stage->next->reset_stipple_counter(stage->next);
}
static void
static void
-stipple_first_line(struct draw_stage *stage,
- struct prim_header *header)
+stipple_first_line(struct draw_stage *stage,
+ struct prim_header *header)
{
struct stipple_stage *stipple = stipple_stage(stage);
struct draw_context *draw = stage->draw;
stipple->factor = draw->rasterizer->line_stipple_factor + 1;
stage->line = stipple_line;
- stage->line( stage, header );
+ stage->line(stage, header);
}
stipple_flush(struct draw_stage *stage, unsigned flags)
{
stage->line = stipple_first_line;
- stage->next->flush( stage->next, flags );
+ stage->next->flush(stage->next, flags);
}
-
-
-static void
-stipple_destroy( struct draw_stage *stage )
+static void
+stipple_destroy(struct draw_stage *stage)
{
- draw_free_temp_verts( stage );
- FREE( stage );
+ draw_free_temp_verts(stage);
+ FREE(stage);
}
/**
* Create line stippler stage
*/
-struct draw_stage *draw_stipple_stage( struct draw_context *draw )
+struct draw_stage *
+draw_stipple_stage(struct draw_context *draw)
{
struct stipple_stage *stipple = CALLOC_STRUCT(stipple_stage);
if (!stipple)
stipple->stage.flush = stipple_flush;
stipple->stage.destroy = stipple_destroy;
- if (!draw_alloc_temp_verts( &stipple->stage, 2 ))
+ if (!draw_alloc_temp_verts(&stipple->stage, 2))
goto fail;
return &stipple->stage;
fail:
if (stipple)
- stipple->stage.destroy( &stipple->stage );
+ stipple->stage.destroy(&stipple->stage);
return NULL;
}