Bachalo
Bachalo

Reputation: 7219

As3 optimizing bitmap data method

I am trying to optimize the following method

public function update() : void   {
    if (_player.playing && !_player.paused) {
        bitmapData.lock();
        bitmapData.fillRect(_clippingRect, 0);
        bitmapData.draw(_player.container, null, null, null, _clippingRect);
        bitmapData.unlock();
        invalidateContent();
    }
}

Can anyone tell me if perhaps using copypixels or some other method might optimize the update function?

Upvotes: 0

Views: 1437

Answers (1)

gadzhimari
gadzhimari

Reputation: 13

Use copyPixels() method instead of draw(). These links should help you

Composing BitmapData Scenes

Display list vs. blitting - the results!

Upvotes: 1

Related Questions