/**************************************************************************
- *
+ *
* 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.
- *
+ *
**************************************************************************/
/**
assert(aaline->texture->width0 == aaline->texture->height0);
- u_box_origin_2d( size, size, &box );
+ u_box_origin_2d(size, size, &box);
- /* This texture is new, no need to flush.
+ /* This texture is new, no need to flush.
*/
data = pipe->transfer_map(pipe,
aaline->texture,
struct draw_context *draw = aaline->stage.draw;
struct pipe_context *pipe = draw->pipe;
- if (!aaline->fs->aaline_fs &&
- !generate_aaline_fs(aaline))
+ if (!aaline->fs->aaline_fs && !generate_aaline_fs(aaline))
return FALSE;
draw->suspend_flushing = TRUE;
static inline struct aaline_stage *
-aaline_stage( struct draw_stage *stage )
+aaline_stage(struct draw_stage *stage)
{
return (struct aaline_stage *) stage;
}
pos[1] += (-dx * s_a + -dy * c_a);
pos = v[2]->data[posPos];
- pos[0] += ( dx * c_a - dy * s_a);
- pos[1] += ( dx * s_a + dy * c_a);
+ pos[0] += (dx * c_a - dy * s_a);
+ pos[1] += (dx * s_a + dy * c_a);
pos = v[3]->data[posPos];
- pos[0] += ( dx * c_a - -dy * s_a);
- pos[1] += ( dx * s_a + -dy * c_a);
+ pos[0] += (dx * c_a - -dy * s_a);
+ pos[1] += (dx * s_a + -dy * c_a);
pos = v[4]->data[posPos];
pos[0] += (-dx * c_a - dy * s_a);
pos[1] += (-dx * s_a + -dy * c_a);
pos = v[6]->data[posPos];
- pos[0] += ( dx * c_a - dy * s_a);
- pos[1] += ( dx * s_a + dy * c_a);
+ pos[0] += (dx * c_a - dy * s_a);
+ pos[1] += (dx * s_a + dy * c_a);
pos = v[7]->data[posPos];
- pos[0] += ( dx * c_a - -dy * s_a);
- pos[1] += ( dx * s_a + -dy * c_a);
+ pos[0] += (dx * c_a - -dy * s_a);
+ pos[1] += (dx * s_a + -dy * c_a);
/* new texcoords */
tex = v[0]->data[texPos];
/* emit 6 tris for the quad strip */
tri.v[0] = v[2]; tri.v[1] = v[1]; tri.v[2] = v[0];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
tri.v[0] = v[3]; tri.v[1] = v[1]; tri.v[2] = v[2];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
tri.v[0] = v[4]; tri.v[1] = v[3]; tri.v[2] = v[2];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
tri.v[0] = v[5]; tri.v[1] = v[3]; tri.v[2] = v[4];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
tri.v[0] = v[6]; tri.v[1] = v[5]; tri.v[2] = v[4];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
tri.v[0] = v[7]; tri.v[1] = v[5]; tri.v[2] = v[6];
- stage->next->tri( stage->next, &tri );
+ stage->next->tri(stage->next, &tri);
}
struct pipe_context *pipe = draw->pipe;
stage->line = aaline_first_line;
- stage->next->flush( stage->next, flags );
+ stage->next->flush(stage->next, flags);
/* restore original frag shader, texture, sampler state */
draw->suspend_flushing = TRUE;
static void
aaline_reset_stipple_counter(struct draw_stage *stage)
{
- stage->next->reset_stipple_counter( stage->next );
+ stage->next->reset_stipple_counter(stage->next);
}
pipe_sampler_view_reference(&aaline->sampler_view, NULL);
}
- draw_free_temp_verts( stage );
+ draw_free_temp_verts(stage);
/* restore the old entry points */
pipe->create_fs_state = aaline->driver_create_fs_state;
pipe->bind_sampler_states = aaline->driver_bind_sampler_states;
pipe->set_sampler_views = aaline->driver_set_sampler_views;
- FREE( stage );
+ FREE(stage);
}
aaline->stage.reset_stipple_counter = aaline_reset_stipple_counter;
aaline->stage.destroy = aaline_destroy;
- if (!draw_alloc_temp_verts( &aaline->stage, 8 ))
+ if (!draw_alloc_temp_verts(&aaline->stage, 8))
goto fail;
return aaline;
/*
* Create / install AA line drawing / prim stage
*/
- aaline = draw_aaline_stage( draw );
+ aaline = draw_aaline_stage(draw);
if (!aaline)
goto fail;
pipe->bind_sampler_states = aaline_bind_sampler_states;
pipe->set_sampler_views = aaline_set_sampler_views;
-
+
/* Install once everything is known to be OK:
*/
draw->pipeline.aaline = &aaline->stage;
return TRUE;
- fail:
+fail:
if (aaline)
- aaline->stage.destroy( &aaline->stage );
-
+ aaline->stage.destroy(&aaline->stage);
+
return FALSE;
}
/**************************************************************************
- *
+ *
* 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;
}