Gnash
0.8.10
|
#include <Bitmap.h>
Public Member Functions | |
Bitmap (movie_root &mr, as_object *object, BitmapData_as *bd, DisplayObject *parent) | |
Construct a Bitmap character from a BitmapData. | |
Bitmap (movie_root &mr, as_object *object, const BitmapMovieDefinition *def, DisplayObject *parent) | |
Construct a Bitmap character from a loaded image. | |
virtual | ~Bitmap () |
virtual void | update () |
Notify the Bitmap that it's been updated during ActionScript execution. | |
virtual void | add_invalidated_bounds (InvalidatedRanges &ranges, bool force) |
Add the DisplayObject's invalidated bounds *to* the given ranges list. | |
virtual void | display (Renderer &renderer, const Transform &xform) |
Display this Bitmap. | |
virtual SWFRect | getBounds () const |
Get the bounds of the Bitmap. | |
virtual bool | pointInShape (boost::int32_t x, boost::int32_t y) const |
Test whether a point is in the Bitmap's bounds. | |
virtual void | construct (as_object *init=0) |
Called when the object is placed on stage. | |
Protected Member Functions | |
void | markReachableObjects () const |
A Bitmap DisplayObject. This is not AS-referencable, but can be removed and placed using depths like normal DisplayObjects. This can be constructed dynamically from a BitmapData, or non-dynamically as part of a BitmapMovie. For non-dynamic Bitmap DisplayObjects, the bitmap data never changes. The update() function is called once on stage placement. For dynamic Bitmap DisplayObjects, the attached BitmapData_as should call update() whenever the data changes. This Bitmap registers itself with the BitmapData_as on stage placement.
gnash::Bitmap::Bitmap | ( | movie_root & | mr, |
as_object * | object, | ||
BitmapData_as * | bd, | ||
DisplayObject * | parent | ||
) |
Construct a Bitmap character from a BitmapData.
References gnash::DynamicShape::setBounds(), gnash::pixelsToTwips(), assert, and gnash::BitmapData_as::disposed().
gnash::Bitmap::Bitmap | ( | movie_root & | mr, |
as_object * | object, | ||
const BitmapMovieDefinition * | def, | ||
DisplayObject * | parent | ||
) |
Construct a Bitmap character from a loaded image.
References gnash::DynamicShape::setBounds(), and gnash::BitmapMovieDefinition::get_frame_size().
gnash::Bitmap::~Bitmap | ( | ) | [virtual] |
void gnash::Bitmap::add_invalidated_bounds | ( | InvalidatedRanges & | ranges, |
bool | force | ||
) | [virtual] |
Add the DisplayObject's invalidated bounds *to* the given ranges list.
NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).
That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.
It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObject::invalidated(), gnash::geometry::SnappingRanges2d::add(), gnash::DisplayObject::m_old_invalidated_ranges, gnash::SWFRect::expand_to_transformed_rect(), gnash::getWorldMatrix(), getBounds(), and gnash::SWFRect::getRange().
void gnash::Bitmap::construct | ( | as_object * | init = 0 | ) | [virtual] |
Called when the object is placed on stage.
Reimplemented from gnash::DisplayObject.
References gnash::BitmapData_as::attach(), test::w, gnash::pixelsToTwips(), gnash::key::h, gnash::SWFMatrix::set_scale(), fill, gnash::BitmapFill::CLIPPED, gnash::BitmapFill::SMOOTHING_UNSPECIFIED, gnash::DynamicShape::addFillStyle(), gnash::Path::drawLineTo(), gnash::DynamicShape::add_path(), gnash::DynamicShape::finalize(), and gnash::DisplayObject::set_invalidated().
Referenced by gnash::BitmapMovie::BitmapMovie().
Display this Bitmap.
Don't display cleared Bitmaps.
Implements gnash::DisplayObject.
References gnash::DisplayObject::transform(), gnash::DynamicShape::display(), and gnash::DisplayObject::clear_invalidated().
SWFRect gnash::Bitmap::getBounds | ( | ) | const [virtual] |
Get the bounds of the Bitmap.
Implements gnash::DisplayObject.
References gnash::DynamicShape::getBounds().
Referenced by add_invalidated_bounds().
void gnash::Bitmap::markReachableObjects | ( | ) | const [inline, protected] |
References gnash::BitmapData_as::setReachable().
bool gnash::Bitmap::pointInShape | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | const [virtual] |
Test whether a point is in the Bitmap's bounds.
Implements gnash::DisplayObject.
References gnash::DisplayObject::pointInBounds().
void gnash::Bitmap::update | ( | ) | [virtual] |
Notify the Bitmap that it's been updated during ActionScript execution.
Nothing to do for disposed bitmaps.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObject::set_invalidated(), gnash::BitmapData_as::disposed(), and gnash::DynamicShape::clear().