Posts Tagged bitmaps

ScrollRect and CacheAsBitmap

Anybody who has ever had a performance problem with a graphically-rich Flash app has seen the “Show Redraw Regions” option in the debug player. Well, at least I hope they have since it’s right there in the context menu and there’s even a function call to toggle them. Normally it’s pretty straightforward what gets redrawn and when, but when you start to mix in advanced features like scrollRect and cacheAsBitmap, things get complicated. Today I’m going to cover a technique for eliminating some mysterious redraw regions.

Read the rest of this entry »

Tags: , , , , , ,

12 Comments

Miscellaneous Utility Functions

The last three articles have been about utility functions for objects, classes, and display objects. This is the finale in the series and contains some leftover utility functions.

Read the rest of this entry »

Tags: , , ,

3 Comments

Fast Line Drawing

A recent post by Simo Santavirta featured an algorithm with an irresistible name: Extremely Fast Line Argorithm. A comment on that article piqued my interest and I decided to test the algorithm out against Adobe’s Graphics.lineTo.

Read the rest of this entry »

Tags: , , ,

14 Comments

BitmapData Alpha Performance

The BitmapData class is among the most useful classes in AS3. When it was introduced in Flash 8 it dramatically improved Flash development by opening up new potential for features and optimization. Since it’s used so often, it’s good to know as much about it as possible. Today I’m going to cover the performance difference that turning alpha (a.k.a. transparency) on makes.

Read the rest of this entry »

Tags: , , ,

4 Comments

Map Performance

I recently received an e-mail from Dmitry Zhelnin (translation) with a test he did concerning the speed of a couple ways to get a value for a key, which I like to call a map and Wikipedia likes to call an associative array. I’d been meaning to do a similar test for a while now and, guess what, I finally have! UPDATE: fixed miss test for fixed-size Vectors.

Read the rest of this entry »

Tags: , , , , , , ,

13 Comments

Loop Speed

AS3 gives you a good number of potential ways you can loop over collections. When Flash Player 10 first came out, I went ahead and tested out the new Vector class in a variety of ways. One of them was to pit it against the collections available in Flash Player 9: Array, Object, Dictionary, ByteArray, and even BitmapData. Below I’ll show you my test and discuss its results.

Read the rest of this entry »

Tags: , , , , , ,

14 Comments