So I am trying to do all I can to increase the FPS on one my games. When trying to draw a bitmap to the background of a canvas, and then call unlockAndPost() on that canvas the fps rate goes down about 30% So I am trying to work with the lockCanvas(dirtyRect) function, but it doesn't seem to behave the way I would think it should.
It seems as though this function works, but it is just about useless because of the double buffer nature of the surfaceHolder, ie i can redraw an area on one buffer, but because it only invalidates one of the buffers some artifacts are seen when the next buffer draws. Here are the posts describing the double buffer nature of surfaceHolder, but they don't seem to answer my question - http://groups.google.com/group/android-developers/browse_thread/thread/d50375a97fd07b2e/8d1243c33f9b7b6e?lnk=gst&q=surfaceView#8d1243c33f9b7b6e - http://groups.google.com/group/android-developers/browse_thread/thread/a2aac88a08cb56c2/11bcf25487ee924f?lnk=gst&q=lockCanvas#11bcf25487ee924f and this posts mentions the exact same problem I am having but doesn't have a solution posted - http://groups.google.com/group/android-developers/browse_thread/thread/7080da8c9a2b1f72/ac41fbaadab6d3b9?lnk=gst&q=lockCanvas#ac41fbaadab6d3b9 So my question is, what am I doing wrong? Is there a reason why calling unlock and Post on a canvas that has a bitmap drawn on 70% of the background get drawn slower than a canvas that just wipes the screen clear with a call to drawColor(color)? What is the proper way to call locakCanvas(dirtyRect) so that both buffers are updated? thanks for any answers, suggestions, or pointers ---snctln www.snctln.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---