2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc
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.
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.
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
19 #ifndef GNASH_RENDER_HANDLER_DIRECTFB_H
20 #define GNASH_RENDER_HANDLER_DIRECTFB_H
23 #include "gnashconfig.h"
32 #ifdef HAVE_DIRECTFB_H
33 # include <directfb/directfb.h>
45 class DSOEXPORT Renderer_DirectFB
: public Renderer
48 std::string
description() const { return "DirectFB"; }
52 void init(float x
, float y
);
53 CachedBitmap
*createCachedBitmap(std::auto_ptr
<image::GnashImage
> im
);
55 void world_to_pixel(int& x
, int& y
, float world_x
, float world_y
);
56 gnash::geometry::Range2d
<int> world_to_pixel(const gnash::SWFRect
& wb
);
57 geometry::Range2d
<int> world_to_pixel(const geometry::Range2d
<float>& wb
);
58 gnash::point
pixel_to_world(int, int);
60 void begin_display(const gnash::rgba
&, int, int, float,
62 // This is from the patch
63 // void begin_display(const rgba& bg_color, int viewport_x0,
64 // int viewport_y0, int viewport_width,
65 // int viewport_height, float x0, float x1,
66 // float y0, float y1);
68 void drawLine(const std::vector
<point
>& coords
, const rgba
& fill
,
69 const SWFMatrix
& mat
);
70 void drawVideoFrame(gnash::image::GnashImage
*frame
, const gnash::Transform
& tx
,
71 const gnash::SWFRect
*bounds
, bool smooth
);
72 void drawPoly(const point
* corners
, size_t corner_count
,
73 const rgba
& fill
, const rgba
& outline
,
74 const SWFMatrix
& mat
, bool masked
);
75 void drawShape(const gnash::SWF::ShapeRecord
&, const gnash::Transform
&);
76 void drawGlyph(const SWF::ShapeRecord
& rec
, const rgba
& c
,
77 const SWFMatrix
& mat
);
79 void set_antialiased(bool enable
);
80 void begin_submit_mask();
81 void end_submit_mask();
85 void set_scale(float xscale
, float yscale
);
86 void set_invalidated_regions(const InvalidatedRanges
&ranges
);
88 // These weren't in the patch
89 Renderer
*startInternalRender(gnash::image::GnashImage
&);
90 void endInternalRender();
92 unsigned int getBitsPerPixel();
93 bool initTestBuffer(unsigned width
, unsigned height
);
95 // These methods are only for debugging and development
97 void printVGHardware();
100 unsigned char *_testBuffer
; // buffer used by initTestBuffer() only
103 DSOEXPORT Renderer
* create_handler(const char *pixelformat
);
105 } // namespace gnash::renderer::DirectFB
106 } // namespace gnash::renderer
109 #endif // __RENDER_HANDLER_DIRECTFB_H__
113 // indent-tabs-mode: nil