Changeset 86620 in webkit


Ignore:
Timestamp:
May 16, 2011 3:48:56 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-16 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] [WebKit2] Provide a fast version of the backing store for X11
https://bugs.webkit.org/show_bug.cgi?id=60912

No new tests. This will be covered by WebKit2 pixel tests.

  • GNUmakefile.list.am: Added new GtkWidgetBackingStore source and header files.
  • platform/gtk/GtkWidgetBackingStore.h: Added.
  • platform/gtk/GtkWidgetBackingStoreCairo.cpp: Added this implementation of the backing store that uses Cairo and has the same performance characteristics as the WebKit2 implementaiton.
  • platform/gtk/GtkWidgetBackingStoreX11.cpp: Added this implementation of the backing store that uses X11 directly and has better performance than the Cairo version.

2011-05-16 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] [WebKit2] Provide a fast version of the backing store for X11
https://bugs.webkit.org/show_bug.cgi?id=60912

Instead of allocating the backing store surface directly in WebKit2,
instantiate the GtkWidgetBackingStore class which abstracts away the
platform-specific details of maintaining the backing store.

  • UIProcess/BackingStore.h:
  • UIProcess/gtk/BackingStoreGtk.cpp: (WebKit::BackingStore::paint): Call into GtkWidgetBackingStore to get the Cairo surface now. (WebKit::BackingStore::incorporateUpdate): Ditto. (WebKit::BackingStore::scroll): Call into GtkWidgetBackingStore to do the actual backing store scroll.
Location:
trunk/Source
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86607 r86620  
     12011-05-16  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] [WebKit2] Provide a fast version of the backing store for X11
     6        https://bugs.webkit.org/show_bug.cgi?id=60912
     7
     8        No new tests. This will be covered by WebKit2 pixel tests.
     9
     10        * GNUmakefile.list.am: Added new GtkWidgetBackingStore source and header files.
     11        * platform/gtk/GtkWidgetBackingStore.h: Added.
     12        * platform/gtk/GtkWidgetBackingStoreCairo.cpp: Added this implementation of the backing
     13        store that uses Cairo and has the same performance characteristics as the WebKit2 implementaiton.
     14        * platform/gtk/GtkWidgetBackingStoreX11.cpp: Added this implementation of the backing
     15        store that uses X11 directly and has better performance than the Cairo version.
     16
    1172011-05-16  Chris Rogers  <crogers@google.com>
    218
  • trunk/Source/WebCore/GNUmakefile.list.am

    r86583 r86620  
    37433743        Source/WebCore/platform/gtk/GtkUtilities.cpp \
    37443744        Source/WebCore/platform/gtk/GtkUtilities.h \
     3745        Source/WebCore/platform/gtk/GtkWidgetBackingStore.h \
     3746        Source/WebCore/platform/gtk/GtkWidgetBackingStoreCairo.cpp \
     3747        Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
    37453748        Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp \
    37463749        Source/WebCore/platform/gtk/GeolocationServiceGtk.h \
  • trunk/Source/WebKit2/ChangeLog

    r86615 r86620  
     12011-05-16  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] [WebKit2] Provide a fast version of the backing store for X11
     6        https://bugs.webkit.org/show_bug.cgi?id=60912
     7
     8        Instead of allocating the backing store surface directly in WebKit2,
     9        instantiate the GtkWidgetBackingStore class which abstracts away the
     10        platform-specific details of maintaining the backing store.
     11
     12        * UIProcess/BackingStore.h:
     13        * UIProcess/gtk/BackingStoreGtk.cpp:
     14        (WebKit::BackingStore::paint): Call into GtkWidgetBackingStore to get the Cairo surface now.
     15        (WebKit::BackingStore::incorporateUpdate): Ditto.
     16        (WebKit::BackingStore::scroll): Call into GtkWidgetBackingStore to do the actual backing store scroll.
     17
    1182011-05-16  Chris Marrin  <cmarrin@apple.com>
    219
  • trunk/Source/WebKit2/UIProcess/BackingStore.h

    r86612 r86620  
    4343
    4444#if PLATFORM(GTK)
    45 #include <WebCore/RefPtrCairo.h>
     45#include <RefPtrCairo.h>
     46#include <WebCore/GtkWidgetBackingStore.h>
    4647#endif
    4748
     
    9798    QPixmap m_pixmap;
    9899#elif PLATFORM(GTK)
    99     RefPtr<cairo_surface_t> m_surface;
     100    OwnPtr<WebCore::GtkWidgetBackingStore> m_backingStore;
    100101#endif
    101102};
  • trunk/Source/WebKit2/UIProcess/gtk/BackingStoreGtk.cpp

    r86612 r86620  
    4141void BackingStore::paint(cairo_t* context, const IntRect& rect)
    4242{
     43    ASSERT(m_backingStore);
     44
    4345    cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
    44     cairo_set_source_surface(context, m_surface.get(), 0, 0);
     46    cairo_set_source_surface(context, m_backingStore->cairoSurface(), 0, 0);
    4547    cairo_rectangle(context, rect.x(), rect.y(), rect.width(), rect.height());
    4648    cairo_fill(context);
     
    4951void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo& updateInfo)
    5052{
    51     GtkWidget* viewWidget = m_webPageProxy->viewWidget();
    52     if (!m_surface) {
    53         m_surface = adoptRef(gdk_window_create_similar_surface(gtk_widget_get_window(viewWidget),
    54                                                                CAIRO_CONTENT_COLOR_ALPHA,
    55                                                                size().width(), size().height()));
    56     }
     53    if (!m_backingStore)
     54        m_backingStore = GtkWidgetBackingStore::create(m_webPageProxy->viewWidget(), size());
    5755
    5856    scroll(updateInfo.scrollRect, updateInfo.scrollOffset);
     
    6058    // Paint all update rects.
    6159    IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
    62     RefPtr<cairo_t> context(adoptRef(cairo_create(m_surface.get())));
     60    RefPtr<cairo_t> context(adoptRef(cairo_create(m_backingStore->cairoSurface())));
    6361    GraphicsContext graphicsContext(context.get());
    6462    for (size_t i = 0; i < updateInfo.updateRects.size(); ++i) {
     
    7573        return;
    7674
    77     ASSERT(m_surface);
    78     RefPtr<cairo_t> context = adoptRef(cairo_create(m_surface.get()));
    79     cairo_push_group(context.get());
    80 
    81     IntRect targetRect(scrollRect);
    82     targetRect.move(scrollOffset);
    83     targetRect.shiftMaxXEdgeTo(targetRect.maxX() - scrollOffset.width());
    84     targetRect.shiftMaxYEdgeTo(targetRect.maxY() - scrollOffset.height());
    85     if (targetRect.isEmpty())
    86         return;
    87 
    88     cairo_set_source_surface(context.get(), m_surface.get(),
    89                              scrollOffset.width(), scrollOffset.height());
    90     cairo_rectangle(context.get(), targetRect.x(), targetRect.y(),
    91                     targetRect.width(), targetRect.height());
    92     cairo_fill(context.get());
    93 
    94     cairo_pop_group_to_source(context.get());
    95     cairo_rectangle(context.get(), targetRect.x(), targetRect.y(),
    96                     targetRect.width(), targetRect.height());
    97     cairo_fill(context.get());
     75    ASSERT(m_backingStore);
     76    m_backingStore->scroll(scrollRect, scrollOffset);
    9877}
    9978
Note: See TracChangeset for help on using the changeset viewer.