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:
gnash::geometry::SnappingRanges2d< std::int32_t >
gnash::geometry::Range2d< int >
OpenVGRenderer.h
fb_glue_ovg.h
gnash::gui::FBOvgGlue::~FBOvgGlue
~FBOvgGlue()
Definition: fb_glue_ovg.cpp:51
gnash::GnashException
Top-level gnash exception.
Definition: GnashException.h:31
gnash::gui::FBGlue
Definition: fb_glue.h:54
gnash::DeviceGlue::getDepth
size_t getDepth()
Depth of the display.
Definition: DeviceGlue.h:131
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::renderer::GnashDevice::GNASH_NODEV
@ GNASH_NODEV
Definition: GnashDevice.h:48
_
#define _(String)
Definition: log.h:44
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::gui::FBOvgGlue::render
void render()
Definition: fb_glue_ovg.cpp:207
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::gui::FBOvgGlue::height
int height()
Definition: fb_glue_ovg.h:79
gnash::renderer::GnashDevice::OPENVG
@ OPENVG
Definition: GnashDevice.h:46
gnash::renderer::GnashDevice::DIRECTFB
@ DIRECTFB
Definition: GnashDevice.h:48
gnash::renderer::GnashDevice::EGL
@ EGL
Definition: GnashDevice.h:48
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::geometry::Range2d::isNull
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
gnash::geometry::Intersection
Range2d< T > Intersection(const Range2d< T > &r1, const Range2d< T > &r2)
Return a rectangle being the intersetion of the two rectangles.
Definition: Range2d.h:762
gnash::renderer::openvg::create_handler
DSOEXPORT Renderer * create_handler(const char *)
Definition: OpenVGRenderer.cpp:1265
gnash::DeviceGlue::_device
std::unique_ptr< renderer::GnashDevice > _device
Definition: DeviceGlue.h:139
gnash::DeviceGlue::probeDevices
std::unique_ptr< renderer::GnashDevice::dtype_t[]> probeDevices()
Definition: DeviceGlue.h:47
gnash::gui::FBOvgGlue::prepDrawingArea
void prepDrawingArea(void *drawing_area)
Hand off a handle to the native drawing area to the renderer.
Definition: fb_glue_ovg.cpp:198
gnash::renderer::x11::X11Device
Definition: X11Device.h:46
gnash::DeviceGlue::getHeight
size_t getHeight()
Definition: DeviceGlue.h:128
eglDevice.h
gnash::gui::FBOvgGlue::width
int width()
Definition: fb_glue_ovg.h:78
gnash::geometry::SnappingRanges2d::size
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
gnash::gui::FBOvgGlue::getBounds
size_t getBounds()
Definition: fb_glue_ovg.h:83
gnash::gui::FBOvgGlue::draw
void draw()
fb_glue.h
log.h
gnash::renderer::rawfb::RawFBDevice
Definition: RawFBDevice.h:46
gnash::gui::FBOvgGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: fb_glue_ovg.cpp:146
gnashconfig.h
gnash::renderer::EGLDevice
Definition: eglDevice.h:57
gnash::gui::FBOvgGlue::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Not implemented, Fixme.
Definition: fb_glue_ovg.cpp:169
gnash::gui::FBOvgGlue::stride
int stride()
Definition: fb_glue_ovg.h:80
gnash::gui::FBOvgGlue::initBuffer
void initBuffer(int width, int height)
gnash::gui::FBOvgGlue::init
bool init(int argc, char ***argv)
Definition: fb_glue_ovg.cpp:57
gnash::renderer::GnashDevice::RAWFB
@ RAWFB
Definition: GnashDevice.h:48
GnashDevice.h
gnash::renderer::GnashDevice::X11
@ X11
Definition: GnashDevice.h:48
RawFBDevice.h
gnash::gui::FBOvgGlue::FBOvgGlue
FBOvgGlue()
Definition: fb_glue_ovg.h:53
gnash::gui::FBOvgGlue
Definition: fb_glue_ovg.h:50
gnash::gui::FBGlue::_renderer
std::unique_ptr< Renderer > _renderer
Definition: fb_glue.h:76
fbsup.h
gnash::gui::FBOvgGlue::resize
void resize(int width, int height)
gnash::geometry::SnappingRanges2d::getRange
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
gnash::DeviceGlue::getWidth
size_t getWidth()
Definition: DeviceGlue.h:124
GnashException.h
gnash::DeviceGlue::setDevice
void setDevice(renderer::GnashDevice::dtype_t dtype)
Definition: DeviceGlue.cpp:41