Gnash  0.8.11dev
fb_glue_agg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 GNASH_FB_GLUE_AGG_H
20 #define GNASH_FB_GLUE_AGG_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include <cstdint>
27 
28 #include "Renderer.h"
29 #include "fbsup.h"
30 #include "fb_glue.h"
31 
32 namespace gnash {
33 
34 namespace gui {
35 
36 class FBAggGlue: public FBGlue
37 {
38 public:
39  FBAggGlue();
40 
41  // This constructor is not part of the API, as it's AGG and
42  // Framebuffer specific
43  FBAggGlue(int fd);
44 
45  // All of these virtuals are all defined in the base FBGlue class
46  ~FBAggGlue();
47 
54  bool init(int argc, char ***argv);
55 
58 
61  void prepDrawingArea(void *drawing_area);
62 
64  //
78  // does not need to be implemented (optional feature),
79  // but still needs to be available.
80  //
81  void setInvalidatedRegion(const SWFRect& bounds);
82  void setInvalidatedRegions(const InvalidatedRanges &ranges);
83 
87  int width();
88 
91  int height();
92 
94  void render();
95  void render(void* const /* region */) { };
96 
97  size_t getWidth() { return (_device) ? _device->getWidth() : 0; };
98  size_t getHeight() { return (_device) ? _device->getWidth() : 0; };
99  size_t getDepth() { return (_device) ? _device->getDepth() : 0; };
100 
101 protected:
103  int _fd;
104  struct fb_fix_screeninfo _fixinfo;
105  struct fb_var_screeninfo _varinfo;
106 
107  std::unique_ptr<Renderer> _renderer;
108 
110  std::vector< geometry::Range2d<int> > _drawbounds;
111 };
112 
113 } // end of namespace gui
114 } // end of gnash namespace
115 
116 #endif // GNASH_FB_GLUE_AGG_H
117 
118 // Local Variables:
119 // mode: C++
120 // indent-tabs-mode: nil
121 // End:
gnash::geometry::SnappingRanges2d< std::int32_t >
Renderer_agg.h
gnash::renderer::rawfb::RawFBDevice::setGrayscaleLUT8
bool setGrayscaleLUT8()
Definition: RawFBDevice.cpp:161
gnash::gui::FBAggGlue::height
int height()
Definition: fb_glue_agg.cpp:245
gnash::geometry::Range2d< int >
gnash::create_Renderer_agg
DSOEXPORT Renderer_agg_base * create_Renderer_agg(const char *pixelformat)
Create a render handler.
Definition: Renderer_agg.cpp:2048
gnash::gui::FBAggGlue::render
void render(void *const)
Definition: fb_glue_agg.h:95
gnash::gui::FBAggGlue::prepDrawingArea
void prepDrawingArea(void *drawing_area)
Hand off a handle to the native drawing area to the renderer.
Definition: fb_glue_agg.cpp:209
gnash::gui::FBGlue
Definition: fb_glue.h:54
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::gui::FBAggGlue::_validbounds
geometry::Range2d< int > _validbounds
Definition: fb_glue_agg.h:109
gnash::renderer::rawfb::RawFBDevice::getGreenSize
int getGreenSize()
Get the size of the Green pixel.
Definition: RawFBDevice.h:86
gnash::renderer::rawfb::RawFBDevice::getRedSize
int getRedSize()
Get the size of the Red pixel.
Definition: RawFBDevice.h:85
_
#define _(String)
Definition: log.h:44
Renderer.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::gui::FBAggGlue::~FBAggGlue
~FBAggGlue()
Definition: fb_glue_agg.cpp:61
gnash::gui::FbWidget
void FbWidget
Definition: fb_glue.h:48
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::Renderer_agg_base::init_buffer
virtual void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride)=0
gnash::gui::FBAggGlue::_varinfo
struct fb_var_screeninfo _varinfo
Definition: fb_glue_agg.h:105
gnash::gui::FBAggGlue::getHeight
size_t getHeight()
Definition: fb_glue_agg.h:98
__FUNCTION__
#define __FUNCTION__
Definition: log.h:437
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::renderer::rawfb::RawFBDevice::getDepth
int getDepth()
Get the depth of the device.
Definition: RawFBDevice.h:69
gnash::SWFRect
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
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::rawfb::RawFBDevice::getBlueSize
int getBlueSize()
Get the size of the Blue pixel.
Definition: RawFBDevice.h:87
gnash::DeviceGlue::_device
std::unique_ptr< renderer::GnashDevice > _device
Definition: DeviceGlue.h:139
gnash::renderer::rawfb::RawFBDevice::getOffscreenBuffer
std::uint8_t * getOffscreenBuffer()
Get the memory from an offscreen buffer to support Double Buffering.
Definition: RawFBDevice.h:113
gnash::gui::FBAggGlue::getDepth
size_t getDepth()
Definition: fb_glue_agg.h:99
gnash::renderer::rawfb::RawFBDevice::getStride
size_t getStride()
Query the system for all supported configs.
Definition: RawFBDevice.h:115
gnash::gui::FBAggGlue::setInvalidatedRegion
void setInvalidatedRegion(const SWFRect &bounds)
Gives the GUI a hint which region of the stage should be redrawn.
Definition: fb_glue_agg.cpp:72
gnash::gui::FBAggGlue::width
int width()
The Width of the drawing area, in pixels. For framebuffer based devices, this is the size of the disp...
Definition: fb_glue_agg.cpp:234
gnash::gui::FBAggGlue::_fd
int _fd
This is the file descriptor for the framebuffer memory.
Definition: fb_glue_agg.h:99
gnash::agg_detect_pixel_format
DSOEXPORT const char * agg_detect_pixel_format(unsigned int rofs, unsigned int rsize, unsigned int gofs, unsigned int gsize, unsigned int bofs, unsigned int bsize, unsigned int bpp)
Definition: Renderer_agg.cpp:2109
gnash::geometry::SnappingRanges2d::size
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
fb_glue.h
log.h
gnash::renderer::rawfb::RawFBDevice
Definition: RawFBDevice.h:46
gnash::gui::FBAggGlue::_fixinfo
struct fb_fix_screeninfo _fixinfo
Definition: fb_glue_agg.h:104
gnash::Renderer_agg_base
Definition: Renderer_agg.h:30
gnashconfig.h
gnash::gui::FBAggGlue
Definition: fb_glue_agg.h:37
gnash::renderer::rawfb::RawFBDevice::getFBMemSize
size_t getFBMemSize()
Definition: RawFBDevice.h:116
RunResources.h
gnash::gui::FBAggGlue::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: fb_glue_agg.cpp:83
gnash::renderer::rawfb::RawFBDevice::getHandle
int getHandle()
Definition: RawFBDevice.h:117
gnash::geometry::Range2d::setTo
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
gnash::gui::FBAggGlue::init
bool init(int argc, char ***argv)
Initialise the Framebuffer GUI and the AGG renderer.
Definition: fb_glue_agg.cpp:109
gnash::gui::FBAggGlue::createRenderHandler
Renderer * createRenderHandler()
Create the renderer handler.
Definition: fb_glue_agg.cpp:147
gnash::renderer::rawfb::RawFBDevice::getFBMemory
std::uint8_t * getFBMemory()
Get the memory from the real framebuffer.
Definition: RawFBDevice.h:110
RawFBDevice.h
fbsup.h
fb_glue_agg.h
gnash::geometry::SnappingRanges2d::getRange
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
gnash::gui::FBAggGlue::getWidth
size_t getWidth()
Definition: fb_glue_agg.h:97
gnash::gui::FBAggGlue::_renderer
std::unique_ptr< Renderer > _renderer
Definition: fb_glue_agg.h:107
gnash::gui::FBAggGlue::FBAggGlue
FBAggGlue()
Definition: fb_glue_agg.cpp:45
gnash::gui::FBAggGlue::_drawbounds
std::vector< geometry::Range2d< int > > _drawbounds
Definition: fb_glue_agg.h:110
gnash::gui::FBAggGlue::render
void render()
Render the current buffer.
Definition: fb_glue_agg.cpp:217
gnash::renderer::rawfb::RawFBDevice::isSingleBuffered
bool isSingleBuffered()
Is this device single buffered.
Definition: RawFBDevice.h:131