GNOME Bugzilla – Bug 720560
The background should be drawn explicitly
Last modified: 2013-12-20 23:54:59 UTC
Created attachment 264329 [details] [review] The patch Details in the commit log of the upcoming patch. The gdk_window_set_background_pattern() should basically not be used outside of core GTK+.
Review of attachment 264329 [details] [review]: Thanks for the patch, looks nice. My only objection is that in your version the pattern is created in each iteration, which might be expensive, and unnecessary, as far as I see. We could add the pattern as a member of loadgraph, and we wouldn't have to create it in each iteration, paint it, and destroy it, but create it only after the graph->background has changed (inside the if) and destroy the pattern with the loadgraph or on graph change. What do you think?
(In reply to comment #1) > Review of attachment 264329 [details] [review]: > > Thanks for the patch, looks nice. My only objection is that in your version the > pattern is created in each iteration, which might be expensive, and > unnecessary, as far as I see. We could add the pattern as a member of > loadgraph, and we wouldn't have to create it in each iteration, paint it, and > destroy it, but create it only after the graph->background has changed (inside > the if) and destroy the pattern with the loadgraph or on graph change. What do > you think? Well, creating a pattern is cheap in cairo. It happens internally in cairo every time cairo_set_source_rgba() is called after all. However, caching the pattern should be harmless I think, so I'm fine with this. New patch coming up. (An alternative would be to use cairo_set_source_surface() instead of creating the pattern explicitly, though this causes cairo to create a pattern internally).
Created attachment 264646 [details] [review] New patch
Created attachment 264647 [details] [review] Patch New version that includes the changes to load-graph.h
Created attachment 264648 [details] [review] Another version Apparently I had two identically named files with different contents
Review of attachment 264648 [details] [review]: Thanks for the fix, looks ok, applied to trunk, committed.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.