Beispiel #1
0
void
dfb_state_update_sources( CardState *state, CardStateFlags flags )
{
     D_DEBUG_AT( Core_GfxState, "%s( %p )\n", __FUNCTION__, state );

     D_MAGIC_ASSERT( state, CardState );
     DFB_REGION_ASSERT( &state->clip );

     if (D_FLAGS_IS_SET( state->flags & flags, CSF_SOURCE )) {
          CoreSurface *source = state->source;

          D_ASSERT( source != NULL );

          if (direct_serial_update( &state->src_serial, &source->serial ))
               state->modified |= SMF_SOURCE;
     }

     if (D_FLAGS_IS_SET( state->flags & flags, CSF_SOURCE_MASK )) {
          CoreSurface *source_mask = state->source_mask;

          D_ASSERT( source_mask != NULL );

          if (direct_serial_update( &state->src_mask_serial, &source_mask->serial ))
               state->modified |= SMF_SOURCE_MASK;
     }

     if (D_FLAGS_IS_SET( state->flags & flags, CSF_SOURCE2 )) {
          CoreSurface *source2 = state->source2;

          D_ASSERT( source2 != NULL );

          if (direct_serial_update( &state->src2_serial, &source2->serial ))
               state->modified |= SMF_SOURCE2;
     }
}
Beispiel #2
0
void
dfb_state_update( CardState *state, bool update_sources )
{
     CoreSurface *destination;

     D_MAGIC_ASSERT( state, CardState );
     DFB_REGION_ASSERT( &state->clip );

     destination = state->destination;

     if (D_FLAGS_IS_SET( state->flags, CSF_DESTINATION )) {

          D_ASSERT( destination != NULL );

          if (direct_serial_update( &state->dst_serial, &destination->serial )) {
               validate_clip( state, destination->config.size.w - 1, destination->config.size.h - 1, true );

               state->modified |= SMF_DESTINATION;
          }
     }
     else if (destination)
          validate_clip( state, destination->config.size.w - 1, destination->config.size.h - 1, true );

     if (update_sources && D_FLAGS_IS_SET( state->flags, CSF_SOURCE )) {
          CoreSurface *source = state->source;

          D_ASSERT( source != NULL );

          if (direct_serial_update( &state->src_serial, &source->serial ))
               state->modified |= SMF_SOURCE;
     }

     if (update_sources && D_FLAGS_IS_SET( state->flags, CSF_SOURCE_MASK )) {
          CoreSurface *source_mask = state->source_mask;

          D_ASSERT( source_mask != NULL );

          if (direct_serial_update( &state->src_mask_serial, &source_mask->serial ))
               state->modified |= SMF_SOURCE_MASK;
     }

     if (update_sources && D_FLAGS_IS_SET( state->flags, CSF_SOURCE2 )) {
          CoreSurface *source2 = state->source2;

          D_ASSERT( source2 != NULL );

          if (direct_serial_update( &state->src2_serial, &source2->serial ))
               state->modified |= SMF_SOURCE2;
     }
}
Beispiel #3
0
DFBResult
SurfacePeer::updateBuffers()
{
     D_DEBUG_AT( DirectFB_Graphics, "Graphics::SurfacePeer::%s( %p ) <- surface %p\n", __FUNCTION__, this, surface );

     if (direct_serial_update( &surface_serial, &surface->config_serial )) {
          DFBResult ret;

          surface_config = surface->config;

          ret = ::CoreSurface_GetBuffers( surface, &buffer_ids[0], D_ARRAY_SIZE(buffer_ids), &buffer_num );
          if (ret) {
               D_DERROR( ret, "Graphics/SurfacePeer: CoreSurface::GetBuffers() failed!\n" );
               return ret;
          }

          for (size_t i=0; i<buffer_num; i++)
               buffer_objects[i] = NULL;
     }

     if (surface_config.caps & DSCAPS_STEREO) {
          D_ASSERT( buffer_num > 1 );

          index = (flips % (buffer_num/2)) * 2;
     }
     else {
          D_ASSERT( buffer_num > 0 );

          index = flips % buffer_num;
     }

     return DFB_OK;
}
Beispiel #4
0
void
dfb_state_update_destination( CardState *state )
{
     CoreSurface *destination;

     D_DEBUG_AT( Core_GfxState, "%s( %p )\n", __FUNCTION__, state );

     D_MAGIC_ASSERT( state, CardState );
     DFB_REGION_ASSERT( &state->clip );

     destination = state->destination;

     if (D_FLAGS_IS_SET( state->flags, CSF_DESTINATION )) {
          D_DEBUG_AT( Core_GfxState, "  -> CSF_DESTINATION is set\n" );

          D_ASSERT( destination != NULL );

          if (direct_serial_update( &state->dst_serial, &destination->serial )) {
               D_DEBUG_AT( Core_GfxState, "  -> serial is updated\n" );

               validate_clip( state, destination->config.size.w - 1, destination->config.size.h - 1, true );

               state->modified |= SMF_DESTINATION;
          }
     }
     else if (destination)
          validate_clip( state, destination->config.size.w - 1, destination->config.size.h - 1, true );
}