Gnash  0.8.11dev
Public Member Functions | Static Public Member Functions | List of all members
gnash::renderer::openvg::Renderer_ovg Class Reference

#include <OpenVGRenderer.h>

Inheritance diagram for gnash::renderer::openvg::Renderer_ovg:
gnash::Renderer

Public Member Functions

std::string description () const
 Return a description of this renderer. More...
 
 Renderer_ovg ()
 
 Renderer_ovg (renderer::GnashDevice::dtype_t dtype)
 
 ~Renderer_ovg ()
 
void init (float x, float y)
 
CachedBitmapcreateCachedBitmap (std::unique_ptr< image::GnashImage > im)
 Given an image, returns a pointer to a CachedBitmap class that can later be passed to FillStyleX_bitmap(), to set a bitmap fill style. More...
 
void drawVideoFrame (gnash::image::GnashImage *, const gnash::Transform &, const gnash::SWFRect *, bool)
 Draws a video frame. More...
 
void world_to_pixel (int &x, int &y, float world_x, float world_y) const
 
gnash::geometry::Range2d< int > world_to_pixel (const gnash::SWFRect &wb) const
 Converts world coordinates to pixel coordinates. More...
 
gnash::geometry::Range2d< int > world_to_pixel (const geometry::Range2d< float > &wb) const
 
gnash::point pixel_to_world (int, int) const
 Converts pixel coordinates to world coordinates (TWIPS) More...
 
void begin_display (const gnash::rgba &, int, int, float, float, float, float)
 
void end_display ()
 
void drawLine (const std::vector< point > &coords, const rgba &fill, const SWFMatrix &mat)
 Draw a line-strip directly, using a thin, solid line. More...
 
void drawVideoFrame (image::GnashImage *frame, const SWFMatrix *m, const SWFRect *bounds, bool smooth)
 
void draw_poly (const std::vector< point > &corners, const rgba &fill, const rgba &outline, const SWFMatrix &mat, bool masked)
 Draw a simple, solid filled polygon with a thin (~1 pixel) outline. More...
 
void drawShape (const gnash::SWF::ShapeRecord &, const gnash::Transform &)
 
void drawGlyph (const SWF::ShapeRecord &rec, const rgba &c, const SWFMatrix &mat)
 Draws a glyph (font character). More...
 
void set_antialiased (bool enable)
 
void begin_submit_mask ()
 
void end_submit_mask ()
 
void apply_mask ()
 
void disable_mask ()
 
void set_scale (float xscale, float yscale)
 Sets the x/y scale for the movie. More...
 
void set_invalidated_regions (const InvalidatedRanges &ranges)
 Sets the update region (called prior to begin_display). More...
 
RendererstartInternalRender (gnash::image::GnashImage &)
 Setup the renderer to draw to an internal buffer. More...
 
void endInternalRender ()
 Finish internal rendering. More...
 
unsigned int getBitsPerPixel ()
 
void setFillPaint (const VGPaint paint)
 
void printVGParams ()
 
void printVGHardware ()
 
- Public Member Functions inherited from gnash::Renderer
 Renderer ()
 
virtual ~Renderer ()
 
virtual void set_translation (float, float)
 
void setQuality (Quality q)
 
virtual void renderToImage (std::unique_ptr< IOChannel >, FileType, int) const
 Draw the current rendering buffer to an image file. More...
 
geometry::Range2d< int > world_to_pixel (const geometry::Range2d< int > &wb) const
 
geometry::Range2d< int > pixel_to_world (const geometry::Range2d< int > &pixelbounds) const
 
virtual bool bounds_in_clipping_area (const geometry::Range2d< int > &) const
 Checks if the given bounds are (partially) in the current drawing clipping area. More...
 
virtual RenderImages::const_iterator getFirstRenderImage () const
 
virtual RenderImages::const_iterator getLastRenderImage () const
 

Static Public Member Functions

static void printVGPath (VGPath path)
 
static void printVGMatrix (VGfloat *mat)
 
static void printVGMatrix (const SWFMatrix &mat)
 
static const char * getErrorString (VGErrorCode error)
 

Additional Inherited Members

- Public Types inherited from gnash::Renderer
typedef std::shared_ptr< GnashVaapiImageProxyRenderImage
 
typedef std::vector< RenderImageRenderImages
 
- Protected Attributes inherited from gnash::Renderer
Quality _quality
 Kept in parallel with movie_root's setting. More...
 
RenderImages _render_images
 

Constructor & Destructor Documentation

§ Renderer_ovg() [1/2]

gnash::renderer::openvg::Renderer_ovg::Renderer_ovg ( )

§ Renderer_ovg() [2/2]

gnash::renderer::openvg::Renderer_ovg::Renderer_ovg ( renderer::GnashDevice::dtype_t  dtype)

References gnash::key::f, and set_scale().

§ ~Renderer_ovg()

gnash::renderer::openvg::Renderer_ovg::~Renderer_ovg ( )

Member Function Documentation

§ apply_mask()

void gnash::renderer::openvg::Renderer_ovg::apply_mask ( )

Apply the current mask; nesting is supported.

This method marks the stencil buffer by incrementing every stencil pixel by one every time a solid from one of the current masks is drawn. When all the mask solids are drawn, we change the stencil operation to permit only drawing where all masks have drawn, in other words, where all masks intersect, or in even other words, where the stencil pixel buffer equals the number of masks.

References gnash::key::_1, and gnash::renderer::openvg::for_each().

Referenced by disable_mask(), and end_submit_mask().

§ begin_display()

void gnash::renderer::openvg::Renderer_ovg::begin_display ( const gnash::rgba ,
int  width,
int  height,
float  x0,
float  x1,
float  y0,
float  y1 
)
virtual

Setup the renderer to display by setting the Matrix for scaling, shearing, and transformations.

Parameters
width- stage width
height- stage height
x0- minimum frame size in X dimension in twips
x1- maximum frame size in X dimension in twips
y0- minimum frame size in Y dimension in twips
y1- maximum frame size in Y dimension in twips

Implements gnash::Renderer.

References height.

§ begin_submit_mask()

void gnash::renderer::openvg::Renderer_ovg::begin_submit_mask ( )
virtual

Masks

   Masks are defined by drawing calls enclosed by begin_submit_mask()
   and end_submit_mask(). Between these two calls, no drawing is to
   occur. The shapes rendered between the two calls define the
   visible region of the mask. Graphics that are irrelevant in the
   context of a mask (lines and fill styles, for example) should be
   ignored. After use, disable_mask() is called to remove the mask.

   Masks may be nested. That is, end_submit_mask() may be followed
   by a call to begin_submit_mask(). The resulting mask shall be an
   intersection of the previously created mask. disable_mask() shall
   result in the disabling or destruction of the last created mask.  

Implements gnash::Renderer.

§ createCachedBitmap()

CachedBitmap * gnash::renderer::openvg::Renderer_ovg::createCachedBitmap ( std::unique_ptr< image::GnashImage im)
virtual

Given an image, returns a pointer to a CachedBitmap class that can later be passed to FillStyleX_bitmap(), to set a bitmap fill style.

==================================================================

Caching utitilies for core.

Implements gnash::Renderer.

§ description()

std::string gnash::renderer::openvg::Renderer_ovg::description ( ) const
inlinevirtual

Return a description of this renderer.

Implements gnash::Renderer.

§ disable_mask()

void gnash::renderer::openvg::Renderer_ovg::disable_mask ( )
virtual

§ draw_poly()

void gnash::renderer::openvg::Renderer_ovg::draw_poly ( const std::vector< point > &  corners,
const rgba fill,
const rgba outline,
const SWFMatrix mat,
bool  masked 
)
virtual

Draw a simple, solid filled polygon with a thin (~1 pixel) outline.

This can't be used for Flash shapes but is intended for internal drawings like bounding boxes (editable text fields) and similar. The polygon should not contain self-intersections. If you do not wish a outline or a fill, then simply set the alpha value to zero.

The polygon need NOT be closed (ie: this function will automatically add an additional vertex to close it.

When masked==false, then any potential mask currently active will be ignored, otherwise it is respected.

Implements gnash::Renderer.

References color, gnash::key::i, gnash::rgba::m_a, gnash::rgba::m_b, gnash::rgba::m_g, gnash::rgba::m_r, MAX_SEG, gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

§ drawGlyph()

void gnash::renderer::openvg::Renderer_ovg::drawGlyph ( const SWF::ShapeRecord rec,
const rgba color,
const SWFMatrix mat 
)
virtual

Draws a glyph (font character).

Glyphs are defined just like shape characters with the difference that they do not have any fill or line styles. Instead, the shape must be drawn using the given color (solid fill). Please note that although the glyph paths may indicate subshapes, the renderer is to ignore that information.

Parameters
def
mat
color

Implements gnash::Renderer.

References gnash::SWF::ShapeRecord::getBounds(), and gnash::SWFRect::is_null().

§ drawLine()

void gnash::renderer::openvg::Renderer_ovg::drawLine ( const std::vector< point > &  coords,
const rgba fill,
const SWFMatrix mat 
)
virtual

Draw a line-strip directly, using a thin, solid line.

Can be used to draw empty boxes and cursors.

Implements gnash::Renderer.

References color, gnash::image::end(), gnash::key::f, gnash::rgba::m_b, gnash::rgba::m_g, gnash::rgba::m_r, and MAX_SEG.

§ drawShape()

void gnash::renderer::openvg::Renderer_ovg::drawShape ( const gnash::SWF::ShapeRecord shape,
const gnash::Transform xform 
)
virtual

§ drawVideoFrame() [1/2]

void gnash::renderer::openvg::Renderer_ovg::drawVideoFrame ( gnash::image::GnashImage frame,
const gnash::Transform xform,
const gnash::SWFRect bounds,
bool  smooth 
)
virtual

Draws a video frame.

==================================================================

Rendering Interface.

The frame has already been decoded and is available in RGB format only.

Parameters
frameThe RGB video buffer frame. Ownership of the buffer is left to the caller.
matThe SWFMatrix with world coordinates used to retrieve the x and y coordinate of the video object. The scaling of the SWFMatrix only refers to the Flash instance, not to the video inside that instance. When a video object is placed on the stage and the loaded video is smaller, then the SWFMatrix is still an "identity matrix". However, if the video object is scaled via ActionScript, for example, then the SWFMatrix will change. This means the renderer has to find the correct scaling for the video inside the bounds.
boundsThe minX/minY fields of this SWFRect are always zero. The width and height determine the size of the Flash video instance on the stage (in TWIPS) prior to SWFMatrix transformations.

Implements gnash::Renderer.

References GNASH_REPORT_FUNCTION.

§ drawVideoFrame() [2/2]

void gnash::renderer::openvg::Renderer_ovg::drawVideoFrame ( image::GnashImage frame,
const SWFMatrix m,
const SWFRect bounds,
bool  smooth 
)

References _, and gnash::log_unimpl().

§ end_display()

void gnash::renderer::openvg::Renderer_ovg::end_display ( )
virtual

Implements gnash::Renderer.

§ end_submit_mask()

void gnash::renderer::openvg::Renderer_ovg::end_submit_mask ( )
virtual

Implements gnash::Renderer.

References apply_mask().

§ endInternalRender()

void gnash::renderer::openvg::Renderer_ovg::endInternalRender ( )
virtual

Finish internal rendering.

Any rendering after this function has been called must apply to the external buffer.

Implements gnash::Renderer.

§ getBitsPerPixel()

unsigned int gnash::renderer::openvg::Renderer_ovg::getBitsPerPixel ( )

§ getErrorString()

const char * gnash::renderer::openvg::Renderer_ovg::getErrorString ( VGErrorCode  error)
static

§ init()

void gnash::renderer::openvg::Renderer_ovg::init ( float  x,
float  y 
)

§ pixel_to_world()

point gnash::renderer::openvg::Renderer_ovg::pixel_to_world ( int  x,
int  y 
) const
virtual

Converts pixel coordinates to world coordinates (TWIPS)

Implements gnash::Renderer.

References gnash::SWFMatrix::invert(), gnash::key::p, and gnash::SWFMatrix::transform().

§ printVGHardware()

void gnash::renderer::openvg::Renderer_ovg::printVGHardware ( )

§ printVGMatrix() [1/2]

void gnash::renderer::openvg::Renderer_ovg::printVGMatrix ( VGfloat *  mat)
static

§ printVGMatrix() [2/2]

void gnash::renderer::openvg::Renderer_ovg::printVGMatrix ( const SWFMatrix mat)
static

§ printVGParams()

void gnash::renderer::openvg::Renderer_ovg::printVGParams ( )

References _, gnash::log_debug(), and gnash::log_error().

Referenced by init().

§ printVGPath()

void gnash::renderer::openvg::Renderer_ovg::printVGPath ( VGPath  path)
static

References _, and gnash::log_debug().

§ set_antialiased()

void gnash::renderer::openvg::Renderer_ovg::set_antialiased ( bool  enable)

References _, and gnash::log_unimpl().

§ set_invalidated_regions()

void gnash::renderer::openvg::Renderer_ovg::set_invalidated_regions ( const InvalidatedRanges )
virtual

Sets the update region (called prior to begin_display).

==================================================================

Prepare drawing area and other utilities

The renderer might do clipping and leave the region outside these bounds unchanged, but he is allowed to change them if that makes sense. After rendering a frame the area outside the invalidated region can be undefined and is not used.

It is not required for all renderers. Parameters are world coordinates (TWIPS).

For more info see page Detection of updated regions.

Reimplemented from gnash::Renderer.

References DSOEXPORT.

§ set_scale()

void gnash::renderer::openvg::Renderer_ovg::set_scale ( float  ,
float   
)
virtual

Sets the x/y scale for the movie.

==================================================================

Interfaces for adjusting renderer output.

Reimplemented from gnash::Renderer.

References gnash::key::f.

Referenced by Renderer_ovg().

§ setFillPaint()

void gnash::renderer::openvg::Renderer_ovg::setFillPaint ( const VGPaint  paint)
inline

References paint, and path.

§ startInternalRender()

Renderer * gnash::renderer::openvg::Renderer_ovg::startInternalRender ( gnash::image::GnashImage buffer)
virtual

Setup the renderer to draw to an internal buffer.

Implementations are free to return a new renderer if they choose.

Returns
0 if the renderer does not support this.

Implements gnash::Renderer.

§ world_to_pixel() [1/3]

void gnash::renderer::openvg::Renderer_ovg::world_to_pixel ( int &  x,
int &  y,
float  world_x,
float  world_y 
) const

§ world_to_pixel() [2/3]

geometry::Range2d< int > gnash::renderer::openvg::Renderer_ovg::world_to_pixel ( const gnash::SWFRect worldbounds) const
virtual

Converts world coordinates to pixel coordinates.

==================================================================

Interface for querying the renderer.

Implements gnash::Renderer.

References gnash::SWFRect::get_x_max(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_max(), gnash::SWFRect::get_y_min(), gnash::SWFRect::is_null(), gnash::SWFRect::is_world(), gnash::geometry::nullRange, world_to_pixel(), and gnash::geometry::worldRange.

§ world_to_pixel() [3/3]

geometry::Range2d< int > gnash::renderer::openvg::Renderer_ovg::world_to_pixel ( const geometry::Range2d< float > &  wb) const

The documentation for this class was generated from the following files: