Ive been getting reports that my 2012R2 Cocoa builds are unstable from a few users.
Switching them back to Carbon app built with 2009 sorts that out.
They all seem to have 10.8.4 in common. I noticed I was on 10.8.2, so I downloaded 10.8.4
Then I figured I would build a Carbon version from my current code, and see if that stabilised things.
OMG. Its dead in the water. A piece of code that draws an offscreen picture which took perhaps half a second (if that) on Carbon or Cocoa using RB2012R2 now works the same in Cocoa Builds, but takes 45 seconds when compiled as Carbon!!!
The code: (makes no difference if antialias is on or off)
//little pics is a wide picture containing many 64 x 64 images
for x = 0 to mx
xx = x*squaresize+2
cx = x + topleftx
for y = 0 to my
cy = y + toplefty
yy = y * squaresizey +1
cul1 =cul1(cx,cy)
if cul1 >0 then g.DrawPicture app.littlepics, xx, yy, fs, fs, palsymbol(cul1)*64,0,64,64
next
next
Cocoa was much less stable in RS2012 than it currently is in Xojo.
I had apps that I could not make work in RS… that work perfectly in Cocoa with Xojo today… to the point… I don’t do anything in Carbon anymore.
Thats kinda the point.
It was fine building carbon in 2012R2
Then I installed 10.8.4 and now it’s completely unusable, not a line of code changed.
Looks like I’m going to have to make myself use Xojo IDE and jump to 10.6 as a minimum system all in one shot.
Disappointing: I had hoped to keep users of earlier OSX happy for a while yet.
No-one aware of any changes in OSX 10.84 that would have caused this?
[quote=29431:@Jeff Tullin]Thats kinda the point.
It was fine building carbon in 2012R2
Then I installed 10.8.4 and now it’s completely unusable, not a line of code changed.
Looks like I’m going to have to make myself use Xojo IDE and jump to 10.6 as a minimum system all in one shot.
Disappointing: I had hoped to keep users of earlier OSX happy for a while yet.
No-one aware of any changes in OSX 10.84 that would have caused this?[/quote]
Sorry, I misread and then saw Dave’s post. I don’t know of any change in 10.8.4 that would have caused this, but I haven’t worked with the Carbon framework in quite some time.
[quote=29399:@Jeff Tullin]The code: (makes no difference if antialias is on or off)
//little pics is a wide picture containing many 64 x 64 images
for x = 0 to mx
xx = x*squaresize+2
cx = x + topleftx
for y = 0 to my
cy = y + toplefty
yy = y * squaresizey +1
cul1 =cul1(cx,cy)
if cul1 >0 then g.DrawPicture app.littlepics, xx, yy, fs, fs, palsymbol(cul1)*64,0,64,64
next
next[/quote]
What is ‘fs’ set too?
Other than that, the code looks alright, are you doing this in the paint event of a canvas? To a picture or pulling a canvases.graphics out and then doing it?
There is nothing I’ve seen in 10.8.4 that could suggest a break in carbon drawing.
(Sorted the licence key issue out. Just a niggle at the end of a frustrating day.)
fs typically varies between 4 and 40, and can be considered the ‘zoom size’ - bigger number = bigger grid.
The code draws to an in-memory picture and can be, (but isn’t always) called ‘in the paint event’ .
At the end of the paint event, the offscreen image is painted to the visible canvas.
Yes, the code looks alright and has been working under Carbon for maybe 12 years. It still works fine under Cocoa beta.
Something about the combination of RS2012R2 and 10.8.4 and Carbon is off.
(I did try going back to RS2009 with the code, as that has been very stable for me for years, but the change from Statictext to label seems pretty much to have been a one way trip.)
More: I get the same effect in Xojo latest build.
It’s looking like a memory leak.
Build as Carbon: Every redraw gets slower, and by the third one its unusable.
Cocoa is fine.
Carbon is/has pretty much been in low maintenance mode with Apple for a while. It still requires jiggery-pokery to Sandbox a Carbon application with Open/Save dialogs. Carbon can supposedly support Retina…
Cocoa is what gets the most attention from Apple and it was paramount that Xojo make the switch and in a timely manor.