Performance improvements

This commit is contained in:
cnjinhao
2015-01-09 08:12:20 +08:00
parent 750c3dffd5
commit 9a71f23ddd
16 changed files with 46 additions and 56 deletions

View File

@@ -123,7 +123,7 @@ namespace nana
void _m_bground_pre();
void _m_bground_end();
void _m_draw_dynamic_drawing_object();
void _m_use_refresh();
bool _m_lazy_decleared() const;
template<typename Arg, typename Mfptr>
void _m_emit(event_code evt_code, const Arg& arg, Mfptr mfptr)
@@ -144,9 +144,11 @@ namespace nana
else
(realizer_->*mfptr)(graphics, arg);
_m_use_refresh();
_m_draw_dynamic_drawing_object();
_m_bground_end();
if (_m_lazy_decleared())
{
_m_draw_dynamic_drawing_object();
_m_bground_end();
}
}
}
}

View File

@@ -124,7 +124,7 @@ namespace nana{
root_misc(core_window_t * wd, unsigned width, unsigned height)
: window(wd),
root_graph(width, height)
root_graph({ width, height })
{}
};//end struct root_misc

View File

@@ -74,7 +74,6 @@ namespace nana
typedef ::nana::native_window_type native_window_type;
graphics();
graphics(unsigned width, unsigned height); ///< size in pixel
graphics(const ::nana::size&); ///< size in pixel
graphics(const graphics&); ///< the resource is not copyed, the two graphics objects refer to the *SAME* resource
graphics& operator=(const graphics&);
@@ -85,9 +84,10 @@ namespace nana
drawable_type handle() const;
const void* pixmap() const;
const void* context() const;
void make(unsigned width, unsigned height); ///< Creates a bitmap resource that size is width by height in pixel
void resize(unsigned width, unsigned height);
void typeface(const font&); ///< Selects a specified font type into the graphics object.
void make(const ::nana::size&); ///< Creates a bitmap resource that size is width by height in pixel
void resize(const ::nana::size&);
void typeface(const font&); ///< Selects a specified font type into the graphics object.
font typeface() const;
::nana::size text_extent_size(const char_t*) const; ///< Computes the width and height of the specified string of text.
::nana::size text_extent_size(const string&) const; ///< Computes the width and height of the specified string of text.