~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/unichrome/via_state.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
328
328
         /* KW:  This test never succeeds:
329
329
          */
330
330
         if (t->regTexFM == HC_HTXnFM_Index8) {
331
 
            struct gl_color_table *table = &texObj->Palette;
332
 
            GLfloat *tableF = (GLfloat *)table->Table;
 
331
            const struct gl_color_table *table = &texObj->Palette;
 
332
            const GLfloat *tableF = table->TableF;
333
333
 
334
334
            BEGIN_RING(2 + table->Size);
335
335
            OUT_RING( HC_HEADER2 );
453
453
         /* KW:  This test never succeeds:
454
454
          */
455
455
         if (t->regTexFM == HC_HTXnFM_Index8) {
456
 
            struct gl_color_table *table = &texObj->Palette;
457
 
            GLfloat *tableF = (GLfloat *)table->Table;
 
456
            const struct gl_color_table *table = &texObj->Palette;
 
457
            const GLfloat *tableF = table->TableF;
458
458
 
459
459
            BEGIN_RING(2 + table->Size);
460
460
            OUT_RING( HC_HEADER2 );
476
476
    */
477
477
   if (ctx->Polygon.StippleFlag) {
478
478
      GLuint *stipple = &ctx->PolygonStipple[0];
 
479
      __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
 
480
      struct via_renderbuffer *const vrb = 
 
481
        (struct via_renderbuffer *) dPriv->driverPrivate;
479
482
      GLint i;
480
483
        
481
484
      BEGIN_RING(38);
498
501
      OUT_RING( HC_HEADER2 );                     
499
502
      OUT_RING( (HC_ParaType_NotTex << 16) );
500
503
      OUT_RING( (HC_SubA_HSPXYOS << 24) | 
501
 
                (((32- vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
 
504
                (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
502
505
      OUT_RING( (HC_SubA_HSPXYOS << 24) | 
503
 
                (((32 - vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
 
506
                (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
504
507
 
505
508
      ADVANCE_RING();
506
509
   }
720
723
void viaCalcViewport(GLcontext *ctx)
721
724
{
722
725
    struct via_context *vmesa = VIA_CONTEXT(ctx);
 
726
    __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
 
727
    struct via_renderbuffer *const vrb = 
 
728
      (struct via_renderbuffer *) dPriv->driverPrivate;
723
729
    const GLfloat *v = ctx->Viewport._WindowMap.m;
724
730
    GLfloat *m = vmesa->ViewportMatrix.m;
725
731
    
726
732
    /* See also via_translate_vertex.
727
733
     */
728
734
    m[MAT_SX] =   v[MAT_SX];
729
 
    m[MAT_TX] =   v[MAT_TX] + SUBPIXEL_X + vmesa->drawXoff;
 
735
    m[MAT_TX] =   v[MAT_TX] + SUBPIXEL_X + vrb->drawXoff;
730
736
    m[MAT_SY] = - v[MAT_SY];
731
 
    m[MAT_TY] = - v[MAT_TY] + vmesa->driDrawable->h + SUBPIXEL_Y;
 
737
    m[MAT_TY] = - v[MAT_TY] + dPriv->h + SUBPIXEL_Y;
732
738
    m[MAT_SZ] =   v[MAT_SZ] * (1.0 / vmesa->depth_max);
733
739
    m[MAT_TZ] =   v[MAT_TZ] * (1.0 / vmesa->depth_max);
734
740
}
1524
1530
    ctx->Driver.Viewport = viaViewport;
1525
1531
    ctx->Driver.Enable = viaEnable;
1526
1532
 
1527
 
    /* Pixel path fallbacks.
1528
 
     */
1529
 
    ctx->Driver.Accum = _swrast_Accum;
1530
 
    ctx->Driver.Bitmap = _swrast_Bitmap;
1531
 
    ctx->Driver.CopyPixels = _swrast_CopyPixels;
1532
 
    ctx->Driver.DrawPixels = _swrast_DrawPixels;
1533
 
    ctx->Driver.ReadPixels = _swrast_ReadPixels;
 
1533
    /* XXX this should go away */
1534
1534
    ctx->Driver.ResizeBuffers = viaReAllocateBuffers;
1535
 
 
1536
 
    /* Swrast hooks for imaging extensions:
1537
 
     */
1538
 
    ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
1539
 
    ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
1540
 
    ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
1541
 
    ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
1542
1535
}