Home | History | Annotate | Download | only in gtk
      1 /*
      2  * Copyright (C) 2011 Igalia S.L.
      3  *
      4  *  This library is free software; you can redistribute it and/or
      5  *  modify it under the terms of the GNU Lesser General Public
      6  *  License as published by the Free Software Foundation; either
      7  *  version 2 of the License, or (at your option) any later version.
      8  *
      9  *  This library is distributed in the hope that it will be useful,
     10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  *  Lesser General Public License for more details.
     13  *
     14  *  You should have received a copy of the GNU Lesser General Public
     15  *  License along with this library; if not, write to the Free
     16  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17  *  Boston, MA 02110-1301 USA
     18  */
     19 
     20 #ifndef GraphicsContext3DInternal_h
     21 #define GraphicsContext3DInternal_h
     22 
     23 typedef struct __GLXcontextRec *GLXContext;
     24 typedef unsigned long GLXPbuffer;
     25 typedef unsigned long GLXPixmap;
     26 typedef unsigned char GLubyte;
     27 typedef unsigned long Pixmap;
     28 
     29 namespace WebCore {
     30 
     31 class GraphicsContext3D;
     32 
     33 class GraphicsContext3DInternal {
     34     public:
     35     static GraphicsContext3DInternal* create();
     36     ~GraphicsContext3DInternal();
     37     void makeContextCurrent();
     38 
     39     private:
     40     friend class GraphicsContext3D;
     41     static GraphicsContext3DInternal* createPbufferContext();
     42     static GraphicsContext3DInternal* createPixmapContext();
     43     GraphicsContext3DInternal(GLXContext, GLXPbuffer);
     44     GraphicsContext3DInternal(GLXContext, Pixmap, GLXPixmap);
     45 
     46     static void addActiveGraphicsContext(GraphicsContext3D*);
     47     static void removeActiveGraphicsContext(GraphicsContext3D*);
     48     static void cleanupActiveContextsAtExit();
     49 
     50     GLXContext m_context;
     51     GLXPbuffer m_pbuffer;
     52     Pixmap m_pixmap;
     53     GLXPixmap m_glxPixmap;
     54 };
     55 
     56 }
     57 
     58 #endif // GraphicsContext3DIternal_h
     59