Paint MAC vs. Windows

Discussion and support for general JUCE issues

Paint MAC vs. Windows

Postby Joerg Koehler » Sun Mar 20, 2011 7:30 pm

Hi,

I have 2 questions about Component::paint in juce you may would answer.

I am about optimizing my code to minimize repainting where I have setOpaque to true for
several components i.e. sliders and listboxes. Then I put a DBG statement into its parent
paint methode to see whether that method gets called or not.
I noticed 2 things here that I don't understand:

1)
On MAC:
The parents paint method get called if I set the slider value of one slider with the value of
another one using slider2->setValue(slider1->getValue(), false, false) but if I don't link those two slider and
simply drag a single slider, then it doesn't get called.
Same thing if I update a progressbar with a slider value. The progressbar is opaque but the parents
paint methode still get called. Why is that?

On Windows:
Doesn't matter what I do here, the parent paint methode doesn't get called with
linked sliders and not while dragging a single slider and even the progressbar
doesn't affect the parent paint method (That is what I have expected...)!

2)
The CPU usage of the MAC version of my plugin is about 10% higher than the Windows version.
Is this normal and if yes, could it be related to the above issue?

Thank you for your help!

Joerg
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Tue Mar 22, 2011 9:53 pm

Nobody can answer?

It really makes me nervous cause I don't understand why
the 100% same code gives such differences on MAC and Windows!

From my understanding MAC, does not support setOpaque but then it would always
process the paint method of the underlaying component and that would create
a CPU overhead, wouldn't it?

...unless I am totaly wrong!
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby jules » Wed Mar 23, 2011 10:00 am

The way individual components repaint is 100% platform-independent. If there's any difference at all, it must be the region that the OS is asking to be repainted - e.g. http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=5820
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Wed Mar 23, 2011 12:09 pm

Seems that I hit the same problem with the core graphics...
I did lot's of things to optimize. I even tried setBufferedToImage w/o success.
The overall graphic performance on MAC is worse than Windows and since I hit this
setTiledImage issue some weeks ago, I don't trust in core graphics anymore so
I'll give your software renderer a go tonight.

Thank you, Jules!
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Wed Mar 23, 2011 8:04 pm

Don't know why people always trying to tell me that MAC is the better solution
for any kind of graphic work if the guys from Apple aren't able to write a propper
graphics renderer. :-)

You should sell your software renderer to apple, Jules.
Works much better now, thank you for the hint!

Joerg
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Thu Mar 24, 2011 3:47 pm

Jules,

using juce graphics renderer has improved rendering alot but there is one thing
I got faced with:

I changed the scroll direction on my Macbook Pro accordingly to my Android phone (I guess same as iPhone)
but that change has no effect using your graphics renderer if I run my app standalone (there are some listboxes
inside that scroll the opposite direction to what the "hacked" OS does if I use your renderer!).

Running it inside a host works the same direction like the OS.

Is there a flag to correct that?

Joerg
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby jules » Thu Mar 24, 2011 3:50 pm

I don't understand.. what's the connection between scrolling and the renderer?
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Thu Mar 24, 2011 4:10 pm

Can't answer that. The only thing I noticed is that since I use your renderer, it doesn't not
scroll along the "hacked" scroll direction of the OS anymore. It seems that your renderer
is not following the OS scroll direction or at least is ignoring the hack.
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby jules » Thu Mar 24, 2011 4:49 pm

No, you're getting confused there - the scroll wheel events have no connection whatsoever with the renderer. You must be misinterpreting something else that you've changed.
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Fri Mar 25, 2011 10:45 am

Okay, you're right! It has nothing to do with the renderer but the problem remain and it appears if I compile
standalone in release mode. Everything is fine in standalone debug mode.
I am for 100% sure that I am NOT touching anything that could create that effect!

The vst plugin version works fine in both, release and debug mode!
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm

Re: Paint MAC vs. Windows

Postby jules » Fri Mar 25, 2011 12:21 pm

There's nothing in the library that could possibly reverse the scroll-wheel - it must be the OS that's changing its behaviour. Perhaps the OS is deciding whether that feature should be enabled on an app-by-app basis?
User avatar
jules
Fearless Leader
 
Posts: 17192
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Paint MAC vs. Windows

Postby Joerg Koehler » Fri Jun 10, 2011 3:45 pm

The scroll reverse problem has been fixed by using a different scroll reverser.
Thanks god, Lion will have it built in...

Joerg
User avatar
Joerg Koehler
JUCE UberWeenie
 
Posts: 218
Joined: Mon Jan 11, 2010 5:58 pm


Return to General JUCE discussion

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests