ERIS CORE

◆ dynamicSurfaceManager()

bool AppWren::dynamicSurfaceManager ( )
protected

responsible for managing the surface buffer memory allocation

Returns
true
false

Definition at line 1541 of file AppWren.cpp.

1541  {
1542  if(!surface_cache){
1544  if (has_pop || has_focus){
1545  surface_cache = new Surface((uint16_t *)draw->getFrameAddress(),width,height);
1546  memset((uint16_t *)draw->getFrameAddress(),0,sizeof(uint16_t)*WREN_FRAME_BUFFER_SIZE);
1547  }else{
1549  memset(surface_mempool,0,sizeof(uint16_t)*widget_width*widget_height);
1550  }
1551  }else{
1552  //check for state changes and adjust the buffer accordingly
1553  if (has_pop || has_focus){
1554  if( (width != surface_cache->getWidth()) || (height != surface_cache->getHeight()) ){
1555  delete(surface_cache);
1557  memset(surface_mempool,0,sizeof(uint16_t)*width*height);
1558  }
1559  }else{
1561  delete(surface_cache);
1563  memset(surface_mempool,0,sizeof(uint16_t)*widget_width*widget_height);
1564  }
1565  }
1566  }
1567  if (surface_cache==NULL)return false;
1568  //wrenCollectGarbage(vm);
1569  return true;
1570 }
uint16_t EXTMEM wrenFastRam[WREN_FRAME_BUFFER_SIZE]
Definition: AppWren.cpp:18
int16_t widget_height
Definition: AppBaseClass.h:72
int16_t height
Definition: AppBaseClass.h:68
ILI9341_t3_ERIS * draw
Definition: AppBaseClass.h:41
int16_t width
Definition: AppBaseClass.h:67
int16_t widget_width
Definition: AppBaseClass.h:71
Surface * surface_cache
Definition: AppWren.h:770
uint16_t * surface_mempool
Definition: AppWren.h:771
uint32_t getFrameAddress()
Get the Frame Address object.
uint16_t getHeight()
uint16_t getWidth()
a Surface object manages a memory block with defined width and height dimensions

References AppBaseClass::draw, ILI9341_t3_ERIS::getFrameAddress(), Surface::getHeight(), Surface::getWidth(), AppBaseClass::has_focus, AppBaseClass::has_pop, AppBaseClass::height, surface_cache, surface_mempool, AppBaseClass::widget_height, AppBaseClass::widget_width, AppBaseClass::width, and wrenFastRam.

Referenced by bltRAMDrive2Surface(), drawFill(), releasePopUp(), render(), requestPopUp(), setDimension(), and setWidgetDimension().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: