ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.C
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.50 by root, Thu Feb 2 18:04:46 2006 UTC vs.
Revision 1.51 by root, Sat Feb 18 14:14:43 2006 UTC

201 201
202#endif 202#endif
203 203
204///////////////////////////////////////////////////////////////////////////// 204/////////////////////////////////////////////////////////////////////////////
205 205
206#if XFT
207rxvt_drawable::~rxvt_drawable ()
208{
209 if (xftdrawable)
210 XftDrawDestroy (xftdrawable);
211}
212
213rxvt_drawable::operator XftDraw *()
214{
215 if (!xftdrawable)
216 xftdrawable = XftDrawCreate (screen->dpy, drawable, screen->visual, screen->cmap);
217
218 return xftdrawable;
219}
220#endif
221
222/////////////////////////////////////////////////////////////////////////////
223
224#if XFT
225
226// not strictly necessary as it is only used with superclass of zero_initialised
227rxvt_screen::rxvt_screen ()
228: scratch_area (0)
229{
230}
231
232rxvt_drawable &rxvt_screen::scratch_drawable (int w, int h)
233{
234 // it's actually faster to re-allocate every time. don't ask me
235 // why, but its likely no big deal there are no roundtrips
236 // (I think/hope).
237 if (!scratch_area || w > scratch_w || h > scratch_h || 1/*D*/)
238 {
239 if (scratch_area)
240 {
241 XFreePixmap (dpy, scratch_area->drawable);
242 delete scratch_area;
243 }
244
245 Pixmap pm = XCreatePixmap (dpy, RootWindowOfScreen (ScreenOfDisplay (dpy, display->screen)),
246 scratch_w = w, scratch_h = h, depth);
247
248 scratch_area = new rxvt_drawable (this, pm);
249 }
250
251 return *scratch_area;
252}
253
254#endif
255
206void 256void
207rxvt_screen::set (rxvt_display *disp) 257rxvt_screen::set (rxvt_display *disp)
208{ 258{
209 display = disp; 259 display = disp;
210 dpy = disp->dpy; 260 dpy = disp->dpy;
234} 284}
235 285
236void 286void
237rxvt_screen::clear () 287rxvt_screen::clear ()
238{ 288{
289#if XFT
290 if (scratch_area)
291 {
292 XFreePixmap (dpy, scratch_area->drawable);
293 delete scratch_area;
294 }
295#endif
296
239 if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (dpy, display->screen))) 297 if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (dpy, display->screen)))
240 XFreeColormap (dpy, cmap); 298 XFreeColormap (dpy, cmap);
241} 299}
242 300
243///////////////////////////////////////////////////////////////////////////// 301/////////////////////////////////////////////////////////////////////////////

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines