[gtk+] viewport: share style context with pixelcache
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] viewport: share style context with pixelcache
- Date: Sun, 13 Sep 2015 20:41:39 +0000 (UTC)
commit 7c1ce9f3adabee70de886c6d32333650c691e97c
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 8 15:09:04 2015 -0700
viewport: share style context with pixelcache
This allows the pixel cache to opportunistically use CAIRO_CONTENT_COLOR
instead of CAIRO_CONTENT_COLOR_ALPHA during surface creation.
https://bugzilla.gnome.org/show_bug.cgi?id=754658
gtk/gtkviewport.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 6b842b4..9b96605 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -260,6 +260,7 @@ static void
gtk_viewport_init (GtkViewport *viewport)
{
GtkViewportPrivate *priv;
+ GtkStyleContext *style_context;
viewport->priv = gtk_viewport_get_instance_private (viewport);
priv = viewport->priv;
@@ -276,6 +277,9 @@ gtk_viewport_init (GtkViewport *viewport)
priv->pixel_cache = _gtk_pixel_cache_new ();
+ style_context = gtk_widget_get_style_context (GTK_WIDGET (viewport));
+ _gtk_pixel_cache_set_style_context (priv->pixel_cache, style_context);
+
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (viewport)), GTK_STYLE_CLASS_FRAME);
viewport_set_adjustment (viewport, GTK_ORIENTATION_HORIZONTAL, NULL);
viewport_set_adjustment (viewport, GTK_ORIENTATION_VERTICAL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]