ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Graphical Composition in Avalon
Subject:   macos x already works like this
Date:   2004-03-09 07:15:49
From:   igriffiths
Response to: macos x already works like this

Sort of... (I'm the author of this article. I've also done some Mac OS X programming.) Quartz is considerably more advanced than Win32, but Avalon actually leapfrogs Quartz.


Quartz uses composition, but despite the fact that it also has extensive support for vector drawing, there is a big limitation: there is no vector-level retention - as I understand it the composition is done *after* the rasterization of the vector imagery. The vector support in Mac OS X actually works in pretty much exactly the same way as GDI+ does in current versions of Windows, and is not integrated into the composition engine.


Compare this with Avalon, which uses vector-level retention as part of its composition model, and can interleave multiple transform and rasterization steps as a result. (It can also retain bitmaps as an optimization, but it always retains vector information too.) This enables transforms to be integrated with the composition engine. Transforms in Quartz are done much more like current versions of Windows handle them - they are dealt with at the level of a drawing context when the application generates its imagery. (At least that's how I've always seen it done. If you can point me at an example that shows transformations at the composition level rather than the drawing level in Quartz, I'd be very interested to see that.)


What does this mean in practice? Well for one thing, it makes life easier for the developer: in Avalon, you can adjust a transform object and the display will reflect that change automatically - the composition engine can handle such changes implicitly. In Quartz, you'd have to handle all your own redrawing, just like you do today in GDI+ on Windows, because both Quartz and GDI+ use bitmaps as the only kind of retainable drawing.


But there are also implications for the quality of user experience: as far as I know, Quartz doesn't have a good way of dealing with high-dpi displays. With Avalon, the desktop composition engine will be able to apply a scale transform to an entire window. While Quartz can scale and stretch windows too (e.g. when you minimize a window to the dock), because the composition model is downstream of the rasterizer, the results will be of suboptimal quality - it'll look a bit fuzzy, like a scaled bitmap. (Whereas a scaled UI in Avalon will look like a scaled vector drawing looks: every bit as crisp and clean as it did before scaling.) Quartz gets away with this for high-speed animations like minimization because they're over before you have a chance to see the imperfections. But it would not stand up to close sustained scrutiny. And a crummy image would completely defeat the purpose of a high-dpi display!


So Quartz doesn't appear to deliver the full advantages a composition model can offer both developers and users. (But I should admit that I'm not a Quartz expert. But I spent a long time trying to get it to do all this stuff, because when I first started learning to develop on OS X, I was really hoping that Quartz would be the graphics system I really wanted. I was looking forward to seeing what the composition engine could do. I was somewhat disappointed with what I found, both with the available examples, and with what my own experiments revealed. And also with what applications seem to do with it in practice. But if you think I just didn't look in the right places, I'd love to learn how better to exploit Quartz.)


1 to 3 of 3
  1. macos x already works like this
    2004-03-09 13:14:57  zootbobbalu [View]

    • Ian Griffiths photo macos x already works like this
      2004-03-10 03:20:33  Ian Griffiths | O'Reilly Author [View]

      • macos x already works like this
        2004-03-10 06:34:39  zootbobbalu [View]

        • macos x already works like this
          2004-04-06 05:38:43  musnat [View]

        • Ian Griffiths photo macos x already works like this
          2004-03-10 09:58:42  Ian Griffiths | O'Reilly Author [View]

          • macos x already works like this
            2004-03-10 13:20:16  zootbobbalu [View]

            • macos x already works like this
              2004-04-06 05:50:12  musnat [View]

            • Ian Griffiths photo macos x already works like this
              2004-03-11 04:58:13  Ian Griffiths | O'Reilly Author [View]

              • macos x already works like this
                2004-03-11 13:40:55  rosyna [View]

                • Ian Griffiths photo macos x already works like this
                  2004-03-12 00:28:19  Ian Griffiths | O'Reilly Author [View]

                  • macos x already works like this
                    2004-03-14 10:23:25  mweiher [View]

                    • Ian Griffiths photo macos x already works like this
                      2004-03-15 05:51:48  Ian Griffiths | O'Reilly Author [View]

                      • macos x already works like this
                        2004-04-06 06:17:25  musnat [View]

                      • Ian Griffiths photo macos x already works like this
                        2004-03-17 04:33:50  Ian Griffiths | O'Reilly Author [View]

                      • macos x already works like this
                        2004-03-15 13:58:01  mweiher [View]

                        • ...
  2. James Duncan Davidson photo macos x already works like this
    2004-03-09 10:07:15  James Duncan Davidson | O'Reilly AuthorO'Reilly Blogger [View]

  3. macos x already works like this
    2004-03-09 08:36:39  jannino [View]

1 to 3 of 3