Changed the offscreen-rendering handling in SetProjection to be
more like the Tk/X11 model than the OpenGL model, since Cairo isn't picky about pixmaps.
This commit is contained in:
parent
21d558c67d
commit
37e7b7ffeb
|
|
@ -421,9 +421,6 @@ GrTCairoFlush ()
|
|||
*---------------------------------------------------------
|
||||
*/
|
||||
|
||||
//static GLXPixmap glpmap = None;
|
||||
Pixmap cairopmap = (Pixmap)NULL;
|
||||
|
||||
#define glTransYs(n) (DisplayHeight(grXdpy, grXscrn)-(n))
|
||||
|
||||
/*
|
||||
|
|
@ -436,28 +433,9 @@ void
|
|||
tcairoSetProjection(llx, lly, width, height)
|
||||
int llx, lly, width, height;
|
||||
{
|
||||
if (tcairoCurrent.mw->w_flags & WIND_OFFSCREEN)
|
||||
{
|
||||
/*
|
||||
if (glpmap != None) glXDestroyGLXPixmap(grXdpy, glpmap);
|
||||
glpmap = glXCreateGLXPixmap(grXdpy, grVisualInfo,
|
||||
(Pixmap)tcairoCurrent.windowid);
|
||||
glXMakeCurrent(grXdpy, (GLXDrawable)glpmap, grXcontext);
|
||||
*/
|
||||
cairopmap = XCreatePixmap(grXdpy, tcairoCurrent.windowid, width, height, tcairoCurrent.depth);
|
||||
grCairoSurface = cairo_xlib_surface_create(grXdpy, cairopmap, grVisualInfo->visual, width, height);
|
||||
}
|
||||
else {
|
||||
//glXMakeCurrent(grXdpy, (GLXDrawable)tcairoCurrent.windowid, grXcontext);
|
||||
grCairoSurface = cairo_xlib_surface_create(grXdpy, tcairoCurrent.windowid, grVisualInfo->visual, Tk_Width(tcairoCurrent.window), Tk_Height(tcairoCurrent.window));
|
||||
}
|
||||
grCairoSurface = cairo_xlib_surface_create(grXdpy, tcairoCurrent.windowid, grVisualInfo->visual, width, height);
|
||||
grCairoContext = cairo_create(grCairoSurface);
|
||||
|
||||
// #ifndef Cairo_SERVER_SIDE_ONLY
|
||||
// For batch-processing lines and rectangles
|
||||
// glEnableClientState(GL_VERTEX_ARRAY);
|
||||
// #endif
|
||||
|
||||
/* Because this tends to result in thick lines, it has been moved */
|
||||
/* the line drawing routine so it can be enabled for individual */
|
||||
/* lines. */
|
||||
|
|
|
|||
|
|
@ -470,10 +470,20 @@ grtcairoScrollBackingStore(MagWindow *w, Point *shift)
|
|||
yshift = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
XCopyArea(grXdpy, pmap, pmap, grXcopyGC, xorigin, yorigin, width, height,
|
||||
xshift, yshift);
|
||||
*/
|
||||
|
||||
/* TxPrintf("grx11ScrollBackingStore %d %d\n", shift->p_x, shift->p_y); */
|
||||
|
||||
cairo_surface_t *backingStoreSurface;
|
||||
backingStoreSurface = cairo_xlib_surface_create(grXdpy, pmap, DefaultVisual(grXdpy, DefaultScreen(grXdpy)), width, height);
|
||||
cairo_set_source_surface(grCairoContext, backingStoreSurface, xshift, yshift);
|
||||
cairo_rectangle(grCairoContext, xorigin, yorigin, width, height);
|
||||
cairo_set_operator(grCairoContext, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_fill(grCairoContext);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue