aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/drawable_control.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/menu/drawable_control.cpp b/src/menu/drawable_control.cpp
index 4d0d9c3c..298abdfe 100644
--- a/src/menu/drawable_control.cpp
+++ b/src/menu/drawable_control.cpp
@@ -27,6 +27,7 @@
#include "drawable_control.hpp"
#include "container.hpp"
#include "clipping_helper.hpp"
+#include "modelview_matrix_cache.hpp"
namespace usdx
{
@@ -87,18 +88,22 @@ namespace usdx
glTranslatef(position.get_x(), position.get_y(), 0.0f);
}
- boost::shared_lock<boost::shared_mutex> clipping_lock(clipping_required_mutex);
- if (clipping_required) {
- clipping_lock.unlock();
-
- boost::shared_lock<boost::shared_mutex> size_lock(size_mutex);
- boost::shared_lock<boost::shared_mutex> position_lock(position_mutex);
- ClippingHelper clipping(parent, Rectangle<int>(position, size));
- Drawable::repaint();
- }
- else {
- clipping_lock.unlock();
- Drawable::repaint();
+ {
+ ModelviewMatrixCache c;
+
+ boost::shared_lock<boost::shared_mutex> clipping_lock(clipping_required_mutex);
+ if (clipping_required) {
+ clipping_lock.unlock();
+
+ boost::shared_lock<boost::shared_mutex> size_lock(size_mutex);
+ boost::shared_lock<boost::shared_mutex> position_lock(position_mutex);
+ ClippingHelper clipping(parent, Rectangle<int>(position, size));
+ Drawable::repaint();
+ }
+ else {
+ clipping_lock.unlock();
+ Drawable::repaint();
+ }
}
}