Re: [gtk-vnc-devel] [PATCH] gtkgl based scaling



On Mon, Feb 04, 2008 at 07:32:54PM -0600, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >On Sat, Feb 02, 2008 at 09:06:41PM +0000, Daniel P. Berrange wrote:
> >  
> >
> >This patch fixes it for me...
> >
> >diff -r 2d87caab4637 src/vncdisplay.c
> >--- a/src/vncdisplay.c	Sat Feb 02 14:24:08 2008 -0600
> >+++ b/src/vncdisplay.c	Mon Feb 04 19:55:57 2008 -0500
> >@@ -144,6 +144,12 @@ static gboolean expose_event(GtkWidget *
> > 	int x, y, w, h;
> > 	GdkRectangle drawn;
> > 	GdkRegion *clear, *copy;
> >+
> >+	GVNC_DEBUG("Expose %dx%d @ %d,%d\n",
> >+		   expose->area.x,
> >+		   expose->area.y,
> >+		   expose->area.width,
> >+		   expose->area.height);
> > 
> > #if WITH_GTKGLEXT
> > 	if (priv->image == NULL && priv->gl_tex_data == NULL)
> >@@ -207,6 +213,11 @@ static gboolean expose_event(GtkWidget *
> > 		glTexCoord2f(rx,ry);  glVertex3f(wx+ww, wy, 0);
> > 		glEnd();
> > 		glDisable(GL_TEXTURE_2D);
> >+		if (gdk_gl_drawable_is_double_buffered(priv->gl_drawable)) {
> >+			gdk_gl_drawable_swap_buffers(priv->gl_drawable);
> >+		} else {
> >+			glFlush ();
> >+		}
> > 		gdk_gl_drawable_gl_end(priv->gl_drawable);
> > 	} else
> > #endif
> >
> >
> >My tests only hit the glFlush() codepath - dunno if the double buffered
> >path is needed - this code snippet is from the gtkglext examples.
> >  
> 
> How is performance?  I don't have access to the machine that has the 
> problem ATM so I can't test myself.  I added a swap_buffers() call 
> myself but it ended up killing performance.

Well I've not tried the swap_buffers() code path myself. The glFlush()
path has a noticable performance impact on my laptop, but that's not a
fair test since this is a ATI r500 card with the open source driver so
it doesn't even have 2-d acceleration, let alone 3-d.  I'll test on an
accelerated Intel / NVidia card when I get a chance.


Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]