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

@@ -378,11 +378,9 @@ namespace nana
dw->draw(graphics);
}
//If the drawer_trigger didn't declear a lazy refresh, then use the refresh().
void drawer::_m_use_refresh()
bool drawer::_m_lazy_decleared() const
{
if (basic_window::update_state::refresh != core_window_->other.upd_state)
refresh();
return (basic_window::update_state::refresh != core_window_->other.upd_state);
}
}//end namespace detail
}//end namespace nana

View File

@@ -183,7 +183,7 @@ namespace nana
//Enable the effect.
data_sect.effects_bground_windows.push_back(wd);
wd->other.glass_buffer.make(wd->dimension.width, wd->dimension.height);
wd->other.glass_buffer.make(wd->dimension);
make_bground(wd);
return true;
}

View File

@@ -546,8 +546,8 @@ namespace detail
{
wd->dimension.width = r.width;
wd->dimension.height = r.height;
wd->drawer.graphics.make(r.width, r.height);
wd->root_graph->make(r.width, r.height);
wd->drawer.graphics.make(wd->dimension);
wd->root_graph->make(wd->dimension);
native_interface::move_window(wd->root, r);
arg_resized arg;
@@ -612,7 +612,7 @@ namespace detail
if(category::lite_widget_tag::value != wd->other.category)
{
bool graph_state = wd->drawer.graphics.empty();
wd->drawer.graphics.make(sz.width, sz.height);
wd->drawer.graphics.make(sz);
//It shall make a typeface_changed() call when the graphics state is changing.
//Because when a widget is created with zero-size, it may get some wrong result in typeface_changed() call
@@ -622,7 +622,7 @@ namespace detail
if(category::root_tag::value == wd->other.category)
{
wd->root_graph->make(sz.width, sz.height);
wd->root_graph->make(sz);
if(false == passive)
native_interface::window_size(wd->root, sz + nana::size(wd->extra_width, wd->extra_height));
}
@@ -637,7 +637,7 @@ namespace detail
//update the bground buffer of glass window.
if(wd->effect.bground && wd->parent)
{
wd->other.glass_buffer.make(sz.width, sz.height);
wd->other.glass_buffer.make(sz);
wndlayout_type::make_bground(wd);
}
}
@@ -767,7 +767,7 @@ namespace detail
if (!impl_->wd_register.available(wd))
return false;
result.make(wd->drawer.graphics.width(), wd->drawer.graphics.height());
result.make(wd->drawer.graphics.size());
result.bitblt(0, 0, wd->drawer.graphics);
wndlayout_type::paste_children_to_graphics(wd, result);
return true;