Skip to content
  • Christian Hergert's avatar
    gutter: add new condensed omni gutter · 64164bde
    Christian Hergert authored
    This is a replacement for the various GtkSourceGutterRenderers that we've had.
    There have been a few downfalls with the previous gutter renderers that we
    wanted to change.
    
    First off, the gutter renderers are very sensitive to performance issues
    because they are not pixel cached. I'm to blame, because I never pixel cached
    those in GtkTextView years ago when adding the pixel cache. However, if we are
    careful, we can generally keep our overhead lower than using the more flexible
    GtkSourceView components (which need to handle more cases than we do).
    
    Another major issue for us was that the size of the gutter was getting too
    large.  The "pack renderers in" design only goes so far before you need to just
    suck it up and implement a combined renderer.
    
    This tries to coalesce as much work as we can up front so that we keep the CPU
    doing similar work in chunks. That's where modern CPUs shine.
    
    Additionally, we cache surfaces instead of pixbufs so that we can avoid a
    surface creation on each render. It costs us roughly 6kb of image surface data
    right now, but we can optimize that out later.
    
    To get things packed tighter, we do some overlapping of content. By making the
    debugger breakpoint arrow fill the background, we also save another 16px (plus
    padding) of space.
    
    The arrow on the breakpoint is over the line changes, so we can save another
    couple pixels as well.
    
    All in all, we have something that looks similar to before, but takes up much
    less space and generally draws as fast if not faster.
    64164bde