summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIzik Eidus <ieidus@redhat.com>2009-11-09 22:27:13 +0200
committerYaniv Kamay <ykamay@redhat.com>2010-01-03 17:21:41 +0200
commitf046cd839d8e29ed841ee956b68540d3ac9ba6be (patch)
tree4bd6ae929484e4e8f810d556aac6c346b9555d7f
parent95a9bcb9175f2515a43212b2e5d5fe4b1534199a (diff)
downloadspice-f046cd839d8e29ed841ee956b68540d3ac9ba6be.tar.gz
spice-f046cd839d8e29ed841ee956b68540d3ac9ba6be.tar.xz
spice-f046cd839d8e29ed841ee956b68540d3ac9ba6be.zip
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>
-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();
}