Denis Oliver Kropp wrote:
> Claudio Ciccani wrote:
> 
>> Ben Combee via CVS wrote:
>>
>>> CVSROOT:    /cvs/directfb
>>> Module name:    DirectFB
>>> Changes by:    bcombee    20060604 19:52:22
>>>
>>> Modified files:
>>>     src/display    : idirectfbsurface.c
>>> Log message:
>>> Update graphics ops to immediately unref source surfaces allowing 
>>> quicker memory reuse
>>>
>>
>> That always forces the driver to revalidate the source after blitting.
>> I think it will result in a loss of performance.
> 
> 
> Right, it should be a temporary workaround to avoid the worst case:
> 
> 1. CreateSurface(big)
> 2. RenderTo(big)
> 3. CreateSurface(small)
> 4. Blit(small <- big)
> 5. Release(big)
> 
> For example creating a bunch of thumbnails, the big surfaces
> are still alive because of the reference due to being a source.
> 
> Has a very priority to be fixed properly!
> 

There is another way to do that.
When you perform the blit, the state of the small surface becomes the
current state in the gfxcard core, therefore we could provide a function
like the following that has to be called from IDirectFBSurface_Destruct().

void
dfb_gfxcard_surface_release( CoreSurface *surface )
{
      GraphicsDeviceShared *shared;

      D_ASSERT( card != NULL );
      D_ASSERT( card->shared != NULL );

      shared = card->shared;
      if (shared->state) {
           if (shared->state->destination == surface)
                dfb_state_set_destination( shared->state, NULL );

           if (shared->state->source == surface)
                dfb_state_set_source( shared->state, NULL );
      }
}

Of course it won't work if, for example, you blit the small surface to
another surface before releasing the big one, but I think it's a good
compromise.
        

-- 
Regards,
      Claudio Ciccani

[EMAIL PROTECTED]
http://directfb.org
http://sf.net/projects/php-directfb

_______________________________________________
directfb-cvs mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-cvs

Reply via email to