Esempio n. 1
0
static void ati128SetState( void *drv, void *dev,
                            GraphicsDeviceFuncs *funcs,
                            CardState *state, DFBAccelerationMask accel )
{
     ATI128DriverData *adrv = (ATI128DriverData*) drv;
     ATI128DeviceData *adev = (ATI128DeviceData*) dev;

     if ((state->modified & SMF_SOURCE)  &&  state->source)
          ati128_set_source( adrv, adev, state );

     if (state->modified & SMF_DESTINATION)
          ati128_set_destination( adrv, adev, state );

     if (state->modified & SMF_CLIP)
          ati128_set_clip( adrv, adev, state );

     if (state->modified & SMF_COLOR)
          ati128_set_color( adrv, adev, state );

     if (state->modified & SMF_SRC_COLORKEY)
          ati128_out32( adrv->mmio_base, CLR_CMP_CLR_SRC, state->src_colorkey );

     if (state->modified & SMF_BLITTING_FLAGS)
          ati128_set_blittingflags( adrv, adev, state );

     if (state->modified & (SMF_SRC_BLEND | SMF_DST_BLEND))
          ati128_set_blending_function( adrv, adev, state );

     if (state->modified & SMF_DRAWING_FLAGS) {
          if (state->drawingflags & DSDRAW_BLEND) {
               funcs->FillRectangle = ati128FillBlendRectangle;
               funcs->DrawRectangle = ati128DrawBlendRectangle;
          }
          else {
               funcs->FillRectangle = ati128FillRectangle;
               funcs->DrawRectangle = ati128DrawRectangle;
          }
     }
}
Esempio n. 2
0
static void ati128SetState( void *drv, void *dev,
                            GraphicsDeviceFuncs *funcs,
                            CardState *state, DFBAccelerationMask accel )
{
     ATI128DriverData *adrv = (ATI128DriverData*) drv;
     ATI128DeviceData *adev = (ATI128DeviceData*) dev;

     if (state->mod_hw & SMF_SOURCE)
         adev->v_source = 0;

     if (state->mod_hw & SMF_DESTINATION)
          adev->v_destination = adev->v_color = 0;

     if (state->mod_hw & SMF_COLOR)
          adev->v_color = 0;

     if (state->mod_hw & SMF_SRC_COLORKEY)
          adev->v_src_colorkey = 0;

     if (state->mod_hw & SMF_BLITTING_FLAGS)
          adev->v_blittingflags = 0;

     if (state->mod_hw & (SMF_SRC_BLEND | SMF_DST_BLEND))
          adev->v_blending_function = 0;

     ati128_set_destination( adrv, adev, state);

     switch (accel) {
          case DFXL_FILLRECTANGLE:
          case DFXL_DRAWRECTANGLE:
               if (state->drawingflags & DSDRAW_BLEND) {
                    ati128_set_blending_function( adrv, adev, state );
                    funcs->FillRectangle = ati128FillBlendRectangle;
                    funcs->DrawRectangle = ati128DrawBlendRectangle;
               }
               else {
                    funcs->FillRectangle = ati128FillRectangle;
                    funcs->DrawRectangle = ati128DrawRectangle;
               }
          case DFXL_DRAWLINE:
               ati128_set_color( adrv, adev, state );
               state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_DRAWRECTANGLE ;
               break;

          case DFXL_BLIT:
          case DFXL_STRETCHBLIT:
               ati128_set_source( adrv, adev, state );
               if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL)
                    ati128_set_blending_function( adrv, adev, state );
               if (state->blittingflags & DSBLIT_SRC_COLORKEY)
                    ati128_set_src_colorkey( adrv, adev, state );
               ati128_set_blittingflags( adrv, adev, state );
               state->set |= DFXL_BLIT | DFXL_STRETCHBLIT;
               break;

          default:
               D_BUG( "unexpected drawing/blitting function" );
               break;
     }

     if (state->mod_hw & SMF_CLIP)
          ati128_set_clip( adrv, adev, state);

     state->mod_hw = 0;
}