hsrad
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
01:26 PM
roImageCanvas and roScreen
Is it wrong to try to have roImageCanvas and roScreen at the same time? I want to use roImageCanvas for parts of the screen that has static text and image and roScreen for the more complex part of the screen.
If that is fundamentally wrong, then how bad is using DrawText? SDK docs say they should not be used extensively
If that is fundamentally wrong, then how bad is using DrawText? SDK docs say they should not be used extensively
9 REPLIES 9

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
01:30 PM
Re: roImageCanvas and roScreen
You can't mix the two, unfortunately. If you have static text, you could draw it to a bitmap once, then draw that bitmap to the screen on subsequent updates.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
01:55 PM
Re: roImageCanvas and roScreen
DrawText is more expensive than DrawObject, but you shouldn't assume that you should avoid it all costs. It's certainly feasible to do DrawTexts on every frame, even in an app with animation. I would use DrawText initially and determine based on performance whether you need to optimize it.
--Mark
--Mark

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
02:09 PM
Re: roImageCanvas and roScreen
If the text is REALLY static, you could actually make it into an image instead (ahead of time, on your own), and just draw the image
hsrad
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
03:57 PM
Re: roImageCanvas and roScreen
It's not REALLY static. It's updated every 10 mins with a web service call
hsrad
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015
04:02 PM
Re: roImageCanvas and roScreen
"RokuMarkn" wrote:
DrawText is more expensive than DrawObject, but you shouldn't assume that you should avoid it all costs. It's certainly feasible to do DrawTexts on every frame, even in an app with animation. I would use DrawText initially and determine based on performance whether you need to optimize it.
--Mark
I need to render about 30 words every 3 seconds. What's the threshold of "too many" drawText calls?

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2015
02:33 AM
Re: roImageCanvas and roScreen
It will be a matter of opinion and how smooth you want everything to be. Drawing 30 words might hurt performance on older Rokus, depending on what else you're doing at the same time. If you set it up and see that it's unacceptable, you can try TheEndless' approach to help speed it up.

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2015
05:07 AM
Re: roImageCanvas and roScreen
from what I have seen drawtext does not have as much of an impact on open gl devices. On those without you have to be careful. ( the recent scrolling list example demonstrates that). However for occasional updates and depending on how much animation will be taking place along with the text update I would not expect a performance hit
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2015
01:08 PM
Re: roImageCanvas and roScreen
"hsrad" wrote:
I need to render about 30 words every 3 seconds. What's the threshold of "too many" drawText calls?
It's fairly high. Last year in my 2048 i was getting 30 fps on the oldest Rokus (fw3) and 60 fps on the 3k platform. I.e. the board and its contents are re-drawn at least 30 times per second, including cell numbers are DrawText-ed each frame - meaning that yes, 150 characters per second shouldn't be a problem even on the slowest device.
"TheEndless" wrote:
You can't mix the two, unfortunately. If you have static text, you could draw it to a bitmap once, then draw that bitmap to the screen on subsequent updates.
Has that been tested, that they are absolutely, positively "immiscible"?
I mean, i was so sure that one cannot show a roMessageDialog on top of a roScreen till dev42 showed us that "yes, you can". And recently i got the feeling that most ro-components were (or should have been) implemented internally via roImageCanvas.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2015
01:34 PM
Re: roImageCanvas and roScreen
"EnTerr" wrote:
Has that been tested, that they are absolutely, positively "immiscible"?
I mean, i was so sure that one cannot show a roMessageDialog on top of a roScreen till dev42 showed us that "yes, you can". And recently i got the feeling that most ro-components were (or should have been) implemented internally via roImageCanvas.
roMessageDialog is a different animal, as it's actually intended to be drawn on top of other screens, but I can't get that to work either (it blacks out the roScreen for me), and dev42 even states that key presses don't get sent predictably. But, to answer your question, yes I've tested it, and roImageCanvas and roScreen definitely don't work together.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)