Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: Software_Samurai on October 26, 2008, 08:23:09 PM

Title: "Backdrop" for viewports?
Post by: Software_Samurai on October 26, 2008, 08:23:09 PM
I'd like to suggest the following new feature(s):

1. Viewports can be assigned an image as a "backdrop".
a. A view port may be assigned an image dynamically via the WPS tag "%VX<identifier>"
    (i.e. %VXa for image a, %VXZ for image Z, etc.)
b. As a viewport is being processed and drawn, its backdrop would be drawn "first", followed by any other normal images/characters.

2. Viewport may define FF00FF as a background color, which would then be "transparent". This would allow overlapping viewports.

Opinions?
Title: Re: "Backdrop" for viewports?
Post by: JdGordon on October 26, 2008, 08:57:04 PM
1) backdrops for viewports are something that has been brought up a fwe times and I dont think there were any major objectinos to it, I tinhk the only thing against it is the amount RAM which would need to be set aside for the bitmap.

2) have you tried this? it might actually work now... hmm.. depends if the wps clears the viewport before redrawing or not.
Title: Re: "Backdrop" for viewports?
Post by: Llorean on October 26, 2008, 08:58:49 PM
I suspect that not only would the RAM cost be bad, but the added logic of having to reference the stored bitmaps for drawing each one could have a further performance hit.
Title: Re: "Backdrop" for viewports?
Post by: Software_Samurai on October 27, 2008, 07:21:08 AM
For the viewport's backdrop, I'm suggesting that the image comes from the global image pool. (i.e. %xl...) Theoretically there wouldn't be any more memory use than what could already be used. But yes, in practice I could see this feature causing people to want to use more/larger images in general.

Also, I'm suggesting adding just a bitmap pointer to the viewport struct. If it's zero, there's no backdrop assigned, otherwise, it just points to the bitmap image data.

Yes, I've tried this, and for me (and my H340) it seems to work very well. The lcd drivers get most of the code changes - especially the background "clearing" functions. I haven't noticed any significant performance impact. The only issue I've seen is that images that are called to be pre-loaded (%xl...) seem to actually get loaded only when they're actually needed the first time, so there's a noticeable delay when a viewport is first displayed.

It's really not a lot of additional code all in all.
Title: Re: "Backdrop" for viewports?
Post by: linuxstb on October 27, 2008, 07:26:17 AM
Will you post to the patch tracker?
Title: Re: "Backdrop" for viewports?
Post by: Software_Samurai on October 27, 2008, 05:56:59 PM
Maybe. I must first get permission from my employer since I'm a professional software engineer.  :-\
Title: Re: "Backdrop" for viewports?
Post by: bluebrother on October 27, 2008, 07:00:11 PM
Maybe. I must first get permission from my employer since I'm a professional software engineer.  :-\
So you did that at work?
Title: Re: "Backdrop" for viewports?
Post by: Software_Samurai on October 27, 2008, 10:00:57 PM
No, obviously not. However, since I write software for a living, my employer requires me to ask permission first.
Title: Re: "Backdrop" for viewports?
Post by: bluebrother on October 28, 2008, 02:07:19 AM
No, obviously not. However, since I write software for a living, my employer requires me to ask permission first.
???
How does your employer have the right to require permission for what you are doing in your spare time? I do write software for a living too, and my employer doesn't care if I write software in my free time -- given that I don't disclose any company / trade secrets. I also have no idea by what law it would be allowed for an employer to control your free time coding work. Heck, he could even be glad by me doing so, as doing so (naturally) improves my skills which is something he indirectly takes advantage of.
Title: Re: "Backdrop" for viewports?
Post by: linuxstb on October 28, 2008, 03:09:36 AM
I would imagine that this depends on what country you're in, what your employment contract says, and whether this was written in "free time" or not.

The GPL even includes a paragraph (search for Ty Coon) saying that "if necessary" you should get your employer/school to sign a copyright disclaimer before licensing code under the GPL.
Title: Re: "Backdrop" for viewports?
Post by: JdGordon on October 28, 2008, 03:51:05 AM
Unless you specifically signed a contract saying that anything you create while employed belongs to them (and that probably wouldn't hold up in any court in any country on the planet) then anything you do in your time with your own resources is up to you.

What some people might have is a clause saying anything patentable has to be showed to the employer to give them first option on it?
Title: Re: "Backdrop" for viewports?
Post by: Software_Samurai on October 28, 2008, 05:27:17 PM
Unless you specifically signed a contract saying that anything you create while employed belongs to them (and that probably wouldn't hold up in any court in any country on the planet) then anything you do in your time with your own resources is up to you.

Well, re-reading my employment contract, it does state that all "inventions" made by me (including software) are owned by the company I work for, regardless if said "inventions" were created outside the normal business hours, on my own PC, etc. However, the paragraph defining "inventions" does qualify the term such "... that employee learns of, possesses, or has access to through employee's employment by <company> ..." So considering that my company has absolutely nothing to do with Rockbox et.al., perhaps I'm covered here.

I know that nearly everyone here would tell me "just go ahead and don't worry about it", but please understand that my employer has, in the recent past, fired people for "working outside". Now I'm pretty sure that those fired were getting paid for their extracurricular activities (whereas I wouldn't be), but I just want to be cautious. I'm sure everyone can appreciate that.  Just let me study this a little more to be sure.
Title: Re: "Backdrop" for viewports?
Post by: safetydan on October 28, 2008, 07:55:47 PM
I've dealt with this in the past. If you're keen to work on Rockbox, ask your company for an explicit exemption for any code you write for Rockbox. Ask your HR/Personnel/Legal people for something in writing that says "Company X waives all interests in Employee Y's contributions to the Rockbox Open Source project."

It's also something to contemplate adding to any future employment contracts you sign up for.
Title: Re: "Backdrop" for viewports?
Post by: Software_Samurai on November 08, 2008, 06:16:00 PM
I've added a patch file and a patch tracker entry for everyone to check out. It's patch 9537. (http://www.rockbox.org/tracker/task/9537)
Title: Re: "Backdrop" for viewports?
Post by: Zardoz on November 09, 2008, 10:36:57 AM
Nice patch, thanks! Works fine for me. Isn't the law an ass?? I doubt very much you're bound to your employer that much that you have to disclose your private life and endeavours, code or not,  and submit it for approbation?? I'd be inclined to find a new employer if so...
Title: Re: "Backdrop" for viewports?
Post by: Llorean on November 09, 2008, 10:59:01 AM
These forums are not the appropriate place for discussing whether or not the law is "an ass." Stick to things that are objective, please.