[gnome-system-monitor] Use cairo_surface instead of cairo_pattern



commit f976db2ef0aef0f98b537a1fb5b5d099de5501b6
Author: Robert Roth <robert roth off gmail com>
Date:   Fri Jan 17 10:11:52 2014 +0200

    Use cairo_surface instead of cairo_pattern

 src/load-graph.cpp |    7 +++----
 src/load-graph.h   |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index cd87349..cbb0817 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -19,7 +19,7 @@
 void LoadGraph::clear_background()
 {
     if (background) {
-        cairo_pattern_destroy (background);
+        cairo_surface_destroy (background);
         background = NULL;
     }
 }
@@ -174,8 +174,7 @@ void draw_background(LoadGraph *graph) {
     g_object_unref(layout);
     cairo_stroke (cr);
     cairo_destroy (cr);
-    graph->background = cairo_pattern_create_for_surface (surface);
-    cairo_surface_destroy (surface);
+    graph->background = surface;
 }
 
 /* Redraws the backing buffer for the load graph and updates the window */
@@ -245,7 +244,7 @@ load_graph_draw (GtkWidget *widget,
     if (graph->background == NULL) {
         draw_background(graph);
     }
-    cairo_set_source (cr, graph->background);
+    cairo_set_source_surface (cr, graph->background, 0, 0);
     cairo_paint (cr);
 
     cairo_set_line_width (cr, 1);
diff --git a/src/load-graph.h b/src/load-graph.h
index 8674daf..7d09f33 100644
--- a/src/load-graph.h
+++ b/src/load-graph.h
@@ -64,7 +64,7 @@ struct LoadGraph
     GtkWidget *main_widget;
     GtkWidget *disp;
 
-    cairo_pattern_t *background;
+    cairo_surface_t *background;
 
     guint timer_index;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]