diff options
author | Kristian Monsen <kristianm@google.com> | 2010-05-21 16:53:46 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-05-25 10:24:15 +0100 |
commit | 6c2af9490927c3c5959b5cb07461b646f8b32f6c (patch) | |
tree | f7111b9b22befab472616c1d50ec94eb50f1ec8c /WebCore/platform/gtk/RenderThemeGtk.cpp | |
parent | a149172322a9067c14e8b474a53e63649aa17cad (diff) | |
download | external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.zip external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.gz external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.bz2 |
Merge WebKit at r59636: Initial merge by git
Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91
Diffstat (limited to 'WebCore/platform/gtk/RenderThemeGtk.cpp')
-rw-r--r-- | WebCore/platform/gtk/RenderThemeGtk.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp index 31af1a9..aec50f6 100644 --- a/WebCore/platform/gtk/RenderThemeGtk.cpp +++ b/WebCore/platform/gtk/RenderThemeGtk.cpp @@ -285,14 +285,17 @@ static void setMozillaState(const RenderTheme* theme, GtkWidgetState* state, Ren static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetType type, RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) { - // No GdkWindow to render to, so return true to fall back - if (!i.context->gdkDrawable()) - return true; + GRefPtr<GdkDrawable> pixmap; // Painting is disabled so just claim to have succeeded if (i.context->paintingDisabled()) return false; + // No GdkWindow to render to, so return true to fall back + if (!i.context->gdkDrawable()) + // This is slow, used only during printing process + pixmap = adoptGRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_system()->depth)); + GtkWidgetState mozState; setMozillaState(theme, &mozState, o); @@ -312,11 +315,28 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp break; } + GtkTextDirection direction = gtkTextDirection(o->style()->direction()); + + if (pixmap) { + GdkRectangle gdkRect = IntRect(0, 0, rect.width(), rect.height()); + + moz_gtk_use_theme_parts(theme->partsForDrawable(pixmap.get())); + + bool result = moz_gtk_widget_paint(type, pixmap.get(), &gdkRect, &gdkRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS; + + if (!result) { + cairo_t* cr = i.context->platformContext(); + gdk_cairo_set_source_pixmap(cr, pixmap.get(), rect.x(), rect.y()); + cairo_paint(cr); + } + + return result; + } + AffineTransform ctm = i.context->getCTM(); IntPoint pos = ctm.mapPoint(rect.location()); GdkRectangle gdkRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height()); - GtkTextDirection direction = gtkTextDirection(o->style()->direction()); // Find the clip rectangle cairo_t* cr = i.context->platformContext(); |