• Home
  • Raw
  • Download

Lines Matching +full:use +full:- +full:cross

2  * Mesa 3-D graphics library
4 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
49 const GLfloat px = v1[0] - v0[0]; in compute_plane()
50 const GLfloat py = v1[1] - v0[1]; in compute_plane()
51 const GLfloat pz = z1 - z0; in compute_plane()
53 const GLfloat qx = v2[0] - v0[0]; in compute_plane()
54 const GLfloat qy = v2[1] - v0[1]; in compute_plane()
55 const GLfloat qz = z2 - z0; in compute_plane()
58 const GLfloat a = py * qz - pz * qy; in compute_plane()
59 const GLfloat b = pz * qx - px * qz; in compute_plane()
60 const GLfloat c = px * qy - py * qx; in compute_plane()
65 which is equal to "-d" below. */ in compute_plane()
66 const GLfloat d = -(a * v0[0] + b * v0[1] + c * z0); in compute_plane()
83 plane[2] = -1.0; in constant_plane()
91 PLANE[2] = -1.0F; \
104 return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; in solve_plane()
109 ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
118 const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2]; in solve_plane_chan()
134 return -plane[0] / plane[2]; in plane_dx()
140 return -plane[1] / plane[2]; in plane_dy()
147 * Vertices MUST be specified in counter-clockwise order.
154 /* Given a position [0,3]x[0,3] return the sub-pixel sample position. in compute_coveragef()
157 * Jitter sample positions - in compute_coveragef()
158 * - average should be .5 in x & y for each column in compute_coveragef()
159 * - each of the 16 rows and columns should be used once in compute_coveragef()
160 * - the rectangle formed by the first four points in compute_coveragef()
162 * - the distrubition should be fairly even in any given direction in compute_coveragef()
193 const GLfloat dx0 = v1[0] - v0[0]; in compute_coveragef()
194 const GLfloat dy0 = v1[1] - v0[1]; in compute_coveragef()
195 const GLfloat dx1 = v2[0] - v1[0]; in compute_coveragef()
196 const GLfloat dy1 = v2[1] - v1[1]; in compute_coveragef()
197 const GLfloat dx2 = v0[0] - v2[0]; in compute_coveragef()
198 const GLfloat dy2 = v0[1] - v2[1]; in compute_coveragef()
202 assert(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */ in compute_coveragef()
207 /* cross product determines if sample is inside or outside each edge */ in compute_coveragef()
208 GLfloat cross = (dx0 * (sy - v0[1]) - dy0 * (sx - v0[0])); in compute_coveragef() local
209 /* Check if the sample is exactly on an edge. If so, let cross be a in compute_coveragef()
212 if (cross == 0.0F) in compute_coveragef()
213 cross = dx0 + dy0; in compute_coveragef()
214 if (cross < 0.0F) { in compute_coveragef()
216 insideCount -= 1.0F; in compute_coveragef()
221 cross = (dx1 * (sy - v1[1]) - dy1 * (sx - v1[0])); in compute_coveragef()
222 if (cross == 0.0F) in compute_coveragef()
223 cross = dx1 + dy1; in compute_coveragef()
224 if (cross < 0.0F) { in compute_coveragef()
226 insideCount -= 1.0F; in compute_coveragef()
231 cross = (dx2 * (sy - v2[1]) - dy2 * (sx - v2[0])); in compute_coveragef()
232 if (cross == 0.0F) in compute_coveragef()
233 cross = dx2 + dy2; in compute_coveragef()
234 if (cross < 0.0F) { in compute_coveragef()
236 insideCount -= 1.0F; in compute_coveragef()
275 * Examine GL state and set swrast->Triangle to an
283 assert(ctx->Polygon.SmoothFlag); in _swrast_set_aa_triangle_function()
285 if (ctx->Texture._EnabledCoordUnits != 0 in _swrast_set_aa_triangle_function()
287 || swrast->_FogEnabled in _swrast_set_aa_triangle_function()
289 SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri; in _swrast_set_aa_triangle_function()
292 SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; in _swrast_set_aa_triangle_function()
295 assert(SWRAST_CONTEXT(ctx)->Triangle); in _swrast_set_aa_triangle_function()