• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BENCH_GL_EGL_STUFF_H_
6 #define BENCH_GL_EGL_STUFF_H_
7 
8 #include <EGL/egl.h>
9 #include "base/logging.h"
10 #include "glinterface.h"
11 
12 class EGLInterface : public GLInterface {
13  public:
14   EGLInterface()
15       : display_(EGL_NO_DISPLAY),
16         config_(NULL),
17         surface_(NULL),
18         context_(NULL) {}
19   virtual ~EGLInterface() {}
20 
21   virtual bool Init();
22   virtual void Cleanup();
23   virtual XVisualInfo* GetXVisual();
24 
25   virtual void SwapBuffers();
26   virtual bool SwapInterval(int interval);
27 
28   virtual void CheckError();
29 
30   virtual bool MakeCurrent(const GLContext& context);
31   virtual const GLContext CreateContext();
32   virtual void DeleteContext(const GLContext& context);
33   virtual const GLContext& GetMainContext() { return context_; }
34 
35   void TerminateGL();
36 
37   const EGLDisplay display() const { return display_; }
38 
39   const EGLSurface surface() const { return surface_; }
40 
41  private:
42   EGLDisplay display_;
43   EGLConfig config_;
44   EGLSurface surface_;
45   EGLContext context_;
46 };
47 
48 #endif  // BENCH_GL_EGL_STUFF_H_
49