st/mesa: simplify st_update_viewport
[mesa.git] / src / mesa / swrast_setup / ss_tritmp.h
index fe1f93a397a0596f3895abc50dfdfed85a7f6be5..c88747274bdc10749aaa1fe748f54795fbad647e 100644 (file)
@@ -22,7 +22,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Keith Whitwell <keith@tungstengraphics.com>
+ *    Keith Whitwell <keithw@vmware.com>
  */
 
 
@@ -58,7 +58,7 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
 
       if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
       {
-        facing = (cc < 0.0) ^ ctx->Polygon._FrontBit;
+        facing = (cc < 0.0F) ^ _mesa_polygon_get_front_bit(ctx);
 
         if (IND & SS_UNFILLED_BIT)
            mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode;
@@ -138,12 +138,12 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
           * so no MRD value is used here.
           */
         offset = ctx->Polygon.OffsetUnits;
-        if (cc * cc > 1e-16) {
+        if (cc * cc > 1e-16F) {
            const GLfloat ez = z[0] - z[2];
            const GLfloat fz = z[1] - z[2];
            const GLfloat oneOverArea = 1.0F / cc;
-           const GLfloat dzdx = FABSF((ey * fz - ez * fy) * oneOverArea);
-           const GLfloat dzdy = FABSF((ez * fx - ex * fz) * oneOverArea);
+           const GLfloat dzdx = fabsf((ey * fz - ez * fy) * oneOverArea);
+           const GLfloat dzdy = fabsf((ez * fx - ex * fz) * oneOverArea);
            offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor;
         }
          /* new Z values */