summaryrefslogtreecommitdiff
path: root/client/display_channel.cpp
diff options
context:
space:
mode:
authorIzik Eidus <ieidus@redhat.com>2009-11-09 22:27:13 +0200
committerYaniv Kamay <ykamay@redhat.com>2009-11-09 23:10:49 +0200
commit39153191258c4a37e4e61241c3149f7ca08e217c (patch)
treea71454221c19c52ce256c19271baeac8678ce719 /client/display_channel.cpp
parent54cf04beed5e7617459cb00fa07be52db6c6e0d7 (diff)
spice: client: gl: fix glx support.
Just move around touch_context and untouch_context to be at the right places. Signed-off-by: Izik Eidus <ieidus@redhat.com>
Diffstat (limited to 'client/display_channel.cpp')
-rw-r--r--client/display_channel.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 98b9f424..ed8f2c9b 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -693,6 +693,8 @@ DisplayChannel::~DisplayChannel()
if (screen()) {
screen()->set_update_interrupt_trigger(NULL);
}
+
+ destroy_canvas();
destroy_strams();
}
@@ -776,6 +778,7 @@ void DisplayChannel::recreate_ogl_context_interrupt()
{
Canvas* canvas = _canvas.release();
if (canvas) {
+ ((GCanvas *)(canvas))->touch_context();
((GCanvas *)canvas)->textures_lost();
delete canvas;
}
@@ -783,6 +786,8 @@ void DisplayChannel::recreate_ogl_context_interrupt()
if (!create_ogl_canvas(_x_res, _y_res, _depth, 0, _rendertype)) {
THROW("create_ogl_canvas failed");
}
+
+ ((GCanvas *)(_canvas.get()))->touch_context();
}
void DisplayChannel::recreate_ogl_context()
@@ -917,10 +922,10 @@ bool DisplayChannel::create_ogl_canvas(int width, int height, int depth,
return false;
}
- screen()->untouch_context();
-
canvas->set_mode(width, height, depth, win, rendertype);
+ screen()->untouch_context();
+
_canvas.reset(canvas.release());
_rendertype = rendertype;
LOG_INFO("display %d: using ogl", get_id());
@@ -954,6 +959,11 @@ void DisplayChannel::destroy_canvas()
Canvas* canvas = _canvas.release();
if (canvas) {
+#ifdef USE_OGL
+ if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
+ ((GCanvas *)(canvas))->touch_context();
+ }
+#endif
delete canvas;
}
}
@@ -1019,6 +1029,7 @@ void DisplayChannel::handle_mode(RedPeer::InMessage* message)
if (_canvas.get()) {
if (_canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
screen()->unset_type_gl();
+ screen()->untouch_context();
//glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
}
}
@@ -1038,6 +1049,7 @@ void DisplayChannel::handle_mode(RedPeer::InMessage* message)
#ifdef USE_OGL
if (_canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
+ ((GCanvas *)(_canvas.get()))->touch_context();
screen()->set_update_interrupt_trigger(&_interrupt_update);
screen()->set_type_gl();
}