[gtk+] textview: give pixelcache access to style context
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] textview: give pixelcache access to style context
- Date: Sun, 13 Sep 2015 20:41:44 +0000 (UTC)
commit a3605bc5573253bfbb1e16ca762ce7bcc8700c02
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 8 15:36:07 2015 -0700
textview: give pixelcache access to style context
This changes textview to share the style context with the pixelcache.
Doing so allows pixel cache to optimize the surface creation and use
a CAIRO_CONTENT_COLOR instead of CAIRO_CONTENT_COLOR_ALPHA when
appropriate.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
gtk/gtktextview.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 6dd70c4..697d63f 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -1644,6 +1644,7 @@ gtk_text_view_init (GtkTextView *text_view)
GtkWidget *widget = GTK_WIDGET (text_view);
GtkTargetList *target_list;
GtkTextViewPrivate *priv;
+ GtkStyleContext *style_context;
text_view->priv = gtk_text_view_get_instance_private (text_view);
priv = text_view->priv;
@@ -1652,6 +1653,9 @@ gtk_text_view_init (GtkTextView *text_view)
priv->pixel_cache = _gtk_pixel_cache_new ();
+ style_context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
+ _gtk_pixel_cache_set_style_context (priv->pixel_cache, style_context);
+
/* Set up default style */
priv->wrap_mode = GTK_WRAP_NONE;
priv->pixels_above_lines = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]