ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

s_accum.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.5.2
00004  *
00005  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this software and associated documentation files (the "Software"),
00009  * to deal in the Software without restriction, including without limitation
00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the
00012  * Software is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 
00026 #include "main/glheader.h"
00027 #include "main/context.h"
00028 #include "main/macros.h"
00029 #include "main/imports.h"
00030 #include "main/fbobject.h"
00031 
00032 #include "s_accum.h"
00033 #include "s_context.h"
00034 #include "s_masking.h"
00035 #include "s_span.h"
00036 
00037 
00038 /* XXX this would have to change for accum buffers with more or less
00039  * than 16 bits per color channel.
00040  */
00041 #define ACCUM_SCALE16 32767.0
00042 
00043 
00044 /*
00045  * Accumulation buffer notes
00046  *
00047  * Normally, accumulation buffer values are GLshorts with values in
00048  * [-32767, 32767] which represent floating point colors in [-1, 1],
00049  * as defined by the OpenGL specification.
00050  *
00051  * We optimize for the common case used for full-scene antialiasing:
00052  *    // start with accum buffer cleared to zero
00053  *    glAccum(GL_LOAD, w);   // or GL_ACCUM the first image
00054  *    glAccum(GL_ACCUM, w);
00055  *    ...
00056  *    glAccum(GL_ACCUM, w);
00057  *    glAccum(GL_RETURN, 1.0);
00058  * That is, we start with an empty accumulation buffer and accumulate
00059  * n images, each with weight w = 1/n.
00060  * In this scenario, we can simply store unscaled integer values in
00061  * the accum buffer instead of scaled integers.  We'll also keep track
00062  * of the w value so when we do GL_RETURN we simply divide the accumulated
00063  * values by n (n=1/w).
00064  * This lets us avoid _many_ int->float->int conversions.
00065  */
00066 
00067 
00068 #if CHAN_BITS == 8
00069 /* enable the optimization */
00070 #define USE_OPTIMIZED_ACCUM  1
00071 #else
00072 #define USE_OPTIMIZED_ACCUM  0
00073 #endif
00074 
00075 
00081 static void
00082 rescale_accum( GLcontext *ctx )
00083 {
00084    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00085    struct gl_renderbuffer *rb
00086       = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
00087    const GLfloat s = swrast->_IntegerAccumScaler * (32767.0F / CHAN_MAXF);
00088 
00089    assert(rb);
00090    assert(rb->_BaseFormat == GL_RGBA);
00091    /* add other types in future? */
00092    assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
00093    assert(swrast->_IntegerAccumMode);
00094 
00095    if (rb->GetPointer(ctx, rb, 0, 0)) {
00096       /* directly-addressable memory */
00097       GLuint y;
00098       for (y = 0; y < rb->Height; y++) {
00099          GLuint i;
00100          GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, 0, y);
00101          for (i = 0; i < 4 * rb->Width; i++) {
00102             acc[i] = (GLshort) (acc[i] * s);
00103          }
00104       }
00105    }
00106    else {
00107       /* use get/put row funcs */
00108       GLuint y;
00109       for (y = 0; y < rb->Height; y++) {
00110          GLshort accRow[MAX_WIDTH * 4];
00111          GLuint i;
00112          rb->GetRow(ctx, rb, rb->Width, 0, y, accRow);
00113          for (i = 0; i < 4 * rb->Width; i++) {
00114             accRow[i] = (GLshort) (accRow[i] * s);
00115          }
00116          rb->PutRow(ctx, rb, rb->Width, 0, y, accRow, NULL);
00117       }
00118    }
00119 
00120    swrast->_IntegerAccumMode = GL_FALSE;
00121 }
00122 
00123 
00124 
00128 void
00129 _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
00130 {
00131    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00132    GLuint x, y, width, height;
00133 
00134    if (ctx->Visual.accumRedBits == 0) {
00135       /* No accumulation buffer! Not an error. */
00136       return;
00137    }
00138 
00139    if (!rb || !rb->Data)
00140       return;
00141 
00142    assert(rb->_BaseFormat == GL_RGBA);
00143    /* add other types in future? */
00144    assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
00145 
00146    /* bounds, with scissor */
00147    x = ctx->DrawBuffer->_Xmin;
00148    y = ctx->DrawBuffer->_Ymin;
00149    width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
00150    height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
00151 
00152    if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
00153       const GLfloat accScale = 32767.0;
00154       GLshort clearVal[4];
00155       GLuint i;
00156 
00157       clearVal[0] = (GLshort) (ctx->Accum.ClearColor[0] * accScale);
00158       clearVal[1] = (GLshort) (ctx->Accum.ClearColor[1] * accScale);
00159       clearVal[2] = (GLshort) (ctx->Accum.ClearColor[2] * accScale);
00160       clearVal[3] = (GLshort) (ctx->Accum.ClearColor[3] * accScale);
00161 
00162       for (i = 0; i < height; i++) {
00163          rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL);
00164       }
00165    }
00166    else {
00167       /* someday support other sizes */
00168    }
00169 
00170    /* update optimized accum state vars */
00171    if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 &&
00172        ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) {
00173 #if USE_OPTIMIZED_ACCUM
00174       swrast->_IntegerAccumMode = GL_TRUE;
00175 #else
00176       swrast->_IntegerAccumMode = GL_FALSE;
00177 #endif
00178       swrast->_IntegerAccumScaler = 0.0;  /* denotes empty accum buffer */
00179    }
00180    else {
00181       swrast->_IntegerAccumMode = GL_FALSE;
00182    }
00183 }
00184 
00185 
00186 static void
00187 accum_add(GLcontext *ctx, GLfloat value,
00188           GLint xpos, GLint ypos, GLint width, GLint height )
00189 {
00190    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00191    struct gl_renderbuffer *rb
00192       = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
00193 
00194    assert(rb);
00195 
00196    /* Leave optimized accum buffer mode */
00197    if (swrast->_IntegerAccumMode)
00198       rescale_accum(ctx);
00199 
00200    if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
00201       const GLshort incr = (GLshort) (value * ACCUM_SCALE16);
00202       if (rb->GetPointer(ctx, rb, 0, 0)) {
00203          GLint i, j;
00204          for (i = 0; i < height; i++) {
00205             GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
00206             for (j = 0; j < 4 * width; j++) {
00207                acc[j] += incr;
00208             }
00209          }
00210       }
00211       else {
00212          GLint i, j;
00213          for (i = 0; i < height; i++) {
00214             GLshort accRow[4 * MAX_WIDTH];
00215             rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
00216             for (j = 0; j < 4 * width; j++) {
00217                accRow[j] += incr;
00218             }
00219             rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
00220          }
00221       }
00222    }
00223    else {
00224       /* other types someday */
00225    }
00226 }
00227 
00228 
00229 static void
00230 accum_mult(GLcontext *ctx, GLfloat mult,
00231            GLint xpos, GLint ypos, GLint width, GLint height )
00232 {
00233    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00234    struct gl_renderbuffer *rb
00235       = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
00236 
00237    assert(rb);
00238 
00239    /* Leave optimized accum buffer mode */
00240    if (swrast->_IntegerAccumMode)
00241       rescale_accum(ctx);
00242 
00243    if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
00244       if (rb->GetPointer(ctx, rb, 0, 0)) {
00245          GLint i, j;
00246          for (i = 0; i < height; i++) {
00247             GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
00248             for (j = 0; j < 4 * width; j++) {
00249                acc[j] = (GLshort) (acc[j] * mult);
00250             }
00251          }
00252       }
00253       else {
00254          GLint i, j;
00255          for (i = 0; i < height; i++) {
00256             GLshort accRow[4 * MAX_WIDTH];
00257             rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
00258             for (j = 0; j < 4 * width; j++) {
00259                accRow[j] = (GLshort) (accRow[j] * mult);
00260             }
00261             rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
00262          }
00263       }
00264    }
00265    else {
00266       /* other types someday */
00267    }
00268 }
00269 
00270 
00271 
00272 static void
00273 accum_accum(GLcontext *ctx, GLfloat value,
00274             GLint xpos, GLint ypos, GLint width, GLint height )
00275 {
00276    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00277    struct gl_renderbuffer *rb
00278       = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
00279    const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
00280 
00281    assert(rb);
00282 
00283    if (!ctx->ReadBuffer->_ColorReadBuffer) {
00284       /* no read buffer - OK */
00285       return;
00286    }
00287 
00288    /* May have to leave optimized accum buffer mode */
00289    if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
00290       swrast->_IntegerAccumScaler = value;
00291    if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
00292       rescale_accum(ctx);
00293 
00294    if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
00295       const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
00296       GLshort accumRow[4 * MAX_WIDTH];
00297       GLchan rgba[MAX_WIDTH][4];
00298       GLint i;
00299 
00300       for (i = 0; i < height; i++) {
00301          GLshort *acc;
00302          if (directAccess) {
00303             acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
00304          }
00305          else {
00306             rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
00307             acc = accumRow;
00308          }
00309 
00310          /* read colors from color buffer */
00311          _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
00312                                 xpos, ypos + i, CHAN_TYPE, rgba);
00313 
00314          /* do accumulation */
00315          if (swrast->_IntegerAccumMode) {
00316             /* simply add integer color values into accum buffer */
00317             GLint j;
00318             for (j = 0; j < width; j++) {
00319                acc[j * 4 + 0] += rgba[j][RCOMP];
00320                acc[j * 4 + 1] += rgba[j][GCOMP];
00321                acc[j * 4 + 2] += rgba[j][BCOMP];
00322                acc[j * 4 + 3] += rgba[j][ACOMP];
00323             }
00324          }
00325          else {
00326             /* scaled integer (or float) accum buffer */
00327             GLint j;
00328             for (j = 0; j < width; j++) {
00329                acc[j * 4 + 0] += (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
00330                acc[j * 4 + 1] += (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
00331                acc[j * 4 + 2] += (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
00332                acc[j * 4 + 3] += (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
00333             }
00334          }
00335 
00336          if (!directAccess) {
00337             rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
00338          }
00339       }
00340    }
00341    else {
00342       /* other types someday */
00343    }
00344 }
00345 
00346 
00347 
00348 static void
00349 accum_load(GLcontext *ctx, GLfloat value,
00350            GLint xpos, GLint ypos, GLint width, GLint height )
00351 {
00352    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00353    struct gl_renderbuffer *rb
00354       = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
00355    const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
00356 
00357    assert(rb);
00358 
00359    if (!ctx->ReadBuffer->_ColorReadBuffer) {
00360       /* no read buffer - OK */
00361       return;
00362    }
00363 
00364    /* This is a change to go into optimized accum buffer mode */
00365    if (value > 0.0 && value <= 1.0) {
00366 #if USE_OPTIMIZED_ACCUM
00367       swrast->_IntegerAccumMode = GL_TRUE;
00368 #else
00369       swrast->_IntegerAccumMode = GL_FALSE;
00370 #endif
00371       swrast->_IntegerAccumScaler = value;
00372    }
00373    else {
00374       swrast->_IntegerAccumMode = GL_FALSE;
00375       swrast->_IntegerAccumScaler = 0.0;
00376    }
00377 
00378    if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
00379       const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
00380       GLshort accumRow[4 * MAX_WIDTH];
00381       GLchan rgba[MAX_WIDTH][4];
00382       GLint i;
00383 
00384       for (i = 0; i < height; i++) {
00385          GLshort *acc;
00386          if (directAccess) {
00387             acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
00388          }
00389          else {
00390             rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
00391             acc = accumRow;
00392          }
00393 
00394          /* read colors from color buffer */
00395          _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
00396                                 xpos, ypos + i, CHAN_TYPE, rgba);
00397 
00398          /* do load */
00399          if (swrast->_IntegerAccumMode) {
00400             /* just copy values in */
00401             GLint j;
00402             assert(swrast->_IntegerAccumScaler > 0.0);
00403             assert(swrast->_IntegerAccumScaler <= 1.0);
00404             for (j = 0; j < width; j++) {
00405                acc[j * 4 + 0] = rgba[j][RCOMP];
00406                acc[j * 4 + 1] = rgba[j][GCOMP];
00407                acc[j * 4 + 2] = rgba[j][BCOMP];
00408                acc[j * 4 + 3] = rgba[j][ACOMP];
00409             }
00410          }
00411          else {
00412             /* scaled integer (or float) accum buffer */
00413             GLint j;
00414             for (j = 0; j < width; j++) {
00415                acc[j * 4 + 0] = (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
00416                acc[j * 4 + 1] = (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
00417                acc[j * 4 + 2] = (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
00418                acc[j * 4 + 3] = (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
00419             }
00420          }
00421 
00422          if (!directAccess) {
00423             rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
00424          }
00425       }
00426    }
00427 }
00428 
00429 
00430 static void
00431 accum_return(GLcontext *ctx, GLfloat value,
00432              GLint xpos, GLint ypos, GLint width, GLint height )
00433 {
00434    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00435    struct gl_framebuffer *fb = ctx->DrawBuffer;
00436    struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer;
00437    const GLboolean directAccess
00438       = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL);
00439    const GLboolean masking = (!ctx->Color.ColorMask[RCOMP] ||
00440                               !ctx->Color.ColorMask[GCOMP] ||
00441                               !ctx->Color.ColorMask[BCOMP] ||
00442                               !ctx->Color.ColorMask[ACOMP]);
00443 
00444    static GLchan multTable[32768];
00445    static GLfloat prevMult = 0.0;
00446    const GLfloat mult = swrast->_IntegerAccumScaler;
00447    const GLint max = MIN2((GLint) (256 / mult), 32767);
00448 
00449    /* May have to leave optimized accum buffer mode */
00450    if (swrast->_IntegerAccumMode && value != 1.0)
00451       rescale_accum(ctx);
00452 
00453    if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) {
00454       /* build lookup table to avoid many floating point multiplies */
00455       GLint j;
00456       assert(swrast->_IntegerAccumScaler <= 1.0);
00457       if (mult != prevMult) {
00458          for (j = 0; j < max; j++)
00459             multTable[j] = IROUND((GLfloat) j * mult);
00460          prevMult = mult;
00461       }
00462    }
00463 
00464    if (accumRb->DataType == GL_SHORT ||
00465        accumRb->DataType == GL_UNSIGNED_SHORT) {
00466       const GLfloat scale = value * CHAN_MAXF / ACCUM_SCALE16;
00467       GLuint buffer;
00468       GLint i;
00469 
00470       /* XXX maybe transpose the 'i' and 'buffer' loops??? */
00471       for (i = 0; i < height; i++) {
00472          GLshort accumRow[4 * MAX_WIDTH];
00473          GLshort *acc;
00474          SWspan span;
00475 
00476          /* init color span */
00477          INIT_SPAN(span, GL_BITMAP);
00478          span.end = width;
00479          span.arrayMask = SPAN_RGBA;
00480          span.x = xpos;
00481          span.y = ypos + i;
00482 
00483          if (directAccess) {
00484             acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i);
00485          }
00486          else {
00487             accumRb->GetRow(ctx, accumRb, width, xpos, ypos + i, accumRow);
00488             acc = accumRow;
00489          }
00490 
00491          /* get the colors to return */
00492          if (swrast->_IntegerAccumMode) {
00493             GLint j;
00494             for (j = 0; j < width; j++) {
00495                ASSERT(acc[j * 4 + 0] < max);
00496                ASSERT(acc[j * 4 + 1] < max);
00497                ASSERT(acc[j * 4 + 2] < max);
00498                ASSERT(acc[j * 4 + 3] < max);
00499                span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]];
00500                span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]];
00501                span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]];
00502                span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]];
00503             }
00504          }
00505          else {
00506             /* scaled integer (or float) accum buffer */
00507             GLint j;
00508             for (j = 0; j < width; j++) {
00509 #if CHAN_BITS==32
00510                GLchan r = acc[j * 4 + 0] * scale;
00511                GLchan g = acc[j * 4 + 1] * scale;
00512                GLchan b = acc[j * 4 + 2] * scale;
00513                GLchan a = acc[j * 4 + 3] * scale;
00514 #else
00515                GLint r = IROUND( (GLfloat) (acc[j * 4 + 0]) * scale );
00516                GLint g = IROUND( (GLfloat) (acc[j * 4 + 1]) * scale );
00517                GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale );
00518                GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale );
00519 #endif
00520                span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX );
00521                span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX );
00522                span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX );
00523                span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX );
00524             }
00525          }
00526 
00527          /* store colors */
00528          for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
00529             struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer];
00530             if (masking) {
00531                _swrast_mask_rgba_span(ctx, rb, &span);
00532             }
00533             rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL);
00534          }
00535       }
00536    }
00537    else {
00538       /* other types someday */
00539    }
00540 }
00541 
00542 
00543 
00547 void
00548 _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
00549 {
00550    SWcontext *swrast = SWRAST_CONTEXT(ctx);
00551    GLint xpos, ypos, width, height;
00552 
00553    if (SWRAST_CONTEXT(ctx)->NewState)
00554       _swrast_validate_derived( ctx );
00555 
00556    if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
00557       _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer");
00558       return;
00559    }
00560 
00561    RENDER_START(swrast, ctx);
00562 
00563    /* Compute region after calling RENDER_START so that we know the
00564     * drawbuffer's size/bounds are up to date.
00565     */
00566    xpos = ctx->DrawBuffer->_Xmin;
00567    ypos = ctx->DrawBuffer->_Ymin;
00568    width =  ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
00569    height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
00570 
00571    switch (op) {
00572       case GL_ADD:
00573          if (value != 0.0F) {
00574             accum_add(ctx, value, xpos, ypos, width, height);
00575      }
00576      break;
00577       case GL_MULT:
00578          if (value != 1.0F) {
00579             accum_mult(ctx, value, xpos, ypos, width, height);
00580      }
00581      break;
00582       case GL_ACCUM:
00583          if (value != 0.0F) {
00584             accum_accum(ctx, value, xpos, ypos, width, height);
00585          }
00586      break;
00587       case GL_LOAD:
00588          accum_load(ctx, value, xpos, ypos, width, height);
00589      break;
00590       case GL_RETURN:
00591          accum_return(ctx, value, xpos, ypos, width, height);
00592      break;
00593       default:
00594          _mesa_problem(ctx, "invalid mode in _swrast_Accum()");
00595          break;
00596    }
00597 
00598    RENDER_FINISH(swrast, ctx);
00599 }

Generated on Sun May 27 2012 04:20:42 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.