GlowEffect behavior on mac


#1

Hi Guys,

I’m having strange issue with GlowEffect on Mac.
It’s displayed fine on Windows, but I got some weird offset on mac
like 3 or 4 pixel, so it doesn t display the bottom half part of the glow effect.

GlowEffect is not platform specific so It should be relying indirectly
to some kind of OS specific function.

Any idea where I should take a look ?

Thanks,


#2

No idea, I can’t see how it’d be any different. You sure it’s not just that it looks slightly different on your mac monitor?


#3

Unfortunately, it’s not just a slighty difference.
I tried calling repaint after setting the effect.

Is there some call that need to be done next to setComponentEffect ?

Is there any mac optim related to ConvolutionKernel ?

Thanks,


#4

No - all of that stuff is just plain old C++. Very odd - want to post some screenshots?


#5

On OSX

On Windows


#6

So what’s doing the red glow in the top-left? Are you using two glow effects?

I don’t understand this at all - is your mac PPC? I guess there might be an endianness issue there, possibly…


#7

There are only one glow effect defined like this.

juce::GlowEffect *pGlowEffect = new juce::GlowEffect();
pGlowEffect->setGlowProperties(3.f, juce::Colour(255, 0, 0));

Its on the widget containing the pad bitmap which have a border around the pad bitmap for the glow effect.

The mac is an Intel one.

After some test it looks like the glow is paint before the content of the widget.
Is that right ?

If I draw a rect instead of the pad bitmap on the whole widget size , the glow is not shown at all.
If I draw a rect instead of the pad bitmap on the whole widget size minus a border, the glow is shown.

Thanks,


#8

The glow will be drawn based on the contents of your paint call, but this is all platform-independent. Are you making sure the comp is repainted properly after it’s shown on the screen? The mac will tend to do less repainting that win32, so maybe you just aren’t repainting it after you turn on the effect?


#9

Same issue if I call repaint after calling setComponentEffect.

If the glow is based on the content of the paint function so drawn on top of what s already drawn, then is the following behavior correct ?

If I draw a rect (Colour(125, 125, 125) ) instead of the pad bitmap on the whole widget size , the glow is not shown at all.
If I draw a rect (Colour(125, 125, 125) ) instead of the pad bitmap on the whole widget size minus a border, the glow is shown all around(even on mac)

I am maybe missing something.

Thank you for your time.


#10

I think I got an hint.
It’s seems related to the way alpha blending is handled with effect.

Here is the pad bitmap with some alpha.

http://littlejourney.net/JUCE/pad.png

If I don t draw the alpha part it works fine on the mac.
If I do

g.drawImage (mpBackgroundImage.get(),
9, 9, getWidth()-18, getHeight()-18,
9, 9, mpBackgroundImage->getWidth()-18, mpBackgroundImage->getHeight()-18);

instead of

g.drawImage (mpBackgroundImage.get(),
0, 0, getWidth(), getHeight(),
0, 0, mpBackgroundImage->getWidth(), mpBackgroundImage->getHeight());

9 being the size of the alpha blended border.

Hope this helps.

Thanks,


#11

I can imagine that the alpha would make some difference to the effect, but it should still be the same on both platforms…


#12

Of course, It’s just that it might give you some hint if the way the alpha is handled is different on osx and windows.

Thanks


#13

Well no - alpha is all handled the same way. There must be something else you’re doing!


#14

Humm I think I’ve misunderstood something.
The glowEffect is not only on the round of the widget ?


#15

The “round”? You mean the edge? No, it’s just like a coloured blur that sits behind the whole image.


#16

oki doki.
I misunderstand the way it works.
But in my case it should be the same.


#17

I’ve used it quite a few times on mac/pc and it’s always been just the same…


#18

I let you know if I find something.

Thanks,


#19