NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 11 12 13 14 15 93 Next »
More "efficient" redraw?

 
  • 0 Vote(s) - 0 Average
More "efficient" redraw?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,134
Threads: 957
Joined: May 2006
#21
2011-12-29, 08:43 PM (This post was last modified: 2011-12-29, 09:08 PM by mvallevand.)
ccnb, may be your right, I noticed I have a line in the GetRenderList() that returns this
Code:
if (isActivated == false)
            {
                return new List<UiElement>();
            }

isActivated is set false by my popup code.

Martin
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#22
2011-12-29, 08:44 PM
Ok, but why is GetRenderList() on the plugin screen being called when NeedsRendering() for the plugin is returning false?
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#23
2011-12-29, 09:03 PM
cncb Wrote:Ok, but why is GetRenderList() on the plugin screen being called when NeedsRendering() for the plugin is returning false?
Probably because the screensaver is returning true from it's NeedsRendering(). Like the default one when it animates.
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#24
2011-12-29, 09:17 PM
sub Wrote:Probably because the screensaver is returning true from it's NeedsRendering(). Like the default one when it animates.

I changed my popup/screensaver to always return false for NeedsRendering() but GetRenderList() on the popup/screensaver is still called multiple times per second so I think there might be an underlying problem here...
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#25
2011-12-29, 09:32 PM
Given it's working for others, I'm inclined to think it will something that is being done in this plugin or screensaver, but I'm happy to take a closer look if you can provide the binary files for me to reproduce it here - without me having install extra apps on my development machine (which is currently nice and clean after a fresh Windows install on a new drive).
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#26
2011-12-30, 09:55 PM
I think I have finally narrowed this down. It seems to be the black background in the popup causing it. The attached simple example plugin shows a popup with a black background when you select the single list item. I have NeedsRendering() for the popup always returning false. It sits there for several seconds not updating the time text and then all the sudden the time text is updating every second and GetRenderList() is called multiple times per second as can be seen in the log file. If I don't add the black background in GetRenderList() then this GetRenderList() call flurry never seems to occur.

I can post the whole project with source if you want. Here is how I am creating the black background/UIElement (as you suggested I do it when I asked a while ago):

Code:
Bitmap black = new Bitmap(32, 32);
Graphics g = Graphics.FromImage(black);
g.Clear(Color.Black);
g.Dispose();
_Black = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black, 255);
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#27
2012-01-09, 08:06 PM
Is that code in your GetRenderList()?

Try defining "_Black" as a global variable. When you need the background, set a variable to true ("_needsBlack" for the purposes of this example).

Then modify the above code with:

Code:
if (_needsBlack)
{
  if (_Black == null)
  {
    Bitmap black = new Bitmap(32, 32);
    Graphics g = Graphics.FromImage(black);
    g.Clear(Color.Black);
    g.Dispose();
    _Black = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black, 255);
  }
} else if (_Black != null)
{
  _Black = null;
}
Currently, it seems that you are creating and disposing the bitmap whenever you need to render _Black.
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#28
2012-01-09, 08:20 PM
whurlston Wrote:Is that code in your GetRenderList()?

Try defining "_Black" as a global variable. When you need the background, set a variable to true ("_needsBlack" for the purposes of this example).

No, '_Black' is a class member variable and the code above is from the constructor so it is not being created multiple times.
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#29
2012-01-09, 08:44 PM
Ah, then ignore everything I just said. Can you post the source to that test plugin?
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#30
2012-01-09, 09:36 PM (This post was last modified: 2012-01-14, 07:23 PM by cncb.)
whurlston Wrote:Can you post the source to that test plugin?

Attached
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (6): « Previous 1 2 3 4 5 6 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to force redraw? Wakalaka 3 1,788 2007-03-27, 09:58 AM
Last Post: psycik

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode