Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  fastest way to draw a (mutable) bitmap?  (Read 3476 times)
0 Members and 1 Guest are viewing this topic.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Posted 2010-12-21 21:03:57 »

I'm trying to get some performance out of my emulator on Android, and found that a very large performance drain is drawing the final backbuffer to the screen.
If I don't draw the (fully rendered) image, I'm getting about 65fps, but when I draw the image (224x256), it drops to 40-45 fps. Just by drawing 1 image!

Currently, I do it like this:
1  
canvas.drawBitmap(pixels, 0, w, x, 8, w, h, false, paint);

pixels is an int[] with the 224x256 emulated image. Like I said, commenting this out gives me ~50% increase in framerate.

Any ideas to improve this?
I'm testing on an HTC Legend (I read that using Canvas is faster than OpenGL for this, although I haven't verified this myself)

Offline newera31
« Reply #1 - Posted 2011-01-01 04:14:13 »

You might want to try making the image a power of two, 256x256.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #2 - Posted 2011-01-27 22:00:10 »

Good suggestion, I'll try that.  Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 02:59:02

Norakomi (26 views)
2014-10-16 14:22:06

Norakomi (24 views)
2014-10-16 14:20:20

lcass (26 views)
2014-10-15 15:18:58

TehJavaDev (50 views)
2014-10-13 23:39:48

TehJavaDev (52 views)
2014-10-13 23:35:47

TehJavaDev (40 views)
2014-10-13 23:32:37

BurntPizza (63 views)
2014-10-11 22:24:42

BurntPizza (36 views)
2014-10-11 22:10:45

BurntPizza (76 views)
2014-10-11 21:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 21:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 21:36:02

List of Learning Resources
by Longor1996
2014-08-16 09:40:00

List of Learning Resources
by SilverTiger
2014-08-05 18:33:27

Resources for WIP games
by CogWheelz
2014-08-01 15:20:17

Resources for WIP games
by CogWheelz
2014-08-01 15:19:50

List of Learning Resources
by SilverTiger
2014-07-31 15:29:50

List of Learning Resources
by SilverTiger
2014-07-31 15:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!