Skip to main content
August 7, 2013
Question

performance tweaking - Rasterizing edges question

  • August 7, 2013
  • 2 replies
  • 4352 views

I am trying to profile my game (using Adobe Scout) and the vast majority of the execution time is spent in 'DisplayList Rendering > Raterizing edges'.

My game consists mainly of a large background bitmap drawn with smoothing enabled - with other stuff drawn ontop. As a player moves around the map, I alter the ScrollRect on the bitmap to draw only the region within the bounds of the stage.

From what I'm seeing, it appears as though when I move the scrollRect that flash is spending a lot of time 'rasterizing edges'. It performs much better if I set the stage quality to low, which suggests that the bitmap is being processed/smoothed whenever I move the scrollRect.

Am I right in thinking this is not necessary? Surely the bitmap can be drawn once with smoothing enabled (it doesn't change) and then can be moved around the screen without the need for any rasterization?

Is there something I can do about this?

This topic has been closed for replies.

2 replies

sinious
Legend
August 7, 2013

Have you attempted to simply move the bitmap itself without any masking? It's still fully in memory with scrollRect and there may be some behind the scenes optimizations to clip edges of the display (auto viewport culling). I haven't tried this myself but I'm curious. I'm sure loading a 4096x4096 (ATF of course) and panning it around would easily reveal which is faster.

edit:

He always beats me . A larger scrollRect is a good idea as well. It would cut down on the rect changes drastically.

To throw a bone in there, not ideal but if it's really large textures you might want to consider handing the job to Stage3D.. Starling could easily offload all that work. I still blit in one application but every time I releave the CPU and stop blitting it makes the entire application feel much faster.

August 7, 2013

I've tried without any ScrollRect and the performance seems to be slightly worse unfortunately.

In regards to blitting, do you mean creating a bitmapData object the size of the stage and on each frame populating the bitmapData with copyPixel calls?

kglad
Community Expert
Community Expert
August 7, 2013

yes.

kglad
Community Expert
Community Expert
August 7, 2013

skip to displaylist rendering: http://www.adobe.com/devnet/scout/articles/understanding-flashplayer-with-scout.html

to get better performance, you should consider blitting or, at least, partial blitting.