tberthel wrote: [...] > 25fps is actually really > fast, but like you said it is just a single test image.
25fps is fine --- it's just that it's using all the CPU time redrawing and there isn't any left to run the game in! > As far as speeding things up the most important thing is to reuse the > Bitmap object and not create one each frame. I assume you are already > doing that given your getting 25fps. Not much other than that is > going to dramatically increase performance. If you follow Google > performance advice document you are doing just about everything you > can do. Yes, we're reusing the Bitmap object. I hadn't found the performance advice document yet --- I'm having a look. Ta. One alternate approach I've been thinking about is ditching the use of Bitmap completely. If we instead use GLES, displaying a single polygon that fills the screen, we can change the image by uploading new textures with glTexImage2d. (This is a very common approach to doing this kind of thing on higher end machines.) This has a number of possible advantages: it completely bypasses the compositing layer (hopefully!) and provides expedited access to the screen, we get format conversion and scaling for free (as we'd rather use 16bit than the 32bit that Bitmap insists on), we get to exploit the hardware on any devices that have it, it better fits our code path as we might have to use GLES in places *anyway*, and the Java implementation of glTexImage2d takes the pixel data as a Buffer which means we get to use direct buffers, which is ideal for our purposes. However, whether this is actually going to be faster in practice is another matter. > Remember the first arcade games that sold millions of copies only got > 5-7 fps. Unfortunately those games would be unlikely to sell millions if the same game ran *on a lower spec phone* at ten times the frame rate as on an Android phone... -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ "I have always wished for my computer to be as easy to use as my │ telephone; my wish has come true because I can no longer figure out │ how to use my telephone." --- Bjarne Stroustrup
signature.asc
Description: OpenPGP digital signature

