Changeset 86178 in webkit
- Timestamp:
- May 10, 2011 12:37:32 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86177 r86178 1 2011-05-10 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK][WebKit2] GTK+ 2.x widget rendering fails after r85480 6 https://bugs.webkit.org/show_bug.cgi?id=59990 7 8 No new tests. This is covered by existing pixel tests. 9 10 * platform/gtk/GtkVersioning.c: 11 (getGdkDrawableSize): Added this helper method. 12 * platform/gtk/GtkVersioning.h: Added helper method declaration. 13 * platform/gtk/WidgetRenderingContext.cpp: 14 (WebCore::WidgetRenderingContext::WidgetRenderingContext): Call into the helper if 15 there is actually a GdkDrawable. If not, disable the sanity check. 16 1 17 2011-05-10 Martin Robinson <mrobinson@igalia.com> 2 18 -
trunk/Source/WebCore/platform/gtk/GtkVersioning.c
r83319 r86178 262 262 } 263 263 264 #if GTK_CHECK_VERSION(2, 24, 0) 265 void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height) 266 { 267 g_return_if_fail(GDK_IS_PIXMAP(drawable) || GDK_IS_WINDOW(drawable)); 268 269 if (GDK_IS_PIXMAP(drawable)) { 270 gdk_pixmap_get_size(GDK_PIXMAP(drawable), width, height); 271 return; 272 } 273 274 GdkWindow *window = GDK_WINDOW(drawable); 275 *width = gdk_window_get_width(window); 276 *height = gdk_window_get_height(window); 277 } 278 #else 279 void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height) 280 { 281 gdk_drawable_get_size(drawable, &width, &height); 282 } 283 #endif // GTK_CHECK_VERSION(2, 24, 0) 284 264 285 #endif // GTK_API_VERSION_2 265 286 -
trunk/Source/WebCore/platform/gtk/GtkVersioning.h
r83319 r86178 36 36 GdkPixbuf* gdk_pixbuf_get_from_surface(cairo_surface_t* surface, int srcX, int srcY, 37 37 int width, int height); 38 void getGdkDrawableSize(GdkDrawable* drawable, int* width, int* height); 38 39 #endif 39 40 -
trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
r85480 r86178 84 84 // We never want to create a scratch buffer larger than the size of our target GdkDrawable. 85 85 // This prevents giant pixmap allocations for very large widgets in smaller views. 86 int maxWidth = 0, maxHeight = 0; 87 #if GTK_CHECK_VERSION(2, 24, 0) 88 maxWidth = gdk_window_get_width(graphicsContext->gdkWindow()); 89 maxHeight = gdk_window_get_height(graphicsContext->gdkWindow()); 90 #else 91 gdk_drawable_get_size(graphicsContext->gdkWindow(), &maxWidth, &maxHeight); 92 #endif 93 m_targetRect.setSize(m_targetRect.size().shrunkTo(IntSize(maxWidth, maxHeight))); 86 // FIXME: We need to implement this check for WebKit2 as well. 87 if (graphicsContext->gdkWindow()) { 88 int maxWidth = 0, maxHeight = 0; 89 getGdkDrawableSize(graphicsContext->gdkWindow(), &maxWidth, &maxHeight); 90 m_targetRect.setSize(m_targetRect.size().shrunkTo(IntSize(maxWidth, maxHeight))); 91 } 94 92 95 93 // Widgets sometimes need to draw outside their boundaries for things such as
Note: See TracChangeset
for help on using the changeset viewer.