RFC Speeding up graphics

From: Hubert Figuiere (hfiguiere_at_teaser.fr)
Date: Fri Dec 12 2003 - 16:53:14 EST

  • Next message: Dom Lachowicz: "Re: RFC Speeding up graphics"


    While porting AbiWord to MacOS X, I found out a few performance
    problems, mostly due to MacOS X Core Graphics layer, but also to some
    design issues in the GR_Graphics class and its use, in the Abi

    The main problem is that for each graphics operation we need:
    -to setup a graphic context (costly)
    -setup the graphic properties (line size, etc) and clipping
    -do our stuff
    -reset everything
    All of this, at least on MacOS X, but I'm sure that it does too on
    other platforms, it is *costly*. I actually found myself some huge
    bottleneck elsewhere to reduce the overhead, but there is still too
    much IMHO.

    I thought about a solution and found actually 2 that would work for
    any platform, with both pros and cons.

    Solution 1, probably the preferred one:
    -Surround any drawing with startDraw()/endDraw() calls (everywhere in
    XP code)
    -implement these 2 methods to do the setup pre and post draw.
    (GR_Graphics subclass)

     -simple and efficient
     -minimum platform work (initial can be empty implementations)
     -need to track any drawing
    Solution 2, the smarter but more complex:
    -Implement all the drawing operation in XP land (GR_Graphics) to stack
    them up in a graphic pipeline
    -Implement in GR_Graphics::sync() culling of the whole graphic pipeline
    -Make sure we call sync() after each drawing (not each operations)

     -much smarter and elegant
     -can be really efficient
     -large platform rework effort
     -complex and probably harder to debug

    What are your opinions ? If no one object, I'm going to spend time on
    solution 1 as I really need to speed up graphics.


    AbiWord maintainer - Lille, France
    GPG fingerprint: 6C44 DB3E 0BF3 EAF5 B433  239A 5FEE 05E6 A56E 15A3

    This archive was generated by hypermail 2.1.4 : Fri Dec 12 2003 - 16:52:36 EST