|
2012-03-07
, 20:49
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#382
|
|
2012-03-07
, 20:51
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#383
|
setAttribute(Qt::WA_Maemo5NonComposited);
setAttribute(Qt::WA_OpaquePaintEvent, true);
|
2012-03-07
, 21:32
|
Posts: 306 |
Thanked: 603 times |
Joined on Jan 2012
@ Belgium
|
#384
|
Did you add sound support for the n900?
Because in my game i can not heard anything and sound support still is on your todo list
The Following User Says Thank You to DavyP For This Useful Post: | ||
|
2012-03-07
, 21:40
|
Posts: 306 |
Thanked: 603 times |
Joined on Jan 2012
@ Belgium
|
#385
|
@DavyP: There are 2 things you can try to increase performance. Search in Qt documentation for their effect.
First one is Fremantle specific, In your MainWindow constructor (in the same #ifdef..#endif block where WA_Maemo5AutoOrientation lives, place:
that may cause flickering, but I hope that won't happen, as you are double-buffering (AIUI)Code:setAttribute(Qt::WA_Maemo5NonComposited);
Second tweak should work in both Fremantle and Harmattan, in your MainWindow constructor place:
As you are repainting the whole widget area, there is no need Qt to draw the background first.Code:setAttribute(Qt::WA_OpaquePaintEvent, true);
BTW I found a bug in your build using WA_Maemo5AutoOrientation:
If you enable "Enable portrait mode" in MIDlet Settings, then window appears rotated 90 degrees (shows landscape when in portrait and vice versa)
Hope the above will help you a bit, thanks a lot for your work, keep it that way
|
2012-03-07
, 22:01
|
Posts: 306 |
Thanked: 603 times |
Joined on Jan 2012
@ Belgium
|
#386
|
The Following User Says Thank You to DavyP For This Useful Post: | ||
|
2012-03-07
, 22:22
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#387
|
I added the above two tricks and used both JBenchmark and
JBenchmark2 to measure the performance improvement, and I get
overall scores that are up to 8% higher than without the two tricks. Not
world shocking, but a nice improvement nonetheless.
Davy
The Following User Says Thank You to freemangordon For This Useful Post: | ||
|
2012-03-07
, 22:41
|
Posts: 306 |
Thanked: 603 times |
Joined on Jan 2012
@ Belgium
|
#388
|
Sounds pretty enough for 2 lines of code . And have in mind those affect only graphics.
EDIT:
non-compositing should have bigger effect in fullscreen
The Following 2 Users Say Thank You to DavyP For This Useful Post: | ||
|
2012-03-07
, 22:57
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#389
|
Yes, if I would get an average 5% performance improvement
for every two lines I add, I am willing to add even more lines like that :-)
BTW, I ran the benchmark in full screen. Perhaps to low
improvement is due to the fact I emit a Qt4 signal to trigger for
every midlet window update, and perhaps Qt4 is smart enough to
coalesce repaint events. Also note that the JBenchmarks probably
measure more than just the rendering speed.
Davy
The Following User Says Thank You to freemangordon For This Useful Post: | ||
|
2012-03-07
, 23:22
|
Posts: 306 |
Thanked: 603 times |
Joined on Jan 2012
@ Belgium
|
#390
|
I have no idea how is your painting structured, but if you do a full QPixmap paint for every midlet window update, then it might be a good idea to set some clipping when painting the pixmap, that should boost the performance significantly (not that it is slow now, but you know, as Pooh says...)
Because in my game i can not heard anything and sound support still is on your todo list