OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. | 2 * Copyright (C) 2007 Apple Inc. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2008 Collabora Ltd. | 4 * Copyright (C) 2008 Collabora Ltd. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "RenderThemeGtk.h" | 24 #include "RenderThemeGtk.h" |
25 | 25 |
26 #include "AffineTransform.h" | 26 #include "AffineTransform.h" |
27 #include "GraphicsContext.h" | 27 #include "GraphicsContext.h" |
28 #include "NotImplemented.h" | 28 #include "NotImplemented.h" |
29 #include "PlatformContextSkia.h" | 29 #include "PlatformContextSkia.h" |
30 #include "RenderObject.h" | 30 #include "RenderObject.h" |
31 #include "gtkdrawing.h" | 31 #include "gtkdrawing.h" |
32 #include "gdkskiadrawable.h" | 32 #include "GdkSkia.h" |
33 | 33 |
34 #include <gdk/gdk.h> | 34 #include <gdk/gdk.h> |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 static Color makeColor(const GdkColor& c) | 38 static Color makeColor(const GdkColor& c) |
39 { | 39 { |
40 return Color(makeRGB(c.red >> 8, c.green >> 8, c.blue >> 8)); | 40 return Color(makeRGB(c.red >> 8, c.green >> 8, c.blue >> 8)); |
41 } | 41 } |
42 | 42 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 const SkIRect clip_region = canvas->getTotalClip().getBounds(); | 176 const SkIRect clip_region = canvas->getTotalClip().getBounds(); |
177 | 177 |
178 GdkRectangle gdkClipRect; | 178 GdkRectangle gdkClipRect; |
179 gdkClipRect.x = clip_region.fLeft; | 179 gdkClipRect.x = clip_region.fLeft; |
180 gdkClipRect.y = clip_region.fTop; | 180 gdkClipRect.y = clip_region.fTop; |
181 gdkClipRect.width = clip_region.width(); | 181 gdkClipRect.width = clip_region.width(); |
182 gdkClipRect.height = clip_region.height(); | 182 gdkClipRect.height = clip_region.height(); |
183 | 183 |
184 gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect); | 184 gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect); |
185 | 185 |
186 // TODO(agl): we should look at not creating this anew every time. | 186 const gint r = |
187 GdkSkia* skiadrawable = gdk_skia_new(canvas); | 187 moz_gtk_widget_paint(type, pcs->gdk_skia(), &gdkRect, &gdkClipRect, &mozSt
ate, flags, direction) != MOZ_GTK_SUCCESS; |
188 | 188 |
189 const gint r = | |
190 moz_gtk_widget_paint(type, skiadrawable, &gdkRect, &gdkClipRect, &mozState
, flags, direction) != MOZ_GTK_SUCCESS; | |
191 | |
192 g_object_unref(skiadrawable); | |
193 return r; | 189 return r; |
194 } | 190 } |
195 | 191 |
196 static void setButtonPadding(RenderStyle* style) | 192 static void setButtonPadding(RenderStyle* style) |
197 { | 193 { |
198 // FIXME: This looks incorrect. | 194 // FIXME: This looks incorrect. |
199 const int padding = 8; | 195 const int padding = 8; |
200 style->setPaddingLeft(Length(padding, Fixed)); | 196 style->setPaddingLeft(Length(padding, Fixed)); |
201 style->setPaddingRight(Length(padding, Fixed)); | 197 style->setPaddingRight(Length(padding, Fixed)); |
202 style->setPaddingTop(Length(padding / 2, Fixed)); | 198 style->setPaddingTop(Length(padding / 2, Fixed)); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 475 |
480 m_gtkTreeView = gtk_tree_view_new(); | 476 m_gtkTreeView = gtk_tree_view_new(); |
481 g_signal_connect(m_gtkTreeView, "style-set", G_CALLBACK(gtkStyleSetCallback)
, theme()); | 477 g_signal_connect(m_gtkTreeView, "style-set", G_CALLBACK(gtkStyleSetCallback)
, theme()); |
482 gtk_container_add(gtkContainer(), m_gtkTreeView); | 478 gtk_container_add(gtkContainer(), m_gtkTreeView); |
483 gtk_widget_realize(m_gtkTreeView); | 479 gtk_widget_realize(m_gtkTreeView); |
484 | 480 |
485 return m_gtkTreeView; | 481 return m_gtkTreeView; |
486 } | 482 } |
487 | 483 |
488 } | 484 } |
OLD | NEW |