VW graphical look [Was: Re: MacOS X]

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

VW graphical look [Was: Re: MacOS X]

Steven Kelly
Message
Am I the only one who thinks this is getting out of hand? We chose VW because it insulated us from most issues of supporting multiple platforms, offering a good emulation of the various looks and feels, and providing above average graphics drawing capabilities. This was back in the days of Windows 3.1 and Motif, when the ability to do 32-bit graphics, fill arbitrary splines with patterns etc. was by no means guaranteed.
 
Since then, the graphics support has remained static, and its bugs and omissions remain largely uncorrected. VW's main competitors, Java and .NET, both support anti-aliasing and alpha channels natively. I think they can even manage to draw a dotted line - wow.
 
Every VW UI app needs anti-aliasing on fonts and alpha channels for icons and toolbar buttons, unless it wants to look 5 years out of date. Any app that involves graphics desperately needs anti-aliasing and alpha channels. Today's latest UIs demand these too. The VW look and feel support has moved forward on Windows, but not really elsewhere. Mac OS X was added, and is sort of OK, but probably not enough on a platform where coolness and beauty are so important. Vista support is included in VAST, but I'm not holding my breath for the VW Widgetry version, far less for Wrapper.
 
Do Cincom really want to move all their own work on Widgetry, and all their customers' work on UIs and graphics, to use low-level Cairo calls? Wouldn't it be much better to improve the VM graphics primitives to recognise parameters or ivs in GraphicsContext for antialiasing and alpha? An earlier attempt at Cairo support made a CairoGraphicsContext that worked like that, and that seems to me to be a good approach. That way all existing code gets the benefits, and Cincom are free to choose whether to put Cairo support into the VM via primitives or the image via DLLCC.
 
UIs these days require more and better graphics, and unless VW can provide these at a high level of abstraction, we're wasting all the productivity gains of using Smalltalk by having to drop down to a much lower level of programming or user experience.
 
Cheers,
Steve
 
I'm probably going to end up working on a custom LookPolicy for Widgetry.  I am planning on using Cairo, so I will probably end up with a CairoArtist of some sort, and a bunch of Artists for the different Widgetry controls that subclass it.  Using Cairo will enable the use of alpha channels so we can use professionally created icons, translucency and nice anti-aliased drawing throughout the look.  We'll see how it goes, it will probably take a while.
Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Janko Mivšek
Steven,

> UIs these days require more and better graphics, and unless VW can
> provide these at a high level of abstraction, we're wasting all the
> productivity gains of using Smalltalk by having to drop down to a much
> lower level of programming or user experience.

I can't agree more!

For instance, I'm just looking around for drawing a simple anti-aliased
line for a graph. I was just surprised when found that this such a basic
functionality is not already in VW. Well, 10 years ago I looked last
time and it was somehow natural to expect this as an advanced feature,
but nowadays?

Janko


Steven Kelly wrote:

> Am I the only one who thinks this is getting out of hand? We chose VW
> because it insulated us from most issues of supporting multiple
> platforms, offering a good emulation of the various looks and feels, and
> providing above average graphics drawing capabilities. This was back in
> the days of Windows 3.1 and Motif, when the ability to do 32-bit
> graphics, fill arbitrary splines with patterns etc. was by no means
> guaranteed.
>  
> Since then, the graphics support has remained static, and its bugs and
> omissions remain largely uncorrected. VW's main competitors, Java and
> .NET, both support anti-aliasing and alpha channels natively. I think
> they can even manage to draw a dotted line - wow.
>  
> Every VW UI app needs anti-aliasing on fonts and alpha channels for
> icons and toolbar buttons, unless it wants to look 5 years out of date.
> Any app that involves graphics desperately needs anti-aliasing and alpha
> channels. Today's latest UIs demand these too. The VW look and feel
> support has moved forward on Windows, but not really elsewhere. Mac OS X
> was added, and is sort of OK, but probably not enough on a platform
> where coolness and beauty are so important. Vista support is included in
> VAST, but I'm not holding my breath for the VW Widgetry version, far
> less for Wrapper.
>  
> Do Cincom really want to move all their own work on Widgetry, and all
> their customers' work on UIs and graphics, to use low-level Cairo calls?
> Wouldn't it be much better to improve the VM graphics primitives to
> recognise parameters or ivs in GraphicsContext for antialiasing and
> alpha? An earlier attempt at Cairo support made a CairoGraphicsContext
> that worked like that, and that seems to me to be a good approach. That
> way all existing code gets the benefits, and Cincom are free to choose
> whether to put Cairo support into the VM via primitives or the image via
> DLLCC.
>  
> UIs these days require more and better graphics, and unless VW can
> provide these at a high level of abstraction, we're wasting all the
> productivity gains of using Smalltalk by having to drop down to a much
> lower level of programming or user experience.
>  
> Cheers,
> Steve
>  
>
>     I'm probably going to end up working on a custom LookPolicy for
>     Widgetry.  I am planning on using Cairo, so I will probably end up
>     with a CairoArtist of some sort, and a bunch of Artists for the
>     different Widgetry controls that subclass it.  Using Cairo will
>     enable the use of alpha channels so we can use professionally
>     created icons, translucency and nice anti-aliased drawing throughout
>     the look.  We'll see how it goes, it will probably take a while.

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

skrish
 
I guess the motivation for Virtual Machine Plugin project ported from Squeak was to have the bitblt work in the manner required as described below. I had done some work to understand the framework, bring in the JPEGReadWriter into the VW code using the primitive support. Similar effort I recently put into bring faster rotation ( order of 300%) to image rotate call.
 
Extended the BitBlt can do alpha channel/ aliasing... I guess if there is the crying need for it I would find the motivation to dig back.. and do my two cents of effort on it..
 
skrish

 
On 5/24/07, Janko Mivšek <[hidden email]> wrote:
Steven,

> UIs these days require more and better graphics, and unless VW can
> provide these at a high level of abstraction, we're wasting all the
> productivity gains of using Smalltalk by having to drop down to a much
> lower level of programming or user experience.

I can't agree more!

For instance, I'm just looking around for drawing a simple anti-aliased
line for a graph. I was just surprised when found that this such a basic
functionality is not already in VW. Well, 10 years ago I looked last
time and it was somehow natural to expect this as an advanced feature,
but nowadays?

Janko


Steven Kelly wrote:

> Am I the only one who thinks this is getting out of hand? We chose VW
> because it insulated us from most issues of supporting multiple
> platforms, offering a good emulation of the various looks and feels, and
> providing above average graphics drawing capabilities. This was back in
> the days of Windows 3.1 and Motif, when the ability to do 32-bit
> graphics, fill arbitrary splines with patterns etc. was by no means
> guaranteed.
>
> Since then, the graphics support has remained static, and its bugs and
> omissions remain largely uncorrected. VW's main competitors, Java and
> .NET, both support anti-aliasing and alpha channels natively. I think
> they can even manage to draw a dotted line - wow.
>
> Every VW UI app needs anti-aliasing on fonts and alpha channels for
> icons and toolbar buttons, unless it wants to look 5 years out of date.
> Any app that involves graphics desperately needs anti-aliasing and alpha
> channels. Today's latest UIs demand these too. The VW look and feel
> support has moved forward on Windows, but not really elsewhere. Mac OS X
> was added, and is sort of OK, but probably not enough on a platform
> where coolness and beauty are so important. Vista support is included in
> VAST, but I'm not holding my breath for the VW Widgetry version, far
> less for Wrapper.
>
> Do Cincom really want to move all their own work on Widgetry, and all
> their customers' work on UIs and graphics, to use low-level Cairo calls?
> Wouldn't it be much better to improve the VM graphics primitives to
> recognise parameters or ivs in GraphicsContext for antialiasing and
> alpha? An earlier attempt at Cairo support made a CairoGraphicsContext
> that worked like that, and that seems to me to be a good approach. That
> way all existing code gets the benefits, and Cincom are free to choose
> whether to put Cairo support into the VM via primitives or the image via
> DLLCC.
>
> UIs these days require more and better graphics, and unless VW can
> provide these at a high level of abstraction, we're wasting all the
> productivity gains of using Smalltalk by having to drop down to a much
> lower level of programming or user experience.
>
> Cheers,
> Steve
>
>
>     I'm probably going to end up working on a custom LookPolicy for
>     Widgetry.  I am planning on using Cairo, so I will probably end up
>     with a CairoArtist of some sort, and a bunch of Artists for the
>     different Widgetry controls that subclass it.  Using Cairo will
>     enable the use of alpha channels so we can use professionally
>     created icons, translucency and nice anti-aliased drawing throughout
>     the look.  We'll see how it goes, it will probably take a while.

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Robin Barendregt
In reply to this post by Steven Kelly

Well, you have my vote. I had been hoping for this since your talk about it at the Cincom User Conference back in december of 2004!

 

Regards, Robin

 


From: Sudhakar Krishnamachari [mailto:[hidden email]]
Sent: donderdag 24 mei 2007 13:23
To: Janko Mivšek
Cc: VWNC
Subject: Re: VW graphical look [Was: Re: MacOS X]

 

 

I guess the motivation for Virtual Machine Plugin project ported from Squeak was to have the bitblt work in the manner required as described below. I had done some work to understand the framework, bring in the JPEGReadWriter into the VW code using the primitive support. Similar effort I recently put into bring faster rotation ( order of 300%) to image rotate call.

 

Extended the BitBlt can do alpha channel/ aliasing... I guess if there is the crying need for it I would find the motivation to dig back.. and do my two cents of effort on it..

 

skrish

 

Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Steven Kelly
In reply to this post by Steven Kelly
From: James Robertson [mailto:[hidden email]]
> Why would a Cairo interface require you as a developer to work at a
> low level?  Take EXDI, for instance - it's not exactly high level,
> but it does abstract you up from the base C interfaces.

Thanks for responding, Jim. I'll try and answer as best I can, but
remember I'm just a customer, not an expert in the low-level details
here.

With VW's GraphicsContext mechanism, I can take anything that can be
displayed and display it on any medium - printer, screen, bitmap, vector
graphics file (Donald McQueen's PICTGraphicsContext), whatever. It just
changes one thing, the initial object. E.g.
   myApplicationWindow component displayOn: anyGraphicsContext
This works for any drawable receiver, from lines to buttons to whole
windows and all their contents, on any graphics context.

With Cairo/Pango as it stands in Travis' plans, that won't work. VW
classes are getting parallel Cairo classes, e.g. ComposedText (sort of)
maps to (Text)Layout. Similarly VW methods like displayOn:, which the
whole graphics system depends on, are being written instead as
renderOn:. So we have to create a new set of objects, and then call a
new set of methods. That basically means a rewrite from scratch, unless
something is done to help. I'm really happy to be corrected on this, if
Travis has something up his sleeve.

Maybe using Cairo in the VM or in a CairoGraphicsContext (or even
separate CairoPDFGraphicsContext, CairoScreenGraphicsContext etc.) could
never work - I don't know. But VW should provide some mechanism that
adds anti-aliasing, alpha channels and other modern graphics features to
the base, without requiring wholesale rewriting of existing apps. If
Cairo can't do it, update the platform-specific graphics C code in the
VM to use GDI+ etc. instead of the ancient things that are there now.
Most customers shouldn't have to know HOW it is done, just as they don't
have to in Java (who paid Draw2D) and .NET (that uses GDI+ or something
newer).

Java licensed their Java 2D anti-aliasing technology from Ductus in Feb
1998 - nearly 10 years ago. Java 5 added sub-pixel antialiasing - i.e.
ClearType use of the three R, G and B vertical rods that make up a
pixel. Java 6 now has it on by default for the whole UI. It's a similar
story for .NET. Being one generation behind in VW is something we've
sadly got used to. Two generations and one major version is way too
much.

All the best,
Steve


> At 06:34 AM 5/24/2007, you wrote:
> >Am I the only one who thinks this is getting out of hand? We chose
> >VW because it insulated us from most issues of supporting multiple
> >platforms, offering a good emulation of the various looks and feels,
> >and providing above average graphics drawing capabilities. This was
> >back in the days of Windows 3.1 and Motif, when the ability to do
> >32-bit graphics, fill arbitrary splines with patterns etc. was by no
> >means guaranteed.
> >
> >Since then, the graphics support has remained static, and its bugs
> >and omissions remain largely uncorrected. VW's main competitors,
> >Java and .NET, both support anti-aliasing and alpha channels
> >natively. I think they can even manage to draw a dotted line - wow.
> >
> >Every VW UI app needs anti-aliasing on fonts and alpha channels for
> >icons and toolbar buttons, unless it wants to look 5 years out of
> >date. Any app that involves graphics desperately needs anti-aliasing
> >and alpha channels. Today's latest UIs demand these too. The VW look
> >and feel support has moved forward on Windows, but not really
> >elsewhere. Mac OS X was added, and is sort of OK, but probably not
> >enough on a platform where coolness and beauty are so important.
> >Vista support is included in VAST, but I'm not holding my breath for
> >the VW Widgetry version, far less for Wrapper.
> >
> >Do Cincom really want to move all their own work on Widgetry, and
> >all their customers' work on UIs and graphics, to use low-level
> >Cairo calls? Wouldn't it be much better to improve the VM graphics
> >primitives to recognise parameters or ivs in GraphicsContext for
> >antialiasing and alpha? An earlier attempt at Cairo support made a
> >CairoGraphicsContext that worked like that, and that seems to me to
> >be a good approach. That way all existing code gets the benefits,
> >and Cincom are free to choose whether to put Cairo support into the
> >VM via primitives or the image via DLLCC.
> >
> >UIs these days require more and better graphics, and unless VW can
> >provide these at a high level of abstraction, we're wasting all the
> >productivity gains of using Smalltalk by having to drop down to a
> >much lower level of programming or user experience.
> >
> >Cheers,
> >Steve
> >
> >I'm probably going to end up working on a custom LookPolicy for
> >Widgetry.  I am planning on using Cairo, so I will probably end up
> >with a CairoArtist of some sort, and a bunch of Artists for the
> >different Widgetry controls that subclass it.  Using Cairo will
> >enable the use of alpha channels so we can use professionally
> >created icons, translucency and nice anti-aliased drawing throughout
> >the look.  We'll see how it goes, it will probably take a while.
>
> <Talk Small and Carry a Big Class Library>
> James Robertson, Product Manager, Cincom Smalltalk
> http://www.cincomsmalltalk.com/blog/blogView
>
>

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Andre Schnoor
In reply to this post by Steven Kelly

Steven Kelly wrote:
Message
Am I the only one who thinks this is getting out of hand? We chose VW because it insulated us from most issues of supporting multiple platforms, offering a good emulation of the various looks and feels, and providing above average graphics drawing capabilities. This was back in the days of Windows 3.1 and Motif, when the ability to do 32-bit graphics, fill arbitrary splines with patterns etc. was by no means guaranteed.
 
Since then, the graphics support has remained static, and its bugs and omissions remain largely uncorrected. VW's main competitors, Java and .NET, both support anti-aliasing and alpha channels natively. I think they can even manage to draw a dotted line - wow.

Well, this is due to the way the term "cross platform" is understood here. There are at least two different possible meanings for it:

A) Maintain one codebase => build one image => run same image on various platforms
B) Maintain one codebase => build for each platform => run dedicated image on each platform

While (A) might once have been a sexy and provoking promise in the days of early computing, I doubt it is still a viable way to go today. What developers are mainly looing for, is maintaining a _single code base_. I can't see any serious disadvantage in building individual images for different target platforms, provided this can be done automatically from the same code base.

It is inherently clear that (A) involves "primitives", forcing product capabilities to the lowest common denominator of all platforms. There are very good reasons to support X11 and Motiv. However, other more desktop-centric platforms like XP, Vista and MacOS X should not suffer from that.

Why not abandon (A) and go for (B)? In the long term, moving UI and graphics layers up to the image level completely - one for each target platform - would free Cincom from the burden of maintaining primitives at the VM level (wich is another painful bottleneck). It would be a lot easier for customers and the NC community to dig into the code themselves and keep it up with current UIs.

 
[...]
 
UIs these days require more and better graphics, and unless VW can provide these at a high level of abstraction, we're wasting all the productivity gains of using Smalltalk by having to drop down to a much lower level of programming or user experience.

I highly agree. From my own experience, for example, the actual R&D effort for our current products was probably only 25% compared to the usual estimate when using other IDEs. This is the great productivity advantage, enthusiasts are always talking about. However, all the hassle and effort required to finally get the software ready for deployment, production and shipping, was (and still is) eating it all up (at least 30% plus = one extra year).

I appreciate that this is already being addressed by Cincom, so please don't take it as an offense.

Andre

Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Steven Kelly
In reply to this post by Steven Kelly
Message
In the long term, moving UI and graphics layers up to the image level completely - one for each target platform - would free Cincom from the burden of maintaining primitives at the VM level (wich is another painful bottleneck). It would be a lot easier for customers and the NC community to dig into the code themselves and keep it up with current UIs.
I understand the idea, but the reasoning is false in this case. The problem is that Cincom are NOT maintaining the primitives at the VM level. The oldest sources I have for the Windows graphics primitives are for 7.2, and there have been only a few minor bug fixes since then. I'll bet that's the same all the way back to at least VW 3.0, nearly 10 years ago.
 
I don't want to have to know the annoying little differences between platforms, nor to have my application reduced to a crawl because this stuff is implemented in Smalltalk message sends rather than C. The idea of something like VW is that there is a lot of similarity between platforms, and between applications. By leveraging that similarity we can raise the level of abstraction of development above low-level C calls.
 
If the platform-specific line drawing calls are raised to the image level, what would they look like? Currently we have primDisplayLine(gc, start, end) in C, and a corresponding method in Smalltalk. Would you really want the 119 lines of C code that implement primDisplayLine to be expressed as Smalltalk?
 
Even if the answer is yes, that doesn't get you very far. The end call is still to the ancient Windows line drawing function, which cannot do anti-aliasing. That would be the new primitive. There's no way to improve that line drawing in Smalltalk other than hand-write pixel manipulation code for something like the Wu anti-aliasing algorithm, which of course would be ludicrously slow.
 
Wouldn't it be easier to update the graphics call in the VM C code - one line! - to use a more modern Windows graphics API like GDI+, which would give us anti-aliasing? A first cut could simply get the choice to anti-alias or not from a new instance variable in GraphicsContext. 
 
Steve
Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Michael Lucas-Smith-2
In reply to this post by Steven Kelly

Do Cincom really want to move all their own work on Widgetry, and all their customers' work on UIs and graphics, to use low-level Cairo calls? Wouldn't it be much better to improve the VM graphics primitives to recognise parameters or ivs in GraphicsContext for antialiasing and alpha?
The primitives you talk about are pretty much 1:1 with their C equivalents. So it's not like we're actually calling "less low-level" stuff just because the VM implements it. We could move all of the current GDI code in the VM up in to the image. What would it get us? Not much.

We could push all of the modern GDI primitives down in to the VM and map them back up in to the image. Would that be better than putting the GDI primitives in the image in the first place? not really, no. In fact, it then ties our hands the way that the current VM based GDI primitives do. It adds another layer of "surprise" when it comes to maintaining them and providing forward compatibility.

Take the MacOSX Aqua VM for example. The quartz platform, like the WPF and Cairo platform, do graphics by specifying positions between points, not on points. This is an incredibly important detail - it's a fundamental graphics shift that happened a while back (and Microsoft only just caught up). It makes all of the graphics primitives that currently exist incompatible. Instead of drawing a line from 0@0@ to: 10@0, you actually draw a line of 1 thinkness between x: -0.5..0.5 to 9.5..10.5. That's in important distinction because if you want to fill an area, you must understand that you're not drawing /on/ pixels, you're drawing /between/ pixels.

The MacOSX VM team has done an amazing job trying to fake pixel drawing on this kind of platform. Poor guys!.. the truth is that we should have dropped found a way to drop on-pixel for between-pixel 10 years ago - but doing it cross platform back then would have been very hard, especially on the windows platform.

Today, however, we can pick up a library called Cairo. Contrary to the way you put it above - Cairo's graphics primitives are far less primitive than the primitives you get in GDI. First of all, they work between pixels, which is a huge bonus. They work across platform and finally, they describe higher level drawing constructs. For example - gradient blends, rotations, skews, so on and so forth.

So, your question was - do we (or in this case I) want to use "Cairo low-level primitives" .. heck yeah. It gives me so much drawing power. Much more than I get with GDI or GDI+. And back to your second question, wouldn't it be better to improve the VM GDI primitives? I hope my above diatribe has convinced you that that is undesirable and unrealistic.
An earlier attempt at Cairo support made a CairoGraphicsContext that worked like that, and that seems to me to be a good approach. That way all existing code gets the benefits, and Cincom are free to choose whether to put Cairo support into the VM via primitives or the image via DLLCC.
I wasn't involved, but several people tried to do this and found significant issues in doing this. Not the least of which is the way the coordinate system is completely different.
 
UIs these days require more and better graphics, and unless VW can provide these at a high level of abstraction, we're wasting all the productivity gains of using Smalltalk by having to drop down to a much lower level of programming or user experience.
I agree. Dropping back to a lower level (GDI) is a bad idea.

VW classes are getting parallel Cairo classes, e.g. ComposedText (sort of)
maps to (Text)Layout. Similarly VW methods like displayOn:, which the
whole graphics system depends on, are being written instead as
renderOn:.
This was a side effect of a primitive implementation. Now Travis's library can let you call:

aGraphicsContext cairoContext

That means that you can pick and choose which displayOn:'s you want to upgrade to draw with Cairo. It also means there's no need for a parallel hierarchy of renderOn: methods. The parallel classes that represents /similar/ concepts. Some of those may not need to exist - most of them are not actually used. For example, when you want to create paths, you do use regular Rectangles. Many of the existing classes could be better utilitised - it's still early days there. I'd consider this bit of the Cairo implementation a Work-In-Progress. Job #1 is to replicate the Cairo interface as honestly as possible. Job #2 is to make it convenient in Smalltalk.
So we have to create a new set of objects, and then call a
new set of methods. That basically means a rewrite from scratch, unless
something is done to help.
Right. Writing from scratch is exactly what you will need to do if you want to draw using Cairo. There's no two ways about tihs. It's like converting from ObjectLens to Glorp - the concept shift is massive yet subtly similar. On the whole it's "mapping to a database" but the approach is wildly different and more powerful.

Here it's the same story, it's all about "drawing to the screen". Except how they do it is wildly different. With GDI, you draw pixels straight to a surface - /now/. With Cairo, you describe a path, a transform, what you want to do, then apply it. That's like saying GDI has a pen with a colour, except then add on all those other operations before you actually get around to doing something.

So may be down the road it'll be possible to simplify some of the more common actions you take, but the world when approached the Cairo, Quartz or WPF way is completely different.

With the #cairoContext approach though, we can share the graphics display between GDI and Cairo drawing techniques. That's a huge boon and it means "rewrite from scratch" is an incremental thing, when and/or if it makes sense to do it for a particular widget.

Cheers,
Michael

Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Boris Popov, DeepCove Labs (SNN)

I was one of the people that originally tried to create a compatible display context that used cairo backend, and honestly I’ve only gotten as far as displaying lines and rectangles and bitmaps. Nonetheless, I’m curious myself as to what exactly makes it impossible to continue down that path and get immediate benefits of much nicer looking paths and text versus having to create whole new looks that use cairo-specific API? I don’t yet buy the generic “it’s very different” excuse, people fit propane engines in gasoline cars all the time, but like I say I probably just haven’t gone far enough yet, hence me asking for specifics ;)

 

Thanks!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.


From: Michael Lucas-Smith [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 9:38 AM
To: Steven Kelly
Cc: vwnc-list
Subject: Re: VW graphical look [Was: Re: MacOS X]

 



Do Cincom really want to move all their own work on Widgetry, and all their customers' work on UIs and graphics, to use low-level Cairo calls? Wouldn't it be much better to improve the VM graphics primitives to recognise parameters or ivs in GraphicsContext for antialiasing and alpha?

The primitives you talk about are pretty much 1:1 with their C equivalents. So it's not like we're actually calling "less low-level" stuff just because the VM implements it. We could move all of the current GDI code in the VM up in to the image. What would it get us? Not much.

We could push all of the modern GDI primitives down in to the VM and map them back up in to the image. Would that be better than putting the GDI primitives in the image in the first place? not really, no. In fact, it then ties our hands the way that the current VM based GDI primitives do. It adds another layer of "surprise" when it comes to maintaining them and providing forward compatibility.

Take the MacOSX Aqua VM for example. The quartz platform, like the WPF and Cairo platform, do graphics by specifying positions between points, not on points. This is an incredibly important detail - it's a fundamental graphics shift that happened a while back (and Microsoft only just caught up). It makes all of the graphics primitives that currently exist incompatible. Instead of drawing a line from 0@0@ to: 10@0, you actually draw a line of 1 thinkness between x: -0.5..0.5 to 9.5..10.5. That's in important distinction because if you want to fill an area, you must understand that you're not drawing /on/ pixels, you're drawing /between/ pixels.

The MacOSX VM team has done an amazing job trying to fake pixel drawing on this kind of platform. Poor guys!.. the truth is that we should have dropped found a way to drop on-pixel for between-pixel 10 years ago - but doing it cross platform back then would have been very hard, especially on the windows platform.

Today, however, we can pick up a library called Cairo. Contrary to the way you put it above - Cairo's graphics primitives are far less primitive than the primitives you get in GDI. First of all, they work between pixels, which is a huge bonus. They work across platform and finally, they describe higher level drawing constructs. For example - gradient blends, rotations, skews, so on and so forth.

So, your question was - do we (or in this case I) want to use "Cairo low-level primitives" .. heck yeah. It gives me so much drawing power. Much more than I get with GDI or GDI+. And back to your second question, wouldn't it be better to improve the VM GDI primitives? I hope my above diatribe has convinced you that that is undesirable and unrealistic.

An earlier attempt at Cairo support made a CairoGraphicsContext that worked like that, and that seems to me to be a good approach. That way all existing code gets the benefits, and Cincom are free to choose whether to put Cairo support into the VM via primitives or the image via DLLCC.

I wasn't involved, but several people tried to do this and found significant issues in doing this. Not the least of which is the way the coordinate system is completely different.

 

UIs these days require more and better graphics, and unless VW can provide these at a high level of abstraction, we're wasting all the productivity gains of using Smalltalk by having to drop down to a much lower level of programming or user experience.

I agree. Dropping back to a lower level (GDI) is a bad idea.


VW classes are getting parallel Cairo classes, e.g. ComposedText (sort of)
maps to (Text)Layout. Similarly VW methods like displayOn:, which the
whole graphics system depends on, are being written instead as
renderOn:.

This was a side effect of a primitive implementation. Now Travis's library can let you call:

aGraphicsContext cairoContext

That means that you can pick and choose which displayOn:'s you want to upgrade to draw with Cairo. It also means there's no need for a parallel hierarchy of renderOn: methods. The parallel classes that represents /similar/ concepts. Some of those may not need to exist - most of them are not actually used. For example, when you want to create paths, you do use regular Rectangles. Many of the existing classes could be better utilitised - it's still early days there. I'd consider this bit of the Cairo implementation a Work-In-Progress. Job #1 is to replicate the Cairo interface as honestly as possible. Job #2 is to make it convenient in Smalltalk.

So we have to create a new set of objects, and then call a
new set of methods. That basically means a rewrite from scratch, unless
something is done to help.

Right. Writing from scratch is exactly what you will need to do if you want to draw using Cairo. There's no two ways about tihs. It's like converting from ObjectLens to Glorp - the concept shift is massive yet subtly similar. On the whole it's "mapping to a database" but the approach is wildly different and more powerful.

Here it's the same story, it's all about "drawing to the screen". Except how they do it is wildly different. With GDI, you draw pixels straight to a surface - /now/. With Cairo, you describe a path, a transform, what you want to do, then apply it. That's like saying GDI has a pen with a colour, except then add on all those other operations before you actually get around to doing something.

So may be down the road it'll be possible to simplify some of the more common actions you take, but the world when approached the Cairo, Quartz or WPF way is completely different.

With the #cairoContext approach though, we can share the graphics display between GDI and Cairo drawing techniques. That's a huge boon and it means "rewrite from scratch" is an incremental thing, when and/or if it makes sense to do it for a particular widget.

Cheers,
Michael

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Andre Schnoor
In reply to this post by Steven Kelly

Steven Kelly wrote:
Message
In the long term, moving UI and graphics layers up to the image level completely - one for each target platform - would free Cincom from the burden of maintaining primitives at the VM level (wich is another painful bottleneck). It would be a lot easier for customers and the NC community to dig into the code themselves and keep it up with current UIs.
I understand the idea, but the reasoning is false in this case. The problem is that Cincom are NOT maintaining the primitives at the VM level. The oldest sources I have for the Windows graphics primitives are for 7.2, and there have been only a few minor bug fixes since then. I'll bet that's the same all the way back to at least VW 3.0, nearly 10 years ago.
 
I don't want to have to know the annoying little differences between platforms, nor to have my application reduced to a crawl because this stuff is implemented in Smalltalk message sends rather than C. The idea of something like VW is that there is a lot of similarity between platforms, and between applications. By leveraging that similarity we can raise the level of abstraction of development above low-level C calls.

Our product *is* reduced to a crawl (which is why we still can't ship it, nor even announce it), because the "primitive" approach disposes GraphicsContexts between each and every line and dot, which is horribly slow. Due to the cost of creating new GCs on the Mac, redrawing a window with lots of graphics is approx. 20 times slower(!) than on Windows. More complex graphics operations can not be adequately handled by atomic, platform-transparent primitives.

I assume this could be dramatically accelerated, if the VM knew about the lifetime of a GC at the Smalltalk level, so drawing 1000 lines and dots will only require a single GC allocation (e.g. for the whole window). I am about to evaluate that.
  
If the platform-specific line drawing calls are raised to the image level, what would they look like?

Like DLLCC calls to the platform's frameworks. By no means hand-wired algorithms implemenetd in Smalltalk ;-) Being able to optimize the arguments and the nesting of complex operation for each platform, should largely improve the performance and maintainability.

Currently we have primDisplayLine(gc, start, end) in C, and a corresponding method in Smalltalk. Would you really want the 119 lines of C code that implement primDisplayLine to be expressed as Smalltalk?

Never.
 
Even if the answer is yes, that doesn't get you very far. The end call is still to the ancient Windows line drawing function, which cannot do anti-aliasing. That would be the new primitive. There's no way to improve that line drawing in Smalltalk other than hand-write pixel manipulation code for something like the Wu anti-aliasing algorithm, which of course would be ludicrously slow.
 
Wouldn't it be easier to update the graphics call in the VM C code - one line! - to use a more modern Windows graphics API like GDI+, which would give us anti-aliasing? A first cut could simply get the choice to anti-alias or not from a new instance variable in GraphicsContext.

I'd really appreciate if support for Win98 would be completely dropped. Support for unused platforms just slows down the others.

Andre

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

OCIT
what? I guess I have not played with graphics for a while because I don't  
remember this at all, granted I never had to support a MAC implementation


On Thu, 24 May 2007 12:56:29 -0400, Andre Schnoor <[hidden email]>  
wrote:

> Our product *is* reduced to a crawl (which is why we still can't ship  
> it, nor even announce it), because the "primitive" approach disposes  
> GraphicsContexts between each and every line and dot, which is horribly  
> slow. Due to the cost of creating new GCs on the Mac, redrawing a window  
> with lots of graphics is approx. 20 times slower(!) than on Windows.  
> More complex graphics operations can not be adequately handled by  
> atomic, platform-transparent primitives.



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Andre Schnoor

Charles A. Monteiro wrote:

> what? I guess I have not played with graphics for a while because I
> don't remember this at all, granted I never had to support a MAC
> implementation
>
>
> Andre Schnoor wrote:
>
>> Our product *is* reduced to a crawl (which is why we still can't ship
>> it, nor even announce it), because the "primitive" approach disposes
>> GraphicsContexts between each and every line and dot, which is
>> horribly slow. Due to the cost of creating new GCs on the Mac,
>> redrawing a window with lots of graphics is approx. 20 times
>> slower(!) than on Windows. More complex graphics operations can not
>> be adequately handled by atomic, platform-transparent primitives.
>

It's not Cincoms fault. It's the ancient GC handling used in the VM
primitives. The MacOS X VM team has achieved great progress since the
last release and I am confident the problem can be solved.

The performance bottleneck is not recognized that dramatically in the
development environment, because one quickly gets used to a the lag in
the browsers etc. It really hurts with lots of graphics and scrolling.
While on a Windows PC everything works fine, it gets tough on the Mac.

Andre

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Travis Griggs-3
In reply to this post by Steven Kelly
On May 24, 2007, at 3:34, Steven Kelly wrote:

Am I the only one who thinks this is getting out of hand? We chose VW because it insulated us from most issues of supporting multiple platforms, offering a good emulation of the various looks and feels, and providing above average graphics drawing capabilities. This was back in the days of Windows 3.1 and Motif, when the ability to do 32-bit graphics, fill arbitrary splines with patterns etc. was by no means guaranteed.

 Since then, the graphics support has remained static, and its bugs and omissions remain largely uncorrected. VW's main competitors, Java and .NET, both support anti-aliasing and alpha channels natively. I think they can even manage to draw a dotted line - wow.

I feel your pain. Believe me. One complicating factor with the .NET/Java comparisons is that they don't run on X11. Well, they do, but you probably get some limited amount of AA support there.

 Every VW UI app needs anti-aliasing on fonts and alpha channels for icons and toolbar buttons, unless it wants to look 5 years out of date. Any app that involves graphics desperately needs anti-aliasing and alpha channels. Today's latest UIs demand these too. The VW look and feel support has moved forward on Windows, but not really elsewhere. Mac OS X was added, and is sort of OK, but probably not enough on a platform where coolness and beauty are so important. Vista support is included in VAST, but I'm not holding my breath for the VW Widgetry version, far less for Wrapper.

So one thing I really wish we could get everyone to agree on--I feel like I'm repeating myself--VW has AA fonts. At least on Win32 and OSX. Has for quite a while. In fact, I challenge anyone to NOT get AA font rendering on win32/Cocoa platforms. What they all lack, and in some cases go through great lengths to avoid is AA drawing.

 Do Cincom really want to move all their own work on Widgetry, and all their customers' work on UIs and graphics, to use low-level Cairo calls? Wouldn't it be much better to improve the VM graphics primitives to recognise parameters or ivs in GraphicsContext for antialiasing and alpha? An earlier attempt at Cairo support made a CairoGraphicsContext that worked like that, and that seems to me to be a good approach. That way all existing code gets the benefits, and Cincom are free to choose whether to put Cairo support into the VM via primitives or the image via DLLCC.

I can't say if "Cincom really want to move all their own work on Widgetry." Mike Hales is a customer who's chosen to do that. He got excited by what he saw Cairo being able to do, and decided to do that.

I'm not sure what you mean by low-level Cairo calls, the Cairo calls (methods) lie at about the same level as the various GC methods. Drawing with Cairo consumes about the same number of lines of code as doing so with GCs. 

Three separate (maybe four) people have tried the CairoGraphicsContext approach, none of us has been terribly excited about how it plays out. The problem is that they just don't match. It's like just being able to have Lens code seamlessly work with Glorp. It looks easy at first, and then unravels. I think there's a difference between adding alpha channel to ColorValue in some form or another plus getting the WinGDI to do AA line drawing, and what Cairo does. That's a change under the hood and the ability to blend when copying images. Don't get me wrong, I think that would be great. It would solve the problem you identify. And would require really very little code changes for your existing apps. I don't know what we'd do about X, probably use XFT where available for Text in the Text primitives, and I have no idea what we'd do for AA drawing.

There are things that Cairo does though, that just are not in the GC API at all. Here's a couple off the top of my head:
+ Multipart paths with proper close semantics with support for intermixed beziers (and therefor arcs) and lines.
+ Clipping as a path (rather than a Rectangle).
+ RasterOp ops that are Alpha oriented
+ Affine Transform (not just translation which VW has, but also rotation, scaling, shear, and basically any arbitrary transform)
+ Interstitial path semantics (see page 32 of the StS presentation)
+ Gradients (Radial and Linear)
+ Pattern repetition control (reflect, repeat, pad, none; repeat is the only VW one you get)
+ Stack and Grouping APIs
+ Individual transforms for fonts and patterns
+ Stroke with respects transform
This is not stuff where you just "fixup/twiddle/enhance" a couple of APIs. In some ways, it's because it's a higher level of abstraction that it's appealing for me to write little toolets and demos that use it, and someone like Mike wants to use it for drawing his charts.

Again, to repeat, I'm not trying to disagree with you at all. I think what you're asking for makes sense. My only point is that Cairo is not an Apples-to-Apples comparison with what VW offers today, or could even offer with modest enhancements.

--
Travis Griggs
Objologist
"There are a thousand hacking at the branches of evil to one who is striking at the root" - Henry David Thoreau


Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Travis Griggs-3
Upon reflection (and a nice walk-n-talk to the local Subway), I think the synopsis of this discussion might be boiled down to two viewpoints:

1) I'm fine with the VW GC API, but want what it does to be done better.
2) The VW GC API is old fashioned, I don't care how it does what it does, but I want an API that does more things.

There are some overlaps surely. To date, those of us who have been playing with Cairo are probably more in the #2 camp.

--
Travis Griggs
Objologist
Time and Countertops. They both get used up way too fast.


Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Boris Popov, DeepCove Labs (SNN)

Ah, but surely time dimension is another factor for a lot of people,

 

1) I may not be happy with the current GC API, but I’d like what is there to look better ASAP

2) I am not happy with the current GC API, but I don’t mind someone taking the time to rewrite all look policies to use a new API

 

;)

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.


From: Travis Griggs [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 12:57 PM
To: vwnc-list
Subject: Re: VW graphical look [Was: Re: MacOS X]

 

Upon reflection (and a nice walk-n-talk to the local Subway), I think the synopsis of this discussion might be boiled down to two viewpoints:

 

1) I'm fine with the VW GC API, but want what it does to be done better.

2) The VW GC API is old fashioned, I don't care how it does what it does, but I want an API that does more things.

 

There are some overlaps surely. To date, those of us who have been playing with Cairo are probably more in the #2 camp.

 

--

Travis Griggs

Objologist

Time and Countertops. They both get used up way too fast.



 

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Carl Gundel
In reply to this post by Travis Griggs-3
> Upon reflection (and a nice walk-n-talk to the local Subway), I think
> the synopsis of this discussion might be boiled down to two viewpoints:
>
> 1) I'm fine with the VW GC API, but want what it does to be done better.
> 2) The VW GC API is old fashioned, I don't care how it does what it
> does, but I want an API that does more things.
>
> There are some overlaps surely. To date, those of us who have been
> playing with Cairo are probably more in the #2 camp.

Is it possible for a Cairo based solution to be integrated with the VM?  I'm
not especially interested in a solution that requires an external library.

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com


Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Boris Popov, DeepCove Labs (SNN)
I would imagine so, considering current VM is actually an "external
library" itself,

vwnt.exe + vwntoe.dll = visual.exe

;)

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: Carl Gundel [mailto:[hidden email]]
> Sent: Thursday, May 24, 2007 1:12 PM
> To: vwnc-list
> Subject: Re: VW graphical look [Was: Re: MacOS X]
>
> > Upon reflection (and a nice walk-n-talk to the local Subway), I
think
> > the synopsis of this discussion might be boiled down to two
viewpoints:
> >
> > 1) I'm fine with the VW GC API, but want what it does to be done
better.
> > 2) The VW GC API is old fashioned, I don't care how it does what it
> > does, but I want an API that does more things.
> >
> > There are some overlaps surely. To date, those of us who have been
> > playing with Cairo are probably more in the #2 camp.
>
> Is it possible for a Cairo based solution to be integrated with the
VM?
> I'm
> not especially interested in a solution that requires an external
library.
>
> -Carl Gundel, author of Liberty BASIC
> http://www.libertybasic.com
>

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Carl Gundel
That's interesting.  How many library files does Cairo consist of, and how
large are they?

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com

----- Original Message -----
From: "Boris Popov" <[hidden email]>
To: "Carl Gundel" <[hidden email]>; "vwnc-list" <[hidden email]>
Sent: Thursday, May 24, 2007 4:15 PM
Subject: RE: VW graphical look [Was: Re: MacOS X]


I would imagine so, considering current VM is actually an "external
library" itself,

vwnt.exe + vwntoe.dll = visual.exe

;)

-Boris



Reply | Threaded
Open this post in threaded view
|

RE: VW graphical look [Was: Re: MacOS X]

Boris Popov, DeepCove Labs (SNN)
Win32 build of 1.4.0 is just over 500K, but that's not including Pango
and friends. Does it matter much?

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: Carl Gundel [mailto:[hidden email]]
> Sent: Thursday, May 24, 2007 1:20 PM
> To: vwnc-list
> Subject: Re: VW graphical look [Was: Re: MacOS X]
>
> That's interesting.  How many library files does Cairo consist of, and
how
> large are they?
>
> -Carl Gundel, author of Liberty BASIC
> http://www.libertybasic.com
>
> ----- Original Message -----
> From: "Boris Popov" <[hidden email]>
> To: "Carl Gundel" <[hidden email]>; "vwnc-list"
<[hidden email]>

> Sent: Thursday, May 24, 2007 4:15 PM
> Subject: RE: VW graphical look [Was: Re: MacOS X]
>
>
> I would imagine so, considering current VM is actually an "external
> library" itself,
>
> vwnt.exe + vwntoe.dll = visual.exe
>
> ;)
>
> -Boris
>
>

Reply | Threaded
Open this post in threaded view
|

Re: VW graphical look [Was: Re: MacOS X]

Carl Gundel
That's not huge, but not small either.  Does it matter?  It does matter to
me and to my customers.  The BASIC programming community is culturally
averse to large distributions.  A lot of noise is made that Liberty BASIC
produces runtimes (based on repackaged VisualSmalltalk runtimes) that are
2.2MB.  They would prefer 100K.  The new stuff I'm doing with VisualWorks is
going to be bigger, and another 500K wouldn't help.

As for the web BASIC stuff I'm doing, distribution size matters less.

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com

----- Original Message -----
From: "Boris Popov" <[hidden email]>
To: "Carl Gundel" <[hidden email]>; "vwnc-list" <[hidden email]>
Sent: Thursday, May 24, 2007 4:21 PM
Subject: RE: VW graphical look [Was: Re: MacOS X]


Win32 build of 1.4.0 is just over 500K, but that's not including Pango
and friends. Does it matter much?



12