mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
gsk: Use GskRenderer.create_cairo_surface()
GskRenderNode should ask the renderer for a Cairo surface when creating a drawing context.
This commit is contained in:
parent
50a5deb8e3
commit
a203b8cc28
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user