draw on PC only when needed
This commit is contained in:
parent
24cb070116
commit
c91eb1bece
@ -291,3 +291,14 @@ void ewol::Widget::PeriodicCallSet(bool statusToSet)
|
||||
ewol::widgetManager::PeriodicCallRm(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The widget mark itself that it need to regenerate the nest time.
|
||||
* @param ---
|
||||
* @return ---
|
||||
*/
|
||||
void ewol::Widget::MarkToReedraw(void)
|
||||
{
|
||||
m_needRegenerateDisplay = true;
|
||||
ewol::widgetManager::MarkDrawingIsNeeded();
|
||||
};
|
||||
|
@ -415,7 +415,7 @@ namespace ewol {
|
||||
* @param ---
|
||||
* @return ---
|
||||
*/
|
||||
void MarkToReedraw(void) { m_needRegenerateDisplay = true; };
|
||||
void MarkToReedraw(void);
|
||||
/**
|
||||
* @brief Get the need of the redrawing of the widget and reset it to false
|
||||
* @param ---
|
||||
|
@ -32,7 +32,6 @@
|
||||
#undef __class__
|
||||
#define __class__ "WidgetManager"
|
||||
|
||||
static pthread_mutex_t localMutex;
|
||||
static bool IsInit = false;
|
||||
|
||||
// For the focus Management
|
||||
@ -41,17 +40,17 @@ static ewol::Widget * m_focusWidgetCurrent = NULL;
|
||||
static etk::VectorType<ewol::Widget*> l_listOfPeriodicWidget;
|
||||
static bool l_havePeriodic = false;
|
||||
|
||||
static bool l_haveRedraw = true;
|
||||
|
||||
void ewol::widgetManager::Init(void)
|
||||
{
|
||||
EWOL_DEBUG("==> Init Widget-Manager");
|
||||
// create interface mutex :
|
||||
int ret = pthread_mutex_init(&localMutex, NULL);
|
||||
EWOL_ASSERT(ret == 0, "Error creating Mutex ...");
|
||||
// prevent android error ==> can create memory leak but I prefer
|
||||
m_focusWidgetDefault = NULL;
|
||||
m_focusWidgetCurrent = NULL;
|
||||
l_listOfPeriodicWidget.Clear();
|
||||
l_havePeriodic = false;
|
||||
l_haveRedraw = true;
|
||||
// init all the widget global parameters :
|
||||
ewol::WIDGET_JoystickInit();
|
||||
ewol::WIDGET_ButtonInit();
|
||||
@ -70,8 +69,6 @@ void ewol::widgetManager::UnInit(void)
|
||||
IsInit = false;
|
||||
|
||||
l_listOfPeriodicWidget.Clear();
|
||||
int ret = pthread_mutex_destroy(&localMutex);
|
||||
EWOL_ASSERT(ret == 0, "Error destroying Mutex ...");
|
||||
}
|
||||
|
||||
void ewol::widgetManager::Rm(ewol::Widget * newWidget)
|
||||
@ -214,3 +211,15 @@ bool ewol::widgetManager::PeriodicCallHave(void)
|
||||
return l_havePeriodic;
|
||||
}
|
||||
|
||||
|
||||
void ewol::widgetManager::MarkDrawingIsNeeded(void)
|
||||
{
|
||||
l_haveRedraw = true;
|
||||
}
|
||||
|
||||
bool ewol::widgetManager::IsDrawingNeeded(void)
|
||||
{
|
||||
bool tmp = l_haveRedraw;
|
||||
l_haveRedraw = false;
|
||||
return tmp;
|
||||
}
|
||||
|
@ -49,6 +49,8 @@ namespace ewol {
|
||||
void PeriodicCall(int64_t localTime);
|
||||
bool PeriodicCallHave(void);
|
||||
|
||||
void MarkDrawingIsNeeded(void);
|
||||
bool IsDrawingNeeded(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -254,8 +254,9 @@ void EWOL_GenericDraw(bool everyTime)
|
||||
display = true;
|
||||
}
|
||||
int64_t currentTime3 = GetCurrentTime();
|
||||
// TODO : Check if somthink has regenerate his display befor redraw ...
|
||||
{
|
||||
// check if the regenerate is needed ...
|
||||
if( true == ewol::widgetManager::IsDrawingNeeded()
|
||||
|| true == everyTime) {
|
||||
ewol::texture::UpdateContext();
|
||||
nbDisplayTime++;
|
||||
gui_uniqueWindows->SysDraw();
|
||||
|
Loading…
x
Reference in New Issue
Block a user