[gtk+] gtkcssshadowvalue: Use cairo_surface_create_similar_image
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkcssshadowvalue: Use cairo_surface_create_similar_image
- Date: Tue, 2 Sep 2014 18:28:34 +0000 (UTC)
commit e6a0378289909a5ac6f7824560147565eb01737e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Sep 2 11:21:02 2014 -0700
gtkcssshadowvalue: Use cairo_surface_create_similar_image
Calling this on an Xlib surface allows us to keep this in SHM memory,
giving it a potential speedup so we don't have to copy it to SHM memory
for the Composite when we mask later.
gtk/gtkcssshadowvalue.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index 671f4f0..7f72698 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -331,9 +331,10 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
clip_radius = _gtk_cairo_blur_compute_pixels (radius);
/* Create a larger surface to center the blur. */
- surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
- clip_rect.width + 2 * clip_radius,
- clip_rect.height + 2 * clip_radius);
+ surface = cairo_surface_create_similar_image (cairo_get_target (cr),
+ CAIRO_FORMAT_A8,
+ clip_rect.width + 2 * clip_radius,
+ clip_rect.height + 2 * clip_radius);
cairo_surface_set_device_offset (surface, clip_radius - clip_rect.x, clip_radius - clip_rect.y);
blur_cr = cairo_create (surface);
cairo_set_user_data (blur_cr, &shadow_key, cairo_reference (cr), (cairo_destroy_func_t) cairo_destroy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]