[gnome-games] iagno: use a similar surface for the tile cache



commit c02654d374be8f37783c19880b86445687951f3a
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Jan 23 22:36:17 2012 -0500

    iagno: use a similar surface for the tile cache
    
    This stores the cached tiles in the X server (probably in video memory)
    which makes rendering them quite a lot faster.  We were currently
    storing them locally and sending them to the X server for each frame.
    This should solve any problems with poor animation performance.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668552

 iagno/src/game-view.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/iagno/src/game-view.vala b/iagno/src/game-view.vala
index 50f9960..7466bdb 100644
--- a/iagno/src/game-view.vala
+++ b/iagno/src/game-view.vala
@@ -102,7 +102,7 @@ public class GameView : Gtk.DrawingArea
         if (tiles_pattern == null || render_size != tile_size)
         {
             render_size = tile_size;
-            var surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, tile_size * 8, tile_size * 4);
+            var surface = new Cairo.Surface.similar (cr.get_target (), Cairo.Content.COLOR_ALPHA, tile_size * 8, tile_size * 4);
             var c = new Cairo.Context (surface);
             var pixbuf = theme.render (tile_size * 8, tile_size * 4);
             Gdk.cairo_set_source_pixbuf (c, pixbuf, 0, 0);



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