[meld] gutterrendererchunk: Use GDK-Cairo API to avoid colour overrides



commit 6ad8e47f60d35f2550f475b54e9e73e998eaf48d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 2 09:30:40 2016 +1000

    gutterrendererchunk: Use GDK-Cairo API to avoid colour overrides
    
    Doing the *colour expansion is surprisingly costly, and unnecessary
    given that the GDK-Cairo integration lets us use an RGBA directly.

 meld/gutterrendererchunk.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 6de3d7d..a44e387 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -16,6 +16,7 @@
 import math
 
 from gi.repository import Pango
+from gi.repository import Gdk
 from gi.repository import Gtk
 from gi.repository import GtkSource
 
@@ -62,7 +63,7 @@ class MeldGutterRenderer(object):
         height = 1 if chunk[1] == chunk[2] else background_area.height
 
         context.set_line_width(1.0)
-        context.set_source_rgba(*self.line_colors[chunk[0]])
+        Gdk.cairo_set_source_rgba(context, self.line_colors[chunk[0]])
         if is_first_line:
             context.move_to(x, y + 0.5)
             context.rel_line_to(width, 0)


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