Claudio Ciccani wrote:
> Denis Oliver Kropp wrote:
>> 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.
That's a nice compromise before it's fixed properly.
--
Best regards,
Denis Oliver Kropp
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
_______________________________________________
directfb-cvs mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-cvs