[gtk+] gsk: Use GskRenderer.create_cairo_surface()



commit a203b8cc284b724d6a555e940a5633fc612372b1
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Oct 31 16:28:09 2016 +0000

    gsk: Use GskRenderer.create_cairo_surface()
    
    GskRenderNode should ask the renderer for a Cairo surface when creating
    a drawing context.

 gsk/gskrendernode.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index e9d345e..6d2cf87 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -45,6 +45,7 @@
 
 #include "gskdebugprivate.h"
 #include "gskrendernodeiter.h"
+#include "gskrendererprivate.h"
 
 #include <graphene-gobject.h>
 
@@ -1412,14 +1413,11 @@ gsk_render_node_get_draw_context (GskRenderNode *node)
 
   if (node->surface == NULL)
     {
-      int scale_factor = gsk_renderer_get_scale_factor (node->renderer);
-      int width = node->bounds.size.width * scale_factor;
-      int height = node->bounds.size.height * scale_factor;
-
-      node->surface = cairo_image_surface_create (node->opaque ? CAIRO_FORMAT_RGB24
-                                                               : CAIRO_FORMAT_ARGB32,
-                                                  width, height);
-      cairo_surface_set_device_scale (node->surface, scale_factor, scale_factor);
+      node->surface = gsk_renderer_create_cairo_surface (node->renderer,
+                                                         node->opaque ? CAIRO_FORMAT_RGB24
+                                                                      : CAIRO_FORMAT_ARGB32,
+                                                         node->bounds.size.width,
+                                                         node->bounds.size.height);
     }
 
   res = cairo_create (node->surface);


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