{"id":160,"date":"2008-01-09T19:42:00","date_gmt":"2008-01-09T17:42:00","guid":{"rendered":"http:\/\/www.thelins.se\/johan\/blog\/2008\/01\/accelerating-shapes\/"},"modified":"2008-01-09T19:42:00","modified_gmt":"2008-01-09T17:42:00","slug":"accelerating-shapes","status":"publish","type":"post","link":"https:\/\/www.thelins.se\/johan\/blog\/2008\/01\/accelerating-shapes\/","title":{"rendered":">Accelerating Shapes"},"content":{"rendered":"<p>>Since <a href=\"http:\/\/www.bitsim.com\/badge.htm\">BADGE<\/a> supports quite a few of Qtopia\u2019s basic shapes, we\u2019ve spent some time implementing everything we can think of. Combining this with the verbose driver, we can also tell exactly what the problem is. There are lots of rocks to turn and quite a lot of easy to reach fruit. However, the purpose of the work (for now) is really to do a feasibility study and to lay down the foundation for future work. I interpret this as show that acceleration is possible and pays off, but don\u2019t fix all the details right now.<\/p>\n<p>One frustrating part right now is that the Qtopia demos from Trolltech tend to use quite a lot of complex features to get cool looking graphics. This can be accelerated, but one has to be aware of how things work. For example, when using gradients and painter paths it is always good to pre-render this to a QPixmap and then blit it repeatedly to the screen. This keeps down the data transferred pixel-by-pixel between the CPU and GPU as we can buffer pixmaps in the graphics memory and blit them by passing a few control bytes between the processors.<\/p>\n<p>The good news is that we can see a real increase in performance when accelerating operations. The problem is really the huge wealth of combinations available. Looking at the svgalib-based the driver we can see that the ability to accelerate depends on a number of parameters:<\/p>\n<p>\u2022   <span style=\"font-style: italic;\"> pen <\/span>\u2013 keep it simple, one pixel wide.<br \/>\u2022   <span style=\"font-style: italic;\"> brush<\/span> \u2013 simple solid fill, we do support transparency, but not gradients and such.<br \/>\u2022   <span style=\"font-style: italic;\"> transformations <\/span>\u2013 stick to translation. It would be possible to scale some shapes, but not pens unless they are decorative (i.e. always one pixel wide).<br \/>\u2022   <span style=\"font-style: italic;\"> clipping <\/span>\u2013 clip to a single rectangle. This means that you have to avoid having rounded corners on your windows. (Our driver actually cheats and uses the boundingRect of the clip region \u2013 dangerous but rewarding).<br \/>\u2022   <span style=\"font-style: italic;\"> aliasing <\/span>\u2013 avoid anti-aliasing, it makes things difficult. For example, we need to ensure that BADGE and Qtopia uses the same anti-aliasing algorithm.<br \/>\u2022   <span style=\"font-style: italic;\"> composition mode <\/span>\u2013 complex blending is supported by the BADGE blit engine, but we\u2019ve not spent time to let Qtopia utilize this.<\/p>\n<p>No screenshots today, but I can tell you that I\u2019m compiling <a href=\"http:\/\/qwt.sourceforge.net\/\">Qwt<\/a> right now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>>Since BADGE supports quite a few of Qtopia\u2019s basic shapes, we\u2019ve spent some time implementing everything we can think of. Combining this with the verbose driver, we can also tell exactly what the problem is. There are lots of rocks to turn and quite a lot of easy to reach fruit. However, the purpose of &hellip; <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2008\/01\/accelerating-shapes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">>Accelerating Shapes<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":0,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}