예제 #1
0
void
Bitmap::construct(as_object* /*init*/)
{
    if (_bitmapData) _bitmapData->attach(this);

    if (!_def && !_bitmapData) return;

    // Width and height are a maximum of 2880, so there is no risk of 
    // overflow 
    const int w = pixelsToTwips(_width);
    const int h = pixelsToTwips(_height);

    SWFMatrix mat;
    mat.set_scale(1.0 / 20, 1.0 / 20);

    // Can this be tiled? And smoothing?
    FillStyle fill = BitmapFill(BitmapFill::CLIPPED, bitmap(), mat,
            BitmapFill::SMOOTHING_UNSPECIFIED);

    const size_t fillLeft = _shape.addFillStyle(fill);

    Path bmpath(w, h, fillLeft, 0, 0, false);
    bmpath.drawLineTo(w, 0);
    bmpath.drawLineTo(0, 0);
    bmpath.drawLineTo(0, h);
    bmpath.drawLineTo(w, h);

    _shape.add_path(bmpath);
    _shape.finalize();

    set_invalidated();
}
예제 #2
0
void
Video::clear()
{
    // Clear the current image only if paused.
    if (_ns && _ns->playbackState() == PlayHead::PLAY_PAUSED)
    {
        set_invalidated();
        _lastDecodedVideoFrame.reset();
    }
}
예제 #3
0
void
Bitmap::update()
{
    /// Nothing to do for disposed bitmaps.
    if (!_bitmapData) return;
    
    set_invalidated();

    if (_bitmapData->disposed()) {
        _bitmapData = 0;
        _shape.clear();
    }
}