0
votes

I draw map tiles in a custom SurfaceView. One map tile is 256x256. The map is multitouch zoomable. When the zoom is 1:1, the map tile bitmaps need not to be scaled and I have about 60 FPS on Nexus One with Android 2.3.3. When the zoom is different, bitmaps are drawn scaled and I have about 35 FPS. How can I increase the FPS? I draw bitmaps with Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint). My paint is set to scale bitmaps smoothly.

1

1 Answers

1
votes

This sounds like something for a game. I've never done any game development on Android, so this should be taken with several grains of salt, but...

Maybe you could generate pre-scaled versions of your tiles in advance, for different zoom levels, and thus minimize the need for scaling during the actual game (or whatever you're building)? So you accept the drop in FPS during the actual zoom operation, but as soon as the user is done zooming, you select (or generate) the appropriate tile set and goes back to drawing un-scaled content.