MaginifierComponent/Software renderer problem


#1

There’s something terribly wrong with either MagnifierComponents or the softwarerenderer in the tip. I have an old app I had to brush up to mess with, and what I find is that the Mac performance is ‘OK’ now, albeit very nice looking, but the performance when a magnifier is visible and not at 100% is truly awful - like 5 seconds to redraw a single button that’s not even in the view.

I’ve tried to profile, and EdgeTables on the whole stand out, but the main clue is when it gets sluggish I can literally pause in the xcode debugger, and time after time, end up in EdgeTable code, notably a stack that starts with invalidating a rect, and ends with regenerating an EdgeTable (passing through the LowLevelSoftwareRenderer, it looks like).

I will try as soon as I can, but I’d guess any addition of a magnifier will expose this.

Bruce


#2

This sort of thing, but also other EdgeTable functions.
Note:
[list]Code used to work
Fixed everything to come up to tip, full clean on project and juce lib
Works fine at 100% zoom[/list]

Bruce


#3

Thanks, I’ve not tried the magnifier since I updated everything, I’ll have a go and do some debugging.


#4

Any clue on this? Maybe a workaround?

Bruce


#5

Haven’t looked yet, sorry. Will do as soon as I get a chance.


#6

Just tried this on my mac, with both rendering engines, and performance seems absolutely perfect… I might have changed something since you tried it, so maybe try the tip again and see if it’s magically fixed?


#7

BTW I should mention I was using the Jucer’s zoom as a test - you might want to compare that with your code.

And I did find one minor bug, but it’s just because the mac renderer wasn’t getting flushed correctly when zoomed out, and isn’t related to what you’re talking about.


#8

Bugger. No, no tip/clean magic.

I did borrow heavily from jucer when I made this code, but you’re right, the jucer seems fine.

So let me see. I have:

Window
Tabbed Component
Viewport subclass whose content view is a magnifier subclass,
which is holding a fairly innocuous workspace component,
which has children

So, that seems like a fairly typical arrangement, if not exactly what the jucer has. I’ll have to go back through and see. I can’t see what the hell it would be. I tried with Instruments, and just get graphics things - mostly edgetable stuff up top, but I can’t find much to turn off and fix it. Only zoom at 100% is the instant fix.

Bruce


#9

OK, so I have ‘solved’ my Maginfier problem - it was essentially an amount of components problem - my code was accidentally creating scores of extra overlay components. They were all drawing right on top of one another, so it was hard to tell. That extra drawing seem to ruin the magnifier when at a zoom ratio.

With that removed, magnfiers seem to be predictably a ‘bit slower’ but workable.

Bruce