[gnome-shell] shell: Get cairo surface via window actor
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell: Get cairo surface via window actor
- Date: Mon, 2 Sep 2019 16:59:24 +0000 (UTC)
commit b73aace4767c52454dabf25cd624f9abd2da6bff
Author: Jonas Ådahl <jadahl gmail com>
Date: Mon Aug 26 16:37:09 2019 +0300
shell: Get cairo surface via window actor
Instead of going via the MetaShapedTexture to get the cairo surface, get
it from the window actor. The window actor can then handle this in a way
that makes it include potential subsurfaces.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/692
src/shell-screenshot.c | 6 ++----
src/shell-util.c | 5 +----
2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index 40481c7cff..c7f0ed2b64 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -5,7 +5,6 @@
#include <meta/display.h>
#include <meta/util.h>
#include <meta/meta-plugin.h>
-#include <meta/meta-shaped-texture.h>
#include <meta/meta-cursor-tracker.h>
#include <st/st.h>
@@ -457,7 +456,6 @@ grab_window_screenshot (ClutterActor *stage,
MetaWindow *window = meta_display_get_focus_window (display);
ClutterActor *window_actor;
gfloat actor_x, actor_y;
- MetaShapedTexture *stex;
MetaRectangle rect;
cairo_rectangle_int_t clip;
@@ -477,8 +475,8 @@ grab_window_screenshot (ClutterActor *stage,
clip.width = priv->screenshot_area.width = rect.width;
clip.height = priv->screenshot_area.height = rect.height;
- stex = META_SHAPED_TEXTURE (meta_window_actor_get_texture (META_WINDOW_ACTOR (window_actor)));
- priv->image = meta_shaped_texture_get_image (stex, &clip);
+ priv->image = meta_window_actor_get_image (META_WINDOW_ACTOR (window_actor),
+ &clip);
priv->datetime = g_date_time_new_now_local ();
if (priv->include_cursor)
diff --git a/src/shell-util.c b/src/shell-util.c
index 5838d23273..01be73b0b0 100644
--- a/src/shell-util.c
+++ b/src/shell-util.c
@@ -20,7 +20,6 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <meta/meta-shaped-texture.h>
#include <locale.h>
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
@@ -430,14 +429,12 @@ ClutterContent *
shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
MetaRectangle *window_rect)
{
- MetaShapedTexture *texture;
ClutterContent *content;
cairo_surface_t *surface;
cairo_rectangle_int_t clip;
gfloat actor_x, actor_y;
gfloat resource_scale;
- texture = meta_window_actor_get_texture (window_actor);
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
@@ -453,7 +450,7 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
clip.width = ceilf (window_rect->width * resource_scale);
clip.height = ceilf (window_rect->height * resource_scale);
- surface = meta_shaped_texture_get_image (texture, &clip);
+ surface = meta_window_actor_get_image (window_actor, &clip);
content = clutter_canvas_new ();
clutter_canvas_set_size (CLUTTER_CANVAS (content),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]