Gnash  0.8.11dev
fb_glue_gles1.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
3 // Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef FB_GLUE_GLES1_H
20 #define FB_GLUE_GLES1_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 // gles-1.0c for Linux
27 #ifdef HAVE_GLES1_GL_H
28 # include <GLES/gl.h>
29 # endif
30 #ifdef HAVE_GLES1_EGL_H
31 #include <GLES/egl.h>
32 #endif
33 #if 0
34 // Mali Developer Tools for ARM 1.x
35 #ifdef HAVE_EGL_EGL_H
36 # include <EGL/egl.h>
37 # include <EGL/eglext.h>
38 #endif
39 // Mali Developer Tools for ARM 2.x and Android 2.1
40 #ifdef HAVE_GLES2_GL2_H
41 # include <GLES2/gl2.h>
42 # include <GLES2/gl2ext.h>
43 #endif
44 #endif
45 
46 #include "fbsup.h"
47 #include "fb_glue.h"
48 
49 #ifdef BUILD_EGL_DEVICE
50 # include "egl/eglDevice.h"
51 #endif
52 
53 #include <memory>
54 
55 #include "fbsup.h"
56 
57 namespace gnash {
58 
59 namespace gui {
60 
61 class render_handler;
62 
63 class FBgles1Glue: public FBGlue
64 {
65 public:
66  FBgles1Glue(int fd);
67  ~FBgles1Glue();
68  bool init(int argc, char ***);
69 
71  void setInvalidatedRegions(const InvalidatedRanges& /* ranges */) {}
72 
73  int width ();
74  int height ();
75  void render ();
76 
77  void render_to_pbuffer ();
79  void render_to_display ();
82  void prepDrawingArea(void *drawing_area);
83 
84  void initBuffer(int width, int height);
85  void resize(int width, int height);
86  // void render(geometry::Range2d<int>& bounds);
87 
88 protected:
89  int _fd;
90 
91 private:
92  std::unique_ptr<Renderer> _renderer;
93  EGLDisplay _display;
94  EGLConfig _config;
95  EGLContext _context;
96  EGLSurface _surface;
97  EGLConfig _pbuffer_config;
98  EGLSurface _pbuffer;
99 };
100 
101 } // end of namespace gui
102 } // namespace gnash
103 
104 #endif // FB_GLUE_GLES1_H
105 
106 // Local Variables:
107 // mode: C++
108 // indent-tabs-mode: nil
109 // End:
void initBuffer(int width, int height)
bool init(int argc, char ***)
Definition: fb_glue_gles1.cpp:80
void render_to_display()
Definition: fb_glue_gles1.cpp:210
Renderer * createRenderHandler()
Definition: fb_glue_gles1.cpp:68
void setInvalidatedRegions(const InvalidatedRanges &)
Definition: fb_glue_gles1.h:71
Definition: fb_glue.h:53
void render()
Definition: fb_glue_gles1.cpp:193
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void prepare_copy_from_pbuffer()
Definition: fb_glue_gles1.cpp:204
Base class for render handlers.
Definition: Renderer.h:188
int height()
Definition: fb_glue_gles1.cpp:185
int _fd
Definition: fb_glue_gles1.h:89
void resize(int width, int height)
Definition: fb_glue_gles1.h:63
void render_to_pbuffer()
Definition: fb_glue_gles1.cpp:198
FBgles1Glue(int fd)
Definition: fb_glue_gles1.cpp:51
void prepDrawingArea(void *drawing_area)
Hand off a handle to the native drawing area to the renderer.
Definition: fb_glue_gles1.cpp:216
int width()
Definition: fb_glue_gles1.cpp:177
~FBgles1Glue()
Definition: fb_glue_gles1.cpp:59