1. 09 May, 2013 10 commits
  2. 08 May, 2013 5 commits
  3. 07 May, 2013 25 commits
    • Rico Tzschichholz's avatar
      Remove abi checking scripts (2) · d08d7f2c
      Rico Tzschichholz authored
      In addition to 019ad964
    • Alexander Larsson's avatar
      GtkPixelCache: Free cache if not used in 20 seconds · 8ae7defa
      Alexander Larsson authored
      No need to keep a performance enhancing cache around if its not
      actually in use.
    • Alexander Larsson's avatar
      gdkwindow: Expose all native windows · e90fab2b
      Alexander Larsson authored
      We need to send exposes for all native windows, even the ones
      without an exposure mask set, because otherwise non-native
      children of the native window with an exposure mask will
      not be drawn.
    • Alexander Larsson's avatar
      GtkStack: Fix double-draw in crossfade · e2c8a95a
      Alexander Larsson authored
      We should only draw the cross-fade on the bin window, not doing this
      was causing us to draw it multiple times using ADD which resulted
      in weird colors.
    • Alexander Larsson's avatar
      gdkwindow: Avoid some unnecessary typechecks · 36100051
      Alexander Larsson authored
      This removes the typechecks in GDK_WINDOW_TYPE and GDK_WINDOW_DESTROYED. These
      are only used internally in gdkwindow.c and gdkdisplay.c anyway,  and these
      functions check for typesafety of arguments on function entry.
    • Alexander Larsson's avatar
      GtkWidget: Use gdk_window_get_children_for_user_data · 0600d3d7
      Alexander Larsson authored
      This makes iterating over the children a lot faster, as we're
      not doing lots of intra-library calls and type checks. We're still
      in some sence O(n^2) since we iterate over each child window for each
      widget, but the profiles look much better.
    • Alexander Larsson's avatar
      Add gdk_window_get_children_with_user_data · adffcf8a
      Alexander Larsson authored
      This function returns all the children that has a specific user_data set.
      This is used a lot in the new GtkWidget drawing code and doing
      it this way is faster than getting every child and calling get_user_data
      on each (which was a non-neglible part of the profiles). Additionally it
      also allows use to use some kind of hashtable to make this operation even
      faster if needed in the future.
    • Alexander Larsson's avatar
      GtkTreeView: port to PixelCache · cad751c7
      Alexander Larsson authored
      We register an invalidate handler on the bin window to get told
      of child widget invalidations, although we manually need to discard
      invalidates from the scroll operation.
      Additionally we invalidate all of the pixel cache whenever
      the TreeView itself is queue_draw()n to handle e.g. style (bg)
      changes, or changes due to model changes causing queue_draw() in
      the tree view.
    • Alexander Larsson's avatar
      Make GtkViewport use GtkPixelCache · 2df27ce7
      Alexander Larsson authored
      Since gdk_window_move() no longer uses XCopyArea all scrolling
      now re-renders everything in the window. To get performance
      back we use a GtkPixelCache to store already drawn children,
      and we when we expose the viewport we just blit the
      offscreen to the right place.
    • Alexander Larsson's avatar
      GtkPixelCache: Add debug feature to track redraws · dde71438
      Alexander Larsson authored
      Each time we redraw we tint it in a different color so that
      you can see which regions are redrawn.
    • Alexander Larsson's avatar
      Add GtkPixelCache · 30dc399b
      Alexander Larsson authored
      GtkPixelCache is a helper utility that lets you implement
      faster scrolling of a viewport of a canvas by using an
      offscreen pixmap cache.
      You call _gtk_pixel_cache_draw with a callback function that
      does the drawing, and additionally you specify the size and the
      position of the viewport in the widget, and the position and size
      of the canvas wrt the viewport. The callback will be called to
      draw on an offscreen surface, and the surface will be drawn
      on the window. The next time you do the same, any already drawn
      pieces of the surface are re-used from the offscreen and need
      not be rendered again.
      If things inside the canvas change you need to call
      _gtk_pixel_cache_invalidate to tell the cache about this.
      Some other details:
      * The offscreen surface is generally a bit larger than
        the viewport, so scrolling a small amount can often
        be done without redrawing children.
      * If the canvas is not larger than the viewport no
        offscreen surface is used.
      GtkPixelCache: Make sure we always copy using SOURCE
      We were using OVER for the first copy (from source to group surface.
      GtkPixelCache: Fix x/y typos
      GtkPixelCache: Allow NULL for invalidate region
      gtkpixelcache: Use CONTENT_COLOR for solid bg windows
    • Alexander Larsson's avatar
      GtkWidget: Add a vfunc for queue_draw_region · cb2882a2
      Alexander Larsson authored
      Since widgets now cache drawn state we allow them to override
      queue_draw_region to detect when some region of the widget
      should be redrawn. For instance, if a widget draws the
      background color in a pixel cache we will need to invalidate
      that when the style context changes which queues a repaint.
    • Alexander Larsson's avatar
      Add gdk_window_set_invalidate_handler · e13fb1d3
      Alexander Larsson authored
      This lets you register callbacks for when child widgets invalidate
      areas of the window read it and/or change it.
      For instance, this lets you do rendering effects and keeping offscreen
      caches uptodate.
    • Alexander Larsson's avatar
      wayland: Don't use double buffers for wayland when not needed · 590366f0
      Alexander Larsson authored
      If we got the release event for the last buffer then we're
      fine with writing directly to the window surface, as wayland
      will not be looing at it. This saves us from allocating
      and copying more data.
    • Alexander Larsson's avatar
      gdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncs · 61159611
      Alexander Larsson authored
      There is no need for this to be a separate interface, its just looking
    • Alexander Larsson's avatar
      gdkwindow: Change how paints work · e09b4fa0
      Alexander Larsson authored
      First of all, we now only do paints on native windows, as there is
      really no reason anymore to do it for subwindows. Secondly, we
      keep track of the paints even for GtkPaintable windows, but for
      that case we don't create the offscreen surface, but rather
      assume the windowing system does the backing store.
    • Alexander Larsson's avatar
      GtkWindow: Move cairo_save/restore from marshaller · 6c768950
      Alexander Larsson authored
      We do the save/restore when emitting ::draw rather than in a custom
      marshaller, as this saves an extra stack frame, which is helpfull now
      that we do painting fully recursive. This is also likely to save a few
    • Alexander Larsson's avatar
      gdkframeclock: Loop the layout phase if needed · c3bff30b
      Alexander Larsson authored
      In the case where the layout phase queued a layout we don't
      want to progress to the paint phase with invalid allocations, so
      we loop the layout. This shouldn't normally happen, but it may
      happen in some edge cases like if user/wm resizes clash with
      natural window size changes from a gtk widget. This should not
      generally loop though, so we detect this after 4 cycles and
      print a warning.
      This was detected because of an issue in GtkWindow where it
      seems to incorrectly handle the case of a user interactive resize.
      It seems gtk_window_move_resize() believes that configure_request_size_changed
      changed due to hitting some corner case so it calls
      gtk_widget_queue_resize_no_redraw(), marking the window as need_alloc
      after the layout phase. This commit fixes the issue, but we should
      also look into if we can fix that.
    • Alexander Larsson's avatar
      gdkwindow: Simplify invalidation · e0ca53ff
      Alexander Larsson authored
      Now that all windows are non-opaque we can simplify the invalidation
      a lot. There is no need to clip the invalidate area to child regions,
      because we will always redraw everything under all the children.
      We only have to handle native childen specially.
    • Alexander Larsson's avatar
      gdkwindow: Remove implicit paints · fe098281
      Alexander Larsson authored
      We now only do one expose event per native window, so there will
      only be one begin/end_paint() call. This means all the work with
      implicit paints to combine the paints on a single double buffer
      surface is unnecessary, so we can just delete it.
    • Alexander Larsson's avatar
      Only handle exposes on native window, propagate to children via draw() · d22fd722
      Alexander Larsson authored
      We now consider non-native windows non-opaque, which means any invalid
      area in a subwindow will also be invalid all the way up to the nearest
      native windows. We take advantage of this by ignoring all expose events
      on non-native windows (which typically means just the toplevel) and instead
      propagating down the draw() calls to children directly via
      This is nice as it means we always draw widgets the same way, and it
      will let us do some interesting ways in the future.
      We also clean up the GtkWidget opacity handling as we can now always
      rely on the draing happening via cairo.
      We can't really just draw by walking down the widget hierarchy, as
      this doesn't get the clipping right (so e.g. widgets doing cairo_paint
      may draw outside the expected gdkwindow subarea) nor does it let
      us paint window backgrounds.
      So, we now do multiple draws for each widget, once for each GdkWindow,
      although we still do it on the same base cairo_t that we get for the
      toplevel native window. The difference is only the clipping, the rendering
      order, and which other widgets we propagate into.
      We also collect all the windows of a widget so we can expose them inside
      the same opacity group if needed.
      NOTE: This change neuters gtk_widget_set_double_buffered for
      widgets without native windows. Its impossible to disable
      the double buffering in this model.
    • Alexander Larsson's avatar
      gdkwindow: Remove ancient USE_BACKING_STORE define · fc645f28
      Alexander Larsson authored
      This is always set anyway.
    • Alexander Larsson's avatar
      gdkwindow: Simplify clip region calculations · 1f986ff9
      Alexander Larsson authored
      Since we no longer make overlapping siblings affect clip_region we
      can further simplify the clip region calculation and updating.
    • Alexander Larsson's avatar
      gdkwindow: Simplify clip region handling · 5773cf23
      Alexander Larsson authored
      Since we dropped the move region optimization there is really no need
      to try carefully keep track of opaque non-overlapped regions, as we
      don't use this information to trigger the optimization anymore.
      So, by assuming that all windows are non-opaque we can vastly simplify
      the clip region stuff. First of all, we don't need clip_region_with_children,
      as each window will need to draw under all children anyway. Secondly, we
      don't remove overlapping sibling areas from clip_region, as these are
      all non-opaque anyway and we need to draw under them
      Finally, we don't need to track the layered region anymore as its
      essentially unused. The few times something like it is needed we can
      compute it explicitly.
      For the case of native children of widgets we may cause a repaint
      under native windows that are guaranteed to be opaque, but these
      will be clipped by the native child anyway.
    • Alexander Larsson's avatar
      gdkwindow: Remove translate vfunc · 19560bf0
      Alexander Larsson authored
      This is not used anymore