Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TheEndless
Channel Surfer

Re: How does DrawScaledObject() reduce images?

"NewManLiving" wrote:
By the way this grid is a perfect example
Of observing the texturemanagers lru
Caching. Textures initially pop in nicely
But with repeated scrolling they literally
Melt in at fast speeds although there is
No difference in the number released and
The number requested at any given time

Not to go too far off-topic, but have you tested it with an roVideoPlayer playing at the same time? In my experience, the roTextureManager is virtually useless when used along side video playback. You can implement your own LRU cache to compensate, but that negates 75% of the benefits that roTextureManager provides. The single-threadedness of BrightScript just makes it all that much worse (i.e., pauses in rendering while updating the custom LRU cache).
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)
0 Kudos
NewManLiving
Visitor

Re: How does DrawScaledObject() reduce images?

Sorry to have gone off topic myself

Yes the TextureManager takes a back seat when roVideoPlayer is active. Seems to be allocating all available resources to the player. Ironically this is how I tested the grid. After starting a video I would return to the grid and then scroll fast to make sure each cell was updating properly when the texture arrived. Since the lru was scrapped I was able to see the re-popping in of each requested texture :D. So I will not be using anything TextureManager intensive along side the video. But in relation to the grid it is phenomenal. Once I learned how to use it and then taking advantage of everything built-in to the 2D ( as apposed to doing things in BS ) such as regions and yes, the compositor, I was able to produce a grid in function and quality as the stock grid, but customizable. I use a region to fade the scrolled out rows to mimic the new Netflix interface. Performance wise there is no perceptible difference on the three environments that I own. The 3, 2xd and the stick. Although the 2xd and stick have an occasional flicker at the bottom of the screen, suspect it has something to do with refresh rates. It does not happen often and is not really an issue for me. Maybe you can shed some light on this. As far as legacy boxes I don't know. I tried using only bitmaps, just the screen, etc so that I could put out an example for those who don't like compositors, sprites, and regions, but performance was good but differential on the lower end boxes with some processor lag. I was able to alleviate this by removing all DrawText calls and making the labels bitmaps and removing all alpha blends that rode above the grid such as the cell counter. But I was not satisfied. By returning to my tried and true method, performance was the same on all the three environments. But I only have the 3 to test on so that is all I can provide. So far I am very impressed with it. But it is new and probably I will encounter minor problems (leaving it to you to point them out). I just popped it into a theme based framework for a client and its looks and works great.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
RokuJoel
Binge Watcher

Re: How does DrawScaledObject() reduce images?

FYI - DrawScaledObject is generally going to be faster than using roTextureManager to scale images as the hardware does the scaling, where roTextureManager implements scaling in software. The one place where you will probably want to use roTextureManager to scale is when you have images larger than 2048x2048 that you want to use as an roBitmap source.

- Joel
0 Kudos
EnTerr
Roku Guru

Re: How does DrawScaledObject() reduce images?

"RokuJoel" wrote:
FYI - DrawScaledObject is generally going to be faster than using roTextureManager to scale images as the hardware does the scaling, where roTextureManager implements scaling in software.

Interesting. Shed some light on the original questions, RokuJoel:
  • What's the scaling mode used by ifDraw2D.DrawScaledObject()? (E.g. is it nearest-neghbour or bi-linear)

  • The meaning of ifRegion.SetScaleMode() - is 0=nearest-neighbour and 1=bi-linear?
0 Kudos
TheEndless
Channel Surfer

Re: How does DrawScaledObject() reduce images?

"NewManLiving" wrote:
Although the 2xd and stick have an occasional flicker at the bottom of the screen, suspect it has something to do with refresh rates. It does not happen often and is not really an issue for me. Maybe you can shed some light on this.

Yep. That sounds like you have bitmaps being disposed while you're mid-screen draw. It's a known issue with the Roku 2 XD/XS and Streaming Stick (At least known to us in the forum. Roku hasn't acknowledged it.) See this thread where Enterr and I narrowed it down to the cause: viewtopic.php?f=34&t=54513&p=438741#p438058
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)
0 Kudos
NewManLiving
Visitor

Re: How does DrawScaledObject() reduce images?

After I posted I remembered what you said about bitmap.finish
I had not used it since I never had any problems on the 3 box
So I "assumed" that compositor.drawall must do all the work
But after placing it back into the code I have not noticed any
Flicker. It's been two days and I have been scrolling away
So possibly that may have solved the problem. You are a
Treasure Chest of experience! Thanks
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos