[vwnc] cairo crash in demo app

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] cairo crash in demo app

Mark Plas

Hi,

 

I’ve loaded the latest Cairo & Pango bundles from the public repository, took Travis’ cairo&pango zip files and then I tried James Robertson’s Cairo Demo application (also in the repository). But when the demo window needs to be repainted, I often get out of memory crashes like the one listed below.

 

What is wrong here?

 

Thanks,

Mark

 

 

Unhandled exception: Bad status: out of memory

CairoGraphics.CairoContext(Object)>>error:

CairoGraphics.CairoContext(CairoGraphics.ManagedHandle)>>checkStatus

CairoGraphics.CairoContext>>paint

MyView>>draw:

MyView>>displayOn:

BorderedWrapper>>displayOn:

SpecWrapper(Wrapper)>>displayOn:

SpecWrapper(WidgetWrapper)>>displayOn:

CompositePart>>displayOn:

WindowDisplayPolicy>>displayDamageList:in:

ApplicationWindow(ScheduledWindow)>>displayDamageEvent:

ApplicationWindow(ScheduledWindow)>>checkForEvents

optimized [] in [] in WindowManager>>repairDamagesExcept:

OrderedCollection>>do:

optimized [] in WindowManager>>repairDamagesExcept:

BlockClosure>>on:do:

WindowManager>>repairDamagesExcept:

WindowManager>>repairDamages

WindowManager>>processNextEvent

optimized [] in [] in WindowManager>>newProcess

BlockClosure>>on:do:

optimized [] in WindowManager>>newProcess

BlockClosure>>on:do:

optimized [] in Process class>>forBlock:priority:

 

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] cairo crash in demo app

Travis Griggs-3
On Oct 27, 2008, at 1:18 AM, Mark Plas wrote:

> Hi,
>
> I’ve loaded the latest Cairo & Pango bundles from the public  
> repository, took Travis’ cairo&pango zip files and then I tried  
> James Robertson’s Cairo Demo application (also in the repository).  
> But when the demo window needs to be repainted, I often get out of  
> memory crashes like the one listed below.
>
> What is wrong here?

The demo is pretty ancient. It predates the use of  
newCairoContextWhile: pattern. This error is semi-common on Windows  
installs where windows resources are (relatively) limited, and it's  
possible to exhaust them before finalization frees some up.

The out-of-memory error is really a "placeholder" error for any sort  
of windows error that passes up into the Cairo layer.

--
Travis Griggs
Objologist
I patented thinking... and I still can't find anyone infringing.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] cairo crash in demo app

Mark Plas
Thanks Travis,

I changed the displayOn: method to use #newCairoContextWhile: and it runs fine now.

Do you, or anyone, know whether there are other examples in the public repository that make use of the Cairo graphics? I'm interested to see what can be done with it.

Thanks,
Mark

-----Original Message-----
From: Travis Griggs [mailto:[hidden email]]
Sent: maandag 27 oktober 2008 15:00
To: Mark Plas
Cc: [hidden email]
Subject: Re: [vwnc] cairo crash in demo app

On Oct 27, 2008, at 1:18 AM, Mark Plas wrote:

> Hi,
>
> I've loaded the latest Cairo & Pango bundles from the public
> repository, took Travis' cairo&pango zip files and then I tried
> James Robertson's Cairo Demo application (also in the repository).
> But when the demo window needs to be repainted, I often get out of
> memory crashes like the one listed below.
>
> What is wrong here?

The demo is pretty ancient. It predates the use of
newCairoContextWhile: pattern. This error is semi-common on Windows
installs where windows resources are (relatively) limited, and it's
possible to exhaust them before finalization frees some up.

The out-of-memory error is really a "placeholder" error for any sort
of windows error that passes up into the Cairo layer.

--
Travis Griggs
Objologist
I patented thinking... and I still can't find anyone infringing.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] cairo crash in demo app

Michael Lucas-Smith-2
There's the Gizmo package, which contains some experiments by Travis and
myself - including some funky looking clocks.

Mark Plas wrote:

> Thanks Travis,
>
> I changed the displayOn: method to use #newCairoContextWhile: and it runs fine now.
>
> Do you, or anyone, know whether there are other examples in the public repository that make use of the Cairo graphics? I'm interested to see what can be done with it.
>
> Thanks,
> Mark
>
> -----Original Message-----
> From: Travis Griggs [mailto:[hidden email]]
> Sent: maandag 27 oktober 2008 15:00
> To: Mark Plas
> Cc: [hidden email]
> Subject: Re: [vwnc] cairo crash in demo app
>
> On Oct 27, 2008, at 1:18 AM, Mark Plas wrote:
>
>  
>> Hi,
>>
>> I've loaded the latest Cairo & Pango bundles from the public
>> repository, took Travis' cairo&pango zip files and then I tried
>> James Robertson's Cairo Demo application (also in the repository).
>> But when the demo window needs to be repainted, I often get out of
>> memory crashes like the one listed below.
>>
>> What is wrong here?
>>    
>
> The demo is pretty ancient. It predates the use of
> newCairoContextWhile: pattern. This error is semi-common on Windows
> installs where windows resources are (relatively) limited, and it's
> possible to exhaust them before finalization frees some up.
>
> The out-of-memory error is really a "placeholder" error for any sort
> of windows error that passes up into the Cairo layer.
>
> --
> Travis Griggs
> Objologist
> I patented thinking... and I still can't find anyone infringing.
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>  

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] cairo crash in demo app

Joachim Geidel
Mark,

I have done some experiments with a backwards compatibility layer for
CairoGraphics. The idea was to wrap an arbitrary VisualComponent in a
CairoWrapper, and use a CairoGraphicsContext for redirecting the
rendering messages to a CairoContext.

I have uploaded my code to the public repository. If you want to play
with it, have a look at:
  CairoGraphics-Wrappers
  CairoGraphics-Wrappers-Examples
For the examples, you will need Akamaru. The
Akamaru.DemoUI will show an additional display mode based on CairoWrapper.

CairoWrapper already works for many VisualComponents which contain
only graphics and single-line text labels. The class CairoGraphicsContext
supports scaling and transparency. This might be an
opportunity to add these features to existing VisualComponents without
having to completely rewrite their rendering code for Cairo. However,
use it at your own risk - the package is experimental code and not
production ready.

Some more details and screenshots can be found in the thread called
"Wrapping Cairo" in the archives of the vwnc list of Sept. 2007.

Best regards,
Joachim Geidel


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] cairo crash in demo app

Travis Griggs-3
In reply to this post by Mark Plas
On Oct 27, 2008, at 8:04 AM, Mark Plas wrote:

> Thanks Travis,
>
> I changed the displayOn: method to use #newCairoContextWhile: and it  
> runs fine now.


Stuff I'm actively supporting:

There are Cairo-ized versions of SUnitToo(ls) and LessProgress (same  
package name with a 'cairoized' suffix). There is a NewTextFind which  
uses Cairo overlay graphics to show interactive text search like you  
find in Safari and Firefox.

Quick demos/hacks I've thrown together:

Akamaru is a quick and dirty (and incorrect) port of the Akamaru  
constraint solver with some fun examples in it. It has a switch to  
toggle between  classic VW graphics and Cairo rendered graphics.  
PackageMetrics shows how to play games with fonts and affine matrix  
transformations (including reflection and shearing). I did a quick  
demo the other night called AnnicksView.

Stuff I know other people have done:

Steven Kelly and I sat down and built a Cairoized version of GF/ST at  
OOPSLA. The "port" took us about an hour maybe. I'll leave it to  
Steven to make that public. The EyeSee guys have a Cairo backend, it  
goes thru their own. Michael mentioned the "gizmo" stuff.


I think it's generally agreed that I'm a sucker for "how do I _____  
with Cairo?" sorts of questions. Here, and especially in  
irc.parcplace.net#smalltalk.

--
Travis Griggs
Objologist
If you can't say "Did it First!", you'd better be able to say "Did it  
Better!"


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc