[gtk+/rendering-cleanup-next: 69/155] viewport: No need to check if the widget is drawable anymore
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 69/155] viewport: No need to check if the widget is drawable anymore
- Date: Wed, 15 Sep 2010 03:02:43 +0000 (UTC)
commit 8b261a4a0a6e674eb889024eabb97aa21467298f
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 14 13:11:53 2010 +0200
viewport: No need to check if the widget is drawable anymore
gtk/gtkviewport.c | 51 ++++++++++++++++++++++++---------------------------
1 files changed, 24 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 6858ceb..035d0dc 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -767,34 +767,31 @@ static gint
gtk_viewport_draw (GtkWidget *widget,
cairo_t *cr)
{
- if (gtk_widget_is_drawable (widget))
+ GtkViewport *viewport = GTK_VIEWPORT (widget);
+ GtkViewportPrivate *priv = viewport->priv;
+ int x, y, w, h;
+
+ if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
{
- GtkViewport *viewport = GTK_VIEWPORT (widget);
- GtkViewportPrivate *priv = viewport->priv;
- int x, y, w, h;
-
- if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
- {
- gdk_drawable_get_size (gtk_widget_get_window (widget),
- &w, &h);
- gtk_cairo_paint_shadow (gtk_widget_get_style (widget),
- cr,
- GTK_STATE_NORMAL, priv->shadow_type,
- widget, "viewport",
- 0, 0, w, h);
- }
-
- if (gtk_cairo_should_draw_window (cr, priv->bin_window))
- {
- gdk_window_get_position (priv->bin_window, &x, &y);
- gdk_drawable_get_size (priv->bin_window, &w, &h);
- gtk_cairo_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- widget, "viewportbin",
- x, y, w, h);
-
- GTK_WIDGET_CLASS (gtk_viewport_parent_class)->draw (widget, cr);
- }
+ gdk_drawable_get_size (gtk_widget_get_window (widget),
+ &w, &h);
+ gtk_cairo_paint_shadow (gtk_widget_get_style (widget),
+ cr,
+ GTK_STATE_NORMAL, priv->shadow_type,
+ widget, "viewport",
+ 0, 0, w, h);
+ }
+
+ if (gtk_cairo_should_draw_window (cr, priv->bin_window))
+ {
+ gdk_window_get_position (priv->bin_window, &x, &y);
+ gdk_drawable_get_size (priv->bin_window, &w, &h);
+ gtk_cairo_paint_flat_box (gtk_widget_get_style (widget), cr,
+ GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ widget, "viewportbin",
+ x, y, w, h);
+
+ GTK_WIDGET_CLASS (gtk_viewport_parent_class)->draw (widget, cr);
}
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]