Gnash
0.8.11dev
|
#include <PathParser.h>
Public Member Functions | |
PathParser (const std::vector< Path > &paths, size_t num_styles) | |
virtual | ~PathParser () |
void | run (const SWFCxForm &cx, const SWFMatrix &mat) |
virtual void | prepareFill (int fill_style, const SWFCxForm &cx)=0 |
virtual void | terminateFill (int fill_style)=0 |
virtual void | fillShape () |
virtual void | moveTo (const point &p)=0 |
virtual void | curveTo (const Edge &curve)=0 |
Draw the given curve using the path pencil. More... | |
virtual void | lineTo (const point &p)=0 |
Draw a straight line to the given point. More... | |
PathParser is a class which aims to efficiently transpose Flash paths into well formed, single-filled shapes. A renderer should utilize this class by subclassing PathParser. The methods reimplemented will receive low level path information (e.g., moveTo).
gnash::PathParser::PathParser | ( | const std::vector< Path > & | paths, |
size_t | num_styles | ||
) |
paths | list of Flash paths to be 'parsed'. |
num_styles | count of fill styles pointed to by the first argument. |
|
inlinevirtual |
|
pure virtual |
Draw the given curve using the path pencil.
Referenced by run().
|
inlinevirtual |
Fill a single shape. Implementation is optional, because most renderers can handle multiple well-formed, singly-filled shapes and can do the render/fill stage during terminateFill(). However, those that can't may implement this method.
References gnash::key::p.
Referenced by run().
|
pure virtual |
Draw a straight line to the given point.
Referenced by run().
|
pure virtual |
Move the path pencil to the given location. Thus a new shape should be started. The parser may invoke this method several times for a single fill style, creating several shapes.
Referenced by run().
|
pure virtual |
Runs the path parser, invoking the pure virtual methods where appropriate.
cx | the color transform that will be passed to prepareFill. |
mat | the SWFMatrix that will be passed to prepareFill. |
References _, gnash::key::_1, gnash::UnivocalPath::_fill_type, gnash::UnivocalPath::_path, gnash::Edge::ap, curveTo(), gnash::image::end(), gnash::UnivocalPath::endPoint(), gnash::UnivocalPath::FILL_LEFT, gnash::UnivocalPath::FILL_RIGHT, fillShape(), gnash::renderer::opengl::for_each(), gnash::key::i, lineTo(), gnash::log_error(), gnash::Path::m_edges, moveTo(), path, prepareFill(), gnash::UnivocalPath::startPoint(), gnash::Edge::straight(), and terminateFill().
|
pure virtual |
Terminates the fill style, that is, precludes the fill style from further use, which may be freed or otherwise cleaned up. Most renderers should fill the paths previously parsed.
Referenced by run().