~nabil-stendardo/ubuntu/quantal/compiz/fix-segfault-related-to-shaders-and-uniforms

« back to all changes in this revision

Viewing changes to plugins/opengl/src/texture.cpp

* Cherry-pick fixes from trunk:
  - Fix FTBFS with BUILD_GLES

Show diffs side-by-side

added added

removed removed

Lines of Context:
445
445
    return GLTexture::List ();
446
446
}
447
447
 
448
 
namespace
449
 
{
450
 
    bool checkPixmapValidityGLX (Pixmap pixmap)
451
 
    {
452
 
        Window       windowReturn;
453
 
        unsigned int uiReturn;
454
 
        int          iReturn;
455
 
 
456
 
        if (!XGetGeometry (screen->dpy (),
457
 
                           pixmap,
458
 
                           &windowReturn,
459
 
                           &iReturn,
460
 
                           &iReturn,
461
 
                           &uiReturn,
462
 
                           &uiReturn,
463
 
                           &uiReturn,
464
 
                           &uiReturn))
465
 
            return false;
466
 
        return true;
467
 
    }
468
 
 
469
 
    const cgl::WaitGLXFunc & waitGLXFunc ()
470
 
    {
471
 
        static const cgl::WaitGLXFunc f (boost::bind (glXWaitX));
472
 
        return f;
473
 
    }
474
 
 
475
 
    const cgl::PixmapCheckValidityFunc & checkPixmapValidityFunc ()
476
 
    {
477
 
        static const cgl::PixmapCheckValidityFunc f (boost::bind (checkPixmapValidityGLX, _1));
478
 
        return f;
479
 
    }
480
 
}
481
 
 
482
448
#ifdef USE_GLES
483
449
EglTexture::EglTexture () :
484
450
    damaged (true),
501
467
}
502
468
 
503
469
GLTexture::List
504
 
EglTexture::bindPixmapToTexture (Pixmap pixmap,
505
 
                                 int    width,
506
 
                                 int    height,
507
 
                                 int    depth)
 
470
EglTexture::bindPixmapToTexture (Pixmap                       pixmap,
 
471
                                 int                          width,
 
472
                                 int                          height,
 
473
                                 int                          depth,
 
474
                                 compiz::opengl::PixmapSource source)
508
475
{
509
476
    if ((int) width > GL::maxTextureSize || (int) height > GL::maxTextureSize ||
510
477
        !GL::textureFromPixmap)
581
548
 
582
549
namespace
583
550
{
 
551
    bool checkPixmapValidityGLX (Pixmap pixmap)
 
552
    {
 
553
        Window       windowReturn;
 
554
        unsigned int uiReturn;
 
555
        int          iReturn;
 
556
 
 
557
        if (!XGetGeometry (screen->dpy (),
 
558
                           pixmap,
 
559
                           &windowReturn,
 
560
                           &iReturn,
 
561
                           &iReturn,
 
562
                           &uiReturn,
 
563
                           &uiReturn,
 
564
                           &uiReturn,
 
565
                           &uiReturn))
 
566
            return false;
 
567
        return true;
 
568
    }
 
569
 
 
570
    const cgl::WaitGLXFunc & waitGLXFunc ()
 
571
    {
 
572
        static const cgl::WaitGLXFunc f (boost::bind (glXWaitX));
 
573
        return f;
 
574
    }
 
575
 
 
576
    const cgl::PixmapCheckValidityFunc & checkPixmapValidityFunc ()
 
577
    {
 
578
        static const cgl::PixmapCheckValidityFunc f (boost::bind (checkPixmapValidityGLX, _1));
 
579
        return f;
 
580
    }
 
581
 
584
582
    const cgl::BindTexImageEXTFunc & bindTexImageEXT ()
585
583
    {
586
584
        static int                            *attrib_list = NULL;