Ticket #4244: scale-fast.patch

File scale-fast.patch, 4.2 KB (added by dnarvaez, 11 years ago)

Fix the scrolling fast path

  • webkitgtk-1.10.1/Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp

    diff -ur orig/webkitgtk-1.10.1/Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp webkitgtk-1.10.1/Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp
    old new  
    100100
    101101    cairo_surface_flush(m_private->m_surface.get());
    102102    XCopyArea(m_private->m_display, m_private->m_pixmap, m_private->m_pixmap, m_private->m_gc,
    103               targetRect.x() - scrollOffset.width(), targetRect.y() - scrollOffset.height(),
    104               targetRect.width(), targetRect.height(),
    105               targetRect.x(), targetRect.y());
     103              (targetRect.x() - scrollOffset.width()) * 1.4, (targetRect.y() - scrollOffset.height()) * 1.4,
     104              targetRect.width() * 1.4, targetRect.height() * 1.4,
     105              targetRect.x() * 1.4, targetRect.y() * 1.4);
    106106    cairo_surface_mark_dirty_rectangle(m_private->m_surface.get(),
    107107                                       targetRect.x(), targetRect.y(),
    108108                                       targetRect.width(), targetRect.height());
  • webkitgtk-1.10.1/Source/WebCore/platform/gtk/ScrollViewGtk.cpp

    diff -ur orig/webkitgtk-1.10.1/Source/WebCore/platform/gtk/ScrollViewGtk.cpp webkitgtk-1.10.1/Source/WebCore/platform/gtk/ScrollViewGtk.cpp
    old new  
    8787    GtkAllocation allocation;
    8888    gtk_widget_get_allocation(measuredWidget, &allocation);
    8989    return IntRect(IntPoint(m_scrollOffset.width(), m_scrollOffset.height()),
    90                    IntSize(allocation.width, allocation.height));
     90                   IntSize(allocation.width / 1.4, allocation.height / 1.4));
    9191}
    9292
    9393void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool horizontalLock, bool verticalLock)
  • webkitgtk-1.10.1/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    diff -ur orig/webkitgtk-1.10.1/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp webkitgtk-1.10.1/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
    old new  
    146146{
    147147    GtkAllocation allocation;
    148148    gtk_widget_get_allocation(GTK_WIDGET(webView), &allocation);
    149     return IntRect(allocation.x, allocation.y, allocation.width, allocation.height);
     149    return IntRect(allocation.x / 1.4, allocation.y / 1.4, allocation.width / 1.4, allocation.height / 1.4);
    150150}
    151151
    152152FloatRect ChromeClient::pageRect()
     
    546546    for (size_t i = 0; i < m_rectsToScroll.size(); i++) {
    547547        IntRect& scrollRect = m_rectsToScroll[i];
    548548        m_webView->priv->backingStore->scroll(scrollRect, m_scrollOffsets[i]);
    549         gtk_widget_queue_draw_area(GTK_WIDGET(m_webView), scrollRect.x(), scrollRect.y(), scrollRect.width(), scrollRect.height());
     549        gtk_widget_queue_draw_area(GTK_WIDGET(m_webView), scrollRect.x() * 1.4, scrollRect.y() * 1.4, scrollRect.width() * 1.4, scrollRect.height() * 1.4);
    550550    }
    551551
    552552    m_rectsToScroll.clear();
     
    582582    }
    583583
    584584    const IntRect& rect = m_dirtyRegion.bounds();
    585     gtk_widget_queue_draw_area(GTK_WIDGET(m_webView), rect.x(), rect.y(), rect.width(), rect.height());
     585    gtk_widget_queue_draw_area(GTK_WIDGET(m_webView), rect.x() * 1.4, rect.y() * 1.4, rect.width() * 1.4, rect.height() * 1.4);
    586586
    587587    m_dirtyRegion = Region();
    588588    m_lastDisplayTime = currentTime();
  • webkitgtk-1.10.1/Source/WebKit/gtk/webkit/webkitwebview.cpp

    diff -ur orig/webkitgtk-1.10.1/Source/WebKit/gtk/webkit/webkitwebview.cpp webkitgtk-1.10.1/Source/WebKit/gtk/webkit/webkitwebview.cpp
    old new  
    36163616    pageClients.inspectorClient = new WebKit::InspectorClient(webView);
    36173617
    36183618    priv->corePage = new Page(pageClients);
     3619    priv->corePage->setDeviceScaleFactor(1.4);
    36193620
    36203621#if ENABLE(GEOLOCATION)
    36213622    if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {