Forum Topic - Photon performance slow when using PtRealizeWidget for PtWindow widgets: (16 Items)
   
Photon performance slow when using PtRealizeWidget for PtWindow widgets  
I have an application that builds PtWindow Widgets at Start up and then uses PtRealizeWidget and PtUnrealizeWidget to 
switch between the PtWindow widgets.  When the "Window" is realized, I update the contents of the widgets within the 
window.  Sometimes it is very slow when switching from one Window to another.  I am using PtHold and PtRealease, but in 
some cases it is still really slow. Is there anything I can do to speed up the switching of windows?

Thanks
RE: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
Move it to negative coordinates, then back on the screen when you need
it, instead of using PtRealizeWidget and PtUnrealizeWidget.

-----Original Message-----
From: Ronald Mich [mailto:community-noreply@qnx.com] 
Sent: Thursday, August 27, 2009 1:34 PM
To: photon-graphics
Subject: Photon performance slow when using PtRealizeWidget for PtWindow
widgets

I have an application that builds PtWindow Widgets at Start up and then
uses PtRealizeWidget and PtUnrealizeWidget to switch between the
PtWindow widgets.  When the "Window" is realized, I update the contents
of the widgets within the window.  Sometimes it is very slow when
switching from one Window to another.  I am using PtHold and PtRealease,
but in some cases it is still really slow. Is there anything I can do to
speed up the switching of windows?

Thanks



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post36811
Re: RE: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
I added the following snippets of code:

PhPoint_t show;
PhPoint_t hide;

hide.x=-640;
hide.y=-480;

show.x=0;
show.y=0;

  /* create a window */

hideWindow()
{
//  PtUnrealizeWidget(window);
   PtSetResource( window, Pt_ARG_POS, &hide, 0 );
}

showWindow()
{
//  PtRealizeWidget(window);
   PtSetResource( window, Pt_ARG_POS, &show, 0 );
}

But hideWindow() would not remove the window from the display.

Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
Is there a performance difference when the mouse pointer is on top of your windows vs. when it is not?
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
My application has no pointer device, just buttons.  I switch from one window to anaother based on a button press.
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
Does your application create a lot of regions? (use phin to check)
How many widgets do you have in your windows?
What kind of widgets?
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
It looks like I have about 26 regions.
Typically there may be about 50 widgets per window.
About 30 of the widgets are PtLabel.
About 15 are PtText.
And there may be five or less PtList. 
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
This amount of widgets looks normal to me. Do you have complex setup functions or realize callbacks that may take a long
 time to execute?
I would be able to take a closer look if you send a sample app that shows the problem. You can email directly to me 
(mnefedov at qnx.com).
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
What CPU and graphics controller are you using?

I wonder why hiding the window would not work. I supposed this kind of off-screen area should always be available. Or is
 it dependent of pwm running? Is it present on your system?


- Malte
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
My CPU is the St Miccro STPC Atlas with a built in Display Controller.  I am not running pwm.  It there anything special
 about PtWindow, that might keep me from setting negative coordinates?  Here is how I create the widget:

   size.h=480;
   size.w=640;

   hide.x=-640;
   hide.y=-480;

   show.x=0;
   show.y=0;

  /* increase the draw buffer */
  PgSetDrawBufferSize( 0x8000 );
  /* create a window */
  PtSetArg( &arg[0], Pt_ARG_POS, &hide, 0 );
  PtSetArg( &arg[1], Pt_ARG_DIM, &size, 0 );
  PtSetArg( &arg[2], Pt_ARG_WINDOW_RENDER_FLAGS, Ph_WM_RENDER_ASAPP, 0); 
  window = PtCreateWidget( PtWindow, Pt_NO_PARENT, 3, arg );

Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
> My CPU is the St Miccro STPC Atlas with a built in Display Controller. 

Maybe you could ask QNX for a quote that would give you a graphics driver tweaked for your scenario... this would come 
at a cost, of course.

> I am 
> not running pwm. 

Then run it, and try if negative coordinates now work (someone from the Graphics group could confirm that pwm must be 
running for this to work...)


- Malte


Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
When I run PWM the window shrinks, and the title bar displays, which I did not want.  I don't see any way of removing 
the title bar.

Negative coordinates still do not work.

I thought, however, if I could remove the title bar I might be able to use some of PWM's features.
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
The window should not shrink when you run PWM. You can turn-off the title bar, check the Pt_ARG_WINDOW_RENDER_FLAGS.
I would like to get a small sample app that shows the problems you are having.
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
Thanks for the info.  The windows are now being rendered correctly.  I think the problem that I am seeing is that I use 
a label with a JPEG Image as a child of the window (the same size as the window).  When I Realize the window, you can 
see the image being painted from the top to the bottom.  Any suggestions to make the Image paint faster?
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
When you load your *.JPEG image via PxLoadImage() make sure that you load your image into shared memory. PxLoadImage() 
doc has an example.
Re: Photon performance slow when using PtRealizeWidget for PtWindow widgets  
Thanks.  That was just the thing I was looking for.  It's a great deal better now.