421 views
in GUI Development by
Hi,

I have set the surface cache explicitly to 8 MB, and verified this by putting a breakpoint on this:

int STM32InitGfx( void* aArgs )
{
  /* configure bitmap and glyph cache according makefile settings */
  EwMaxSurfaceCacheSize   = EW_MAX_SURFACE_CACHE_SIZE;

So in total, 16 MB is allocated to EW, 8 MB of which is for surface chache. My application certainly does not stretch RAM resources, yet each time I display an image that is liked to an ExternBitmap, EW, makes the call to EwLoadExternBitmap, and the micro reloads and re-decodes an image which should really reside in the cache.

Am I doing something that I shouldn't ?

 

Kind Regards,

Rob
by
Any ideas folks?

Kind Regards,

Rob

1 Answer

0 votes
by
Hello Rob,

the surface cache is not a preallocated memory - the define EW_MAX_SURFACE_CACHE_SIZE is used to control the number of bytes that can be occupied by bitmap resources that are no more used by the UI application. As long as there is enough memory available, the bitmap resources are still available within the memory in order to avoid further loading and decompression in case they are used again. Just a kind of runtime optimization.

This define has no effect to bitmaps that you have created within your implementation of EwLoadExternBitmap, because the Resourece Management of Embedded Wizard has no knowledge about the content.

If you want to keep the decoded bitmap within the memory, place a variable into your GUI application that refers to the ExternBitmap resource. This prevents the Garbage Collector from deleting the image.

Does this answer your question?

Best regards,

Manfred.
by
Hi Manfred,

Yes it does answer my question. Thanks for the feedback :-)

Kind Regards,

Rob

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...