Changeset 86620 in webkit
- Timestamp:
- May 16, 2011 3:48:56 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86607 r86620 1 2011-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 1 17 2011-05-16 Chris Rogers <crogers@google.com> 2 18 -
trunk/Source/WebCore/GNUmakefile.list.am
r86583 r86620 3743 3743 Source/WebCore/platform/gtk/GtkUtilities.cpp \ 3744 3744 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 \ 3745 3748 Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp \ 3746 3749 Source/WebCore/platform/gtk/GeolocationServiceGtk.h \ -
trunk/Source/WebKit2/ChangeLog
r86615 r86620 1 2011-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 1 18 2011-05-16 Chris Marrin <cmarrin@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/BackingStore.h
r86612 r86620 43 43 44 44 #if PLATFORM(GTK) 45 #include <WebCore/RefPtrCairo.h> 45 #include <RefPtrCairo.h> 46 #include <WebCore/GtkWidgetBackingStore.h> 46 47 #endif 47 48 … … 97 98 QPixmap m_pixmap; 98 99 #elif PLATFORM(GTK) 99 RefPtr<cairo_surface_t> m_surface;100 OwnPtr<WebCore::GtkWidgetBackingStore> m_backingStore; 100 101 #endif 101 102 }; -
trunk/Source/WebKit2/UIProcess/gtk/BackingStoreGtk.cpp
r86612 r86620 41 41 void BackingStore::paint(cairo_t* context, const IntRect& rect) 42 42 { 43 ASSERT(m_backingStore); 44 43 45 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); 45 47 cairo_rectangle(context, rect.x(), rect.y(), rect.width(), rect.height()); 46 48 cairo_fill(context); … … 49 51 void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo& updateInfo) 50 52 { 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()); 57 55 58 56 scroll(updateInfo.scrollRect, updateInfo.scrollOffset); … … 60 58 // Paint all update rects. 61 59 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()))); 63 61 GraphicsContext graphicsContext(context.get()); 64 62 for (size_t i = 0; i < updateInfo.updateRects.size(); ++i) { … … 75 73 return; 76 74 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); 98 77 } 99 78
Note: See TracChangeset
for help on using the changeset viewer.