Gnash  0.8.11dev
fb_glue_ovg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
3 // 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_OVG_H
20 #define FB_GLUE_OVG_H 1
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include <cstdint>
27 #include "openvg/OpenVGRenderer.h"
28 #include "fbsup.h"
29 #include "fb_glue.h"
30 
31 #ifdef HAVE_VG_OPENVG_H
32 #include <VG/openvg.h>
33 #endif
34 
35 #ifdef BUILD_RAWFB_DEVICE
36 # include "rawfb/RawFBDevice.h"
37 #endif
38 
39 #ifdef BUILD_EGL_DEVICE
40 # include "egl/eglDevice.h"
41 #endif
42 
43 namespace gnash {
44 
45 namespace gui {
46 
47 class render_handler;
48 
49 class FBOvgGlue : public FBGlue
50 {
51 
52 public:
53  FBOvgGlue() {};
54  FBOvgGlue(int fd);
55 // FBOvgGlue(int x, int y, int width, int height);
56  ~FBOvgGlue();
57 
58  bool init(int argc, char ***argv);
59  void render();
60 
61  // resize(int width, int height);
62  void draw();
64  void setInvalidatedRegions(const InvalidatedRanges &ranges);
65 
68  void prepDrawingArea(void *drawing_area);
69 
70  void initBuffer(int width, int height);
71  void resize(int width, int height);
72  // void render(geometry::Range2d<int>& bounds);
73 
74  // FIXME: these should go away to be replaced by the DeviceGlue
75  // versions of the same methods.
76  // int width() { return (_device) ? _device->getWidth() : 0; };
77  // int height() { return (_device) ? _device->getHeight() : 0; };
78  int width() { return _width; };
79  int height() { return _height; };
80  int stride() { return _stride; };
81 
82  // these are used only for debugging purpose to access private data
83  size_t getBounds() { return _drawbounds.size(); };
84 
85 private:
86  int _stride;
87  int _width;
88  int _height;
89 
90  //Rectangle _bounds;
91  std::vector< geometry::Range2d<int> > _drawbounds;
92  geometry::Range2d<int> _validbounds;
93 
94  // EGL needs it's own display device, as that's how it stays platform
95  // independent. For a Framebuffer we use that, and on the desktop,
96  // well, there really isn't framebuffer support on the desktop because
97  // the X11 server has control of the device. So the X11 glue support
98  // for OpenVG on a fake framebuffer is for development only.
99 #ifdef BUILD_RAWFB_DEVICE
101 #else
102 # ifdef BUILD_X11_DEVICE
103  renderer::x11::X11Device _display;
104 # endif
105 #endif
106 };
107 
108 } // end of namespace gui
109 } // end of namespace gnash
110 
111 #endif // end of FB_GLUE_OVG_H
112 
113 // Local Variables:
114 // mode: C++
115 // indent-tabs-mode: nil
116 // End:
void prepDrawingArea(void *drawing_area)
Hand off a handle to the native drawing area to the renderer.
Definition: fb_glue_ovg.cpp:198
Definition: fb_glue.h:53
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Not implemented, Fixme.
Definition: fb_glue_ovg.cpp:169
size_t getBounds()
Definition: fb_glue_ovg.h:83
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Definition: X11Device.h:45
~FBOvgGlue()
Definition: fb_glue_ovg.cpp:51
Base class for render handlers.
Definition: Renderer.h:188
void render()
Definition: fb_glue_ovg.cpp:207
void initBuffer(int width, int height)
FBOvgGlue()
Definition: fb_glue_ovg.h:53
bool init(int argc, char ***argv)
Definition: fb_glue_ovg.cpp:57
int stride()
Definition: fb_glue_ovg.h:80
void resize(int width, int height)
int width()
Definition: fb_glue_ovg.h:78
Definition: fb_glue_ovg.h:49
Definition: RawFBDevice.h:45
Renderer * createRenderHandler()
Definition: fb_glue_ovg.cpp:146
int height()
Definition: fb_glue_ovg.h:79