Changeset 102604 in webkit
- Timestamp:
- Dec 12, 2011 10:44:10 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102602 r102604 1 2011-12-12 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] gtk_widget_size_allocate for plugin widgets should happen in the WebView size-allocate method 4 https://bugs.webkit.org/show_bug.cgi?id=72805 5 6 Reviewed by Gustavo Noronha Silva. 7 8 No new tests. This is only a performance tweak. 9 10 Instead of immediately calling gtk_widget_size during painting, defer 11 this until the size-allocate method of the WebView. 12 13 * plugins/gtk/PluginViewGtk.cpp: 14 (WebCore::PluginView::updateWidgetAllocationAndClip): Instead of immediately changing 15 the widget allocation, just record it in a GObject data attachment. 16 1 17 2011-12-12 Nate Chapin <japhet@chromium.org> 2 18 -
trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
r100725 r102604 577 577 } 578 578 579 GtkAllocation allocation(m_delayedAllocation); 580 m_delayedAllocation = IntRect(); 581 582 // The goal is to avoid calling gtk_widget_size_allocate when necessary. 583 // It blocks the main loop and if the widget is offscreen or hasn't moved 584 // it isn't required. 579 // The goal is to try to avoid calling gtk_widget_size_allocate in the WebView's 580 // size-allocate method. It blocks the main loop and if the widget is offscreen 581 // or hasn't moved it isn't required. 585 582 586 583 // Don't do anything if the allocation has not changed. 587 584 GtkAllocation currentAllocation; 588 585 gtk_widget_get_allocation(widget, ¤tAllocation); 589 if (currentAllocation == allocation)586 if (currentAllocation == m_delayedAllocation) 590 587 return; 591 588 … … 596 593 return; 597 594 598 g tk_widget_size_allocate(widget, &allocation);595 g_object_set_data(G_OBJECT(widget), "delayed-allocation", &m_delayedAllocation); 599 596 } 600 597 -
trunk/Source/WebKit/gtk/ChangeLog
r102448 r102604 1 2011-12-12 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] gtk_widget_size_allocate for plugin widgets should happen in the WebView size-allocate method 4 https://bugs.webkit.org/show_bug.cgi?id=72805 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Instead of immediately calling gtk_widget_size during painting, defer 9 this until the size-allocate method of the WebView. 10 11 * WebCoreSupport/ChromeClientGtk.cpp: 12 (WebKit::ChromeClient::paint): If any child widgets have a pending allocation 13 call gtk_widget_size_allocate. 14 * webkit/webkitwebview.cpp: 15 (updateChildAllocationFromPendingAllocation): Added this helper. 16 (webkit_web_view_size_allocate): Call the helper on all child widgets. 17 1 18 2011-12-09 Joone Hur <joone.hur@collabora.co.uk> 2 19 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r102448 r102604 566 566 gtk_widget_queue_draw_area(GTK_WIDGET(m_webView), rect.x(), rect.y(), rect.width(), rect.height()); 567 567 568 HashSet<GtkWidget*> children = m_webView->priv->children; 569 HashSet<GtkWidget*>::const_iterator end = children.end(); 570 for (HashSet<GtkWidget*>::const_iterator current = children.begin(); current != end; ++current) { 571 if (static_cast<GtkAllocation*>(g_object_get_data(G_OBJECT(*current), "delayed-allocation"))) { 572 gtk_widget_queue_resize_no_redraw(GTK_WIDGET(m_webView)); 573 break; 574 } 575 } 576 568 577 m_dirtyRegion = Region(); 569 578 m_lastDisplayTime = currentTime(); -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r102448 r102604 842 842 #endif 843 843 844 static void updateChildAllocationFromPendingAllocation(GtkWidget* child, void*) 845 { 846 if (!gtk_widget_get_visible(child)) 847 return; 848 849 GtkAllocation* allocation = static_cast<GtkAllocation*>(g_object_get_data(G_OBJECT(child), "delayed-allocation")); 850 if (!allocation) 851 return; 852 853 g_object_set_data(G_OBJECT(child), "delayed-allocation", 0); 854 gtk_widget_size_allocate(child, allocation); 855 *allocation = IntRect(); 856 } 857 844 858 static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation) 845 859 { 846 860 GTK_WIDGET_CLASS(webkit_web_view_parent_class)->size_allocate(widget, allocation); 847 861 848 WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); 849 Page* page = core(webView); 862 Page* page = core(WEBKIT_WEB_VIEW(widget)); 850 863 IntSize oldSize; 851 864 if (FrameView* frameView = page->mainFrame()->view()) { … … 853 866 frameView->resize(allocation->width, allocation->height); 854 867 } 868 869 gtk_container_forall(GTK_CONTAINER(widget), updateChildAllocationFromPendingAllocation, 0); 855 870 856 871 WebKit::ChromeClient* chromeClient = static_cast<WebKit::ChromeClient*>(page->chrome()->client());
Note: See TracChangeset
for help on using the changeset viewer.