summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GtkPixelCache: Free cache if not used in 20 secondswip/simple-draw4Alexander Larsson2013-05-071-0/+33
| | | | | No need to keep a performance enhancing cache around if its not actually in use.
* gdkwindow: Expose all native windowsAlexander Larsson2013-05-071-1/+7
| | | | | | | 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.
* GtkStack: Fix double-draw in crossfadeAlexander Larsson2013-05-071-2/+3
| | | | | | 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.
* gdkwindow: Avoid some unnecessary typechecksAlexander Larsson2013-05-031-2/+2
| | | | | | 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.
* GtkWidget: Use gdk_window_get_children_for_user_dataAlexander Larsson2013-05-031-30/+25
| | | | | | | 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.
* Add gdk_window_get_children_with_user_dataAlexander Larsson2013-05-032-0/+44
| | | | | | | | | 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.
* GtkTreeView: port to PixelCacheAlexander Larsson2013-05-021-30/+110
| | | | | | | | | | | 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.
* Make GtkViewport use GtkPixelCacheAlexander Larsson2013-05-021-22/+82
| | | | | | | | 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.
* GtkPixelCache: Add debug feature to track redrawsAlexander Larsson2013-05-023-2/+25
| | | | | Each time we redraw we tint it in a different color so that you can see which regions are redrawn.
* Add GtkPixelCacheAlexander Larsson2013-05-023-0/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* GtkWidget: Add a vfunc for queue_draw_regionAlexander Larsson2013-05-022-2/+15
| | | | | | | | 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.
* Add gdk_window_set_invalidate_handlerAlexander Larsson2013-05-023-14/+70
| | | | | | | | 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.
* wayland: Don't use double buffers for wayland when not neededAlexander Larsson2013-05-021-11/+47
| | | | | | | 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.
* gdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncsAlexander Larsson2013-05-024-84/+22
| | | | | There is no need for this to be a separate interface, its just looking weird.
* gdkwindow: Change how paints workAlexander Larsson2013-05-021-72/+88
| | | | | | | | 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.
* GtkWindow: Move cairo_save/restore from marshallerAlexander Larsson2013-05-021-62/+8
| | | | | | | 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 cycles.
* gdkframeclock: Loop the layout phase if neededAlexander Larsson2013-05-021-1/+11
| | | | | | | | | | | | | | | | | | 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.
* gdkwindow: Simplify invalidationAlexander Larsson2013-05-021-88/+75
| | | | | | | 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.
* gdkwindow: Remove implicit paintsAlexander Larsson2013-05-022-399/+32
| | | | | | | 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.
* Only handle exposes on native window, propagate to children via draw()Alexander Larsson2013-05-025-202/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 gtk_container_propagate_draw. 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.
* gdkwindow: Remove ancient USE_BACKING_STORE defineAlexander Larsson2013-05-021-7/+0
| | | | This is always set anyway.
* gdkwindow: Simplify clip region calculationsAlexander Larsson2013-05-021-46/+16
| | | | | Since we no longer make overlapping siblings affect clip_region we can further simplify the clip region calculation and updating.
* gdkwindow: Simplify clip region handlingAlexander Larsson2013-05-021-211/+64
| | | | | | | | | | | | | | | | | | | | 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.
* gdkwindow: Remove translate vfuncAlexander Larsson2013-05-028-351/+6
| | | | This is not used anymore
* gdkwindow: Remove outstanding_moves stuffAlexander Larsson2013-05-022-394/+14
| | | | | Since we now never move regions directly on the window we can remove all the stuff that track outstanding moves and flushes then.
* gdk: Don't ever do copies from the windowAlexander Larsson2013-05-021-276/+9
| | | | | | | | This basically neuters gdk_window_move_region, gdk_window_scroll and gdk_window_move_resize, in that they now never copy any bits but just invalidate the source and destination regions. This is a performance loss, but the hope is that the simplifications it later allows will let us recover this performance loss (which mainly affects scrolling).
* a11y: Remove AtkSelection implementation from comboboxBenjamin Otte2013-05-023-112/+1
| | | | | | | | | | AtkSelection requires that the immediate children of the object are the selectable items. The combobox however is implemented with just 1 child: The popup menu. The popup menu is implementing the selectable interface. Test are updated to reflect this change.
* Try this againMatthias Clasen2013-05-021-4/+7
| | | | | When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED error back. Handle it properly.
* Revert "Remove a superfluous ref"Matthias Clasen2013-05-021-2/+5
| | | | | | This reverts commit f326c0eac806b037c7100309887ffc5f9193070d. Grr, turns out that cancelling is not that reliable :-(
* Clear list of attached windows when disposing a widgetMatthias Clasen2013-05-021-0/+3
| | | | | We were silently relying on everybody to detach their windows, and would leak memory otherwise.
* GtkWindow: use a weak ref to keep track of attach_widgetMatthias Clasen2013-05-021-2/+2
| | | | | Taking a full reference of the attach widget creates a reference cycle, and keeps the attach_widget alive longer than it should.
* Remove a superfluous refMatthias Clasen2013-05-021-5/+2
| | | | | | If we cancel the call in dispose, no need to ref the object we pass as userdata. Avoids the risk of leaking the ref if the call is actually canceled.
* Fix buildMatthias Clasen2013-05-021-1/+0
|
* Revert "Temporarily remove window-border reftest"Matthias Clasen2013-05-012-0/+40
| | | | This reverts commit cf6695088e1fe98acdd2ac2e3b5c2f0dd4e7cc5b.
* Revert "Disable the filechooser template tests"Matthias Clasen2013-05-011-3/+0
| | | | This reverts commit 17b9733372f763805b50165f945eee65517c8f06.
* Revert "Disable the object-finalize test for now"Matthias Clasen2013-05-011-3/+3
| | | | This reverts commit a021dc793c163fd427c28d13f49dbf7933d38a46.
* Reenable display manager testsMatthias Clasen2013-05-011-5/+1
| | | | Still broken, but they test the right thing.
* Bump versionMatthias Clasen2013-05-011-1/+1
|
* Remove window-border tests from makefile too3.9.0Matthias Clasen2013-05-011-2/+0
|
* Silence a compiler warningMatthias Clasen2013-05-011-1/+1
|
* Revert "Temporarily remove button-wrapping reftest"Matthias Clasen2013-05-012-0/+400
| | | | This reverts commit 851b631c4e8919530a49346118027a2acdf0a1b8.
* Fix up doc sectionsMatthias Clasen2013-05-011-2/+5
|
* Minor doc comment fixMatthias Clasen2013-05-011-1/+1
|
* Make gtkplacessidebar.h look like a gtk headerMatthias Clasen2013-05-011-14/+21
|
* GtkPlacesSidebar: Correct all since tagsMatthias Clasen2013-05-011-18/+18
|
* Disable broken picker a11y testMatthias Clasen2013-05-012-129/+6
| | | | | The GtkComboBox accessible implementation is pretty broken, and it shows through in this a11y test. Disable it for now.
* Update a few a11y test resultsMatthias Clasen2013-05-015-224/+383
|
* Fix image-load-from-file reftestMatthias Clasen2013-05-011-0/+2
| | | | Need to reset css here to avoid theme interference.
* Temporarily remove grid-span reftestMatthias Clasen2013-05-013-223/+0
| | | | | This was testing grid size allocation changes that had to be reverted because they broke gnumeric.
* Temporarily remove window-border reftestMatthias Clasen2013-05-012-40/+0
| | | | It is broken by unfinished csd changes.