Reviewed by Mark Rowe.
GTK+ drawing fixes.
Add a check to avoid crashing when the GraphicsContext is not
associated with a GdkDrawable. This was noticed when adding printing
support but might be triggered in other situations too.
Do not render themes when painting is disabled. This is an
optimisation for cases where GraphicsContext is used to calculate page
dimensions etc. without actually rendering.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::gdkDrawable):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::paintMozWidget):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27905
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-19 Alp Toker <alp@atoker.com>
+
+ Reviewed by Mark Rowe.
+
+ GTK+ drawing fixes.
+
+ Add a check to avoid crashing when the GraphicsContext is not
+ associated with a GdkDrawable. This was noticed when adding printing
+ support but might be triggered in other situations too.
+
+ Do not render themes when painting is disabled. This is an
+ optimisation for cases where GraphicsContext is used to calculate page
+ dimensions etc. without actually rendering.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::gdkDrawable):
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::paintMozWidget):
+
2007-11-13 Rahul Abrol <ra5ul@comcast.net>
Reviewed by Tim Hatcher.
GdkDrawable* GraphicsContext::gdkDrawable() const
{
+ if (!m_data->expose)
+ return 0;
+
return GDK_DRAWABLE(m_data->expose->window);
}
static bool paintMozWidget(RenderTheme* 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;
+
+ // Painting is disabled so just claim to have succeeded
+ if (i.context->paintingDisabled())
+ return false;
+
GtkWidgetState mozState;
setMozState(theme, &mozState, o);