Talk:Smedia Glamo 3362
From Openmoko
Line 1: | Line 1: | ||
+ | Blitting with XsetClipMask which isnt maybe supported in hardware. But quite fast. 50 FPS but every third second there only 11 FPS. Then it went up again to 50 FPS for 2 seconds. Dont know why maybe my code is messed up. There is a hardware accelerated method of blitting. But its not easy. | ||
+ | |||
+ | Source used for testing with images (just type make for building for the freerunner): | ||
+ | http://www.easy-share.com/1911768113/myblit.zip | ||
+ | |||
+ | Faster Method: | ||
+ | METHOD 2: | ||
+ | XCopyArea(display, pixmap, window, gcxor, 0, 0, w, h, x, y); | ||
+ | XSetForeground(display, gcand, 0); | ||
+ | XSetBackground(display, gcand, ~0); | ||
+ | XCopyPlane(display, mask, window, gcand, 0, 0, w, h, x, y, 1L); | ||
+ | XCopyArea(display, pixmap, window, gcxor, 0, 0, w, h, x, y); | ||
+ | |||
+ | NOTE: pixmap = colour pixmap mask = 1 plane pixmap | ||
+ | It is pretty quick and you don't need clip masks, shape extensions etc. | ||
+ | -- Justin Kibell jck@jaguar.catt.citri.edu.au | ||
+ | |||
+ | http://www.int.gu.edu.au/~anthony/info/X/Programing.hints | ||
+ | |||
+ | ---- | ||
+ | |||
Blitting with hardware acceleration is only supported in xlib '''NOT''' in SDL. The Size of the tiles should be big. I used 128x160 in a 640x480 resolution. Speed tests: | Blitting with hardware acceleration is only supported in xlib '''NOT''' in SDL. The Size of the tiles should be big. I used 128x160 in a 640x480 resolution. Speed tests: | ||
Revision as of 14:29, 3 August 2010
Blitting with XsetClipMask which isnt maybe supported in hardware. But quite fast. 50 FPS but every third second there only 11 FPS. Then it went up again to 50 FPS for 2 seconds. Dont know why maybe my code is messed up. There is a hardware accelerated method of blitting. But its not easy.
Source used for testing with images (just type make for building for the freerunner): http://www.easy-share.com/1911768113/myblit.zip
Faster Method: METHOD 2:
XCopyArea(display, pixmap, window, gcxor, 0, 0, w, h, x, y); XSetForeground(display, gcand, 0); XSetBackground(display, gcand, ~0); XCopyPlane(display, mask, window, gcand, 0, 0, w, h, x, y, 1L); XCopyArea(display, pixmap, window, gcxor, 0, 0, w, h, x, y);
NOTE: pixmap = colour pixmap mask = 1 plane pixmap It is pretty quick and you don't need clip masks, shape extensions etc. -- Justin Kibell jck@jaguar.catt.citri.edu.au
http://www.int.gu.edu.au/~anthony/info/X/Programing.hints
Blitting with hardware acceleration is only supported in xlib NOT in SDL. The Size of the tiles should be big. I used 128x160 in a 640x480 resolution. Speed tests:
SDL: 32x32 tiles -> 13 FPS
128x160 tiles -> 3 FPS
xlib: 32x32 tiles -> 12-13 FPS (300 blits)
128x160 tiles -> 35 FPS (15 blits)
You can try it for xlib. Scale bg.png up an down. You will notice the difference. oblit is the SDL blit, xblit is the xlib blit. I think that blitting is accelerated but sending blitting commands takes to much time. So a few big blits (maybe 20 or 30) are better then 300 small ones. Link to source: [1]