From bd8b05eaf24035d1d6069280a90ff56a825a9c3d Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Sat, 18 Feb 2012 15:56:41 +0100 Subject: [PATCH] display optimisation --- Sources/libetk/etk/VectorType.h | 2 +- Sources/libewol/ewol/OObject/2DColored.cpp | 5 +++++ Sources/libewol/ewol/OObject/2DColored.h | 1 + Sources/libewol/ewol/OObject/2DTextColored.cpp | 5 +++++ Sources/libewol/ewol/OObject/2DTextColored.h | 1 + Sources/libewol/ewol/Widget.h | 5 +++-- Sources/libewol/ewol/base/MainThread.cpp | 5 ++++- 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Sources/libetk/etk/VectorType.h b/Sources/libetk/etk/VectorType.h index a0658c63..f12eb486 100644 --- a/Sources/libetk/etk/VectorType.h +++ b/Sources/libetk/etk/VectorType.h @@ -630,7 +630,7 @@ template class VectorType } int32_t numberOfStep = m_allocated / devide; if (newSize< ((numberOfStep-2)*devide + devide/2) ) { - //Allow Reallocation of a new size shoerter + //Allow Reallocation of a new size shorter requestSize = ((newSize / devide)+1) * devide; } } diff --git a/Sources/libewol/ewol/OObject/2DColored.cpp b/Sources/libewol/ewol/OObject/2DColored.cpp index 8c855a58..7dbb322d 100644 --- a/Sources/libewol/ewol/OObject/2DColored.cpp +++ b/Sources/libewol/ewol/OObject/2DColored.cpp @@ -69,6 +69,11 @@ void ewol::OObject2DColored::Draw(void) } +void ewol::OObject2DColored::Clear(void) +{ + m_coord.Clear(); + m_coordColor.Clear(); +} void ewol::OObject2DColored::UpdateOrigin(etkFloat_t x, etkFloat_t y) { diff --git a/Sources/libewol/ewol/OObject/2DColored.h b/Sources/libewol/ewol/OObject/2DColored.h index 36fc67a5..4794416e 100644 --- a/Sources/libewol/ewol/OObject/2DColored.h +++ b/Sources/libewol/ewol/OObject/2DColored.h @@ -45,6 +45,7 @@ namespace ewol { void GenerateTriangle(void); void ResetCount(void); public: + void Clear(void); void SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha = 1.0); void SetColor(color_ts color); void SetPoint(coord2D_ts point); diff --git a/Sources/libewol/ewol/OObject/2DTextColored.cpp b/Sources/libewol/ewol/OObject/2DTextColored.cpp index 2bb12109..42454efe 100644 --- a/Sources/libewol/ewol/OObject/2DTextColored.cpp +++ b/Sources/libewol/ewol/OObject/2DTextColored.cpp @@ -42,6 +42,11 @@ ewol::OObject2DTextColored::OObject2DTextColored(etk::UString FontName, int32_t //m_FontId = GetFontIdWithName(FontName); m_FontId = -1; } + /* + m_coord.SetIncrement(50000); + m_coordTex.SetIncrement(50000); + m_coordColor.SetIncrement(50000); + */ } ewol::OObject2DTextColored::OObject2DTextColored(int32_t fontID) diff --git a/Sources/libewol/ewol/OObject/2DTextColored.h b/Sources/libewol/ewol/OObject/2DTextColored.h index 85af0b13..034cf8fa 100644 --- a/Sources/libewol/ewol/OObject/2DTextColored.h +++ b/Sources/libewol/ewol/OObject/2DTextColored.h @@ -51,6 +51,7 @@ namespace ewol { etk::VectorType m_coordTex; //!< internal texture coordinate for every point etk::VectorType m_coordColor; //!< internal color of the different point public: + void SetFontID(int32_t fontID) { m_FontId = fontID; }; int32_t GetFontID(void) { return m_FontId; }; virtual void UpdateOrigin(etkFloat_t x, etkFloat_t y); }; diff --git a/Sources/libewol/ewol/Widget.h b/Sources/libewol/ewol/Widget.h index d2228bb7..8f2b8a6c 100644 --- a/Sources/libewol/ewol/Widget.h +++ b/Sources/libewol/ewol/Widget.h @@ -255,11 +255,12 @@ namespace ewol { private: bool m_genericDraw; bool m_specificDraw; + etk::VectorType m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display... + bool GenericDraw(void); + protected: int32_t m_currentDrawId; int32_t m_currentCreateId; bool m_needFlipFlop; - etk::VectorType m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display... - bool GenericDraw(void); public: void DoubleBufferFlipFlop(void); protected: diff --git a/Sources/libewol/ewol/base/MainThread.cpp b/Sources/libewol/ewol/base/MainThread.cpp index 6bfa6195..21c4177a 100644 --- a/Sources/libewol/ewol/base/MainThread.cpp +++ b/Sources/libewol/ewol/base/MainThread.cpp @@ -250,13 +250,16 @@ void EWOL_SystemStart(void) //pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_JOINABLE) pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_DETACHED); //pthread_attr_setscope( &androidJniThreadAttr, PTHREAD_SCOPE_SYSTEM); + /* // note android does not permit to change the thread priority ... // try to set prio : struct sched_param pr; pr.sched_priority = 10; pthread_attr_setschedpolicy(&androidJniThreadAttr, SCHED_RR); pthread_attr_setschedparam(&androidJniThreadAttr, &pr); - + */ + pthread_setname_np(androidJniThread, "ewol_basic_thread"); pthread_create(&androidJniThread, &androidJniThreadAttr, BaseAppEntry, NULL); + //pthread_create(&androidJniThread, NULL, BaseAppEntry, NULL); isGlobalSystemInit = true; EWOL_DEBUG("Send Init message to the thread");