214
214
const CompRegion ®ion,
215
215
unsigned int mask)
217
const CompRegion *preg = NULL;
218
217
GLboolean isBlendingEnabled;
220
if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
221
PAINT_WINDOW_WITH_OFFSET_MASK)))
223
else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
224
preg = &infiniteRegion;
227
tmpRegion = shadowRegion;
232
/* In case some plugin needs to paint us with an offset region */
233
if (preg->isEmpty ())
236
const CompRegion ® (*preg);
239
220
wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP)
243
224
mask |= PAINT_WINDOW_BLEND_MASK;
245
226
gWindow->vertexBuffer ()->begin ();
227
const CompRegion *preg = NULL;
229
if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
230
PAINT_WINDOW_WITH_OFFSET_MASK)))
232
else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
233
preg = &infiniteRegion;
236
tmpRegion = mOutputRegion;
239
if (tmpRegion.isEmpty ())
242
preg = &shadowRegion;
245
/* In case some plugin needs to paint us with an offset region */
246
if (preg->isEmpty ())
249
const CompRegion ® (*preg);
247
251
for (int i = 0; i < wd->nQuad; i++)
286
289
ml[0] = gWindow->matrices ()[0];
287
290
gWindow->vertexBuffer ()->begin ();
288
gWindow->glAddGeometry (ml, window->frameRegion (), reg);
291
gWindow->glAddGeometry (ml, window->frameRegion (), region);
289
292
gWindow->vertexBuffer ()->end ();
291
294
gWindow->glDrawTexture (gWindow->textures ()[0], transform,
300
303
ml[0] = gWindow->matrices ()[i];
301
304
gWindow->vertexBuffer ()->begin ();
302
gWindow->glAddGeometry (ml, regions[i], reg);
305
gWindow->glAddGeometry (ml, regions[i], region);
303
306
gWindow->vertexBuffer ()->end ();
305
308
gWindow->glDrawTexture (gWindow->textures ()[i], transform,
336
if (!bindTexture (pixmap))
339
damage = XDamageCreate (screen->dpy (), pixmap,
340
XDamageReportRawRectangles);
344
* DecorTexture::~DecorTexture
346
* Remove damage handle on texture
350
DecorTexture::~DecorTexture ()
353
XDamageDestroy (screen->dpy (), damage);
357
* DecorTexture::indTexture
359
* This function actually takes and binds/rebinds the given Pixmap
360
* to a texture (i.e. calls GLTexture::bindPixmapToTexture)
365
DecorTexture::bindTexture (Pixmap src)
333
367
unsigned int width, height, depth, ui;
337
373
if (!XGetGeometry (screen->dpy (), pixmap, &root,
338
374
&i, &i, &width, &height, &ui, &depth))
380
// Explicitly clear the texture list before binding/rebinding
344
383
bindFailed = false;
345
384
textures = GLTexture::bindPixmapToTexture (pixmap, width, height, depth);
346
385
if (textures.size () != 1)
348
387
bindFailed = true;
353
392
if (!DecorScreen::get (screen)->optionGetMipmap ())
354
393
textures[0]->setMipmap (false);
356
damage = XDamageCreate (screen->dpy (), pixmap,
357
XDamageReportRawRectangles);
361
* DecorTexture::~DecorTexture
363
* Remove damage handle on texture
367
DecorTexture::~DecorTexture ()
370
XDamageDestroy (screen->dpy (), damage);
1547
1572
/* Undecorated windows need to have the
1548
1573
* input and output frame removed and the
1549
1574
* frame window geometry reset */
1553
1577
memset (&emptyExtents, 0, sizeof (CompWindowExtents));