Changeset 86612 in webkit
- Timestamp:
- May 16, 2011 3:07:57 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 added
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86608 r86612 1 2011-05-16 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Anders Carlsson. 4 5 GTK port of WebKit2 should switch to new DrawingAreaImpl model 6 https://bugs.webkit.org/show_bug.cgi?id=59655 7 8 * GNUmakefile.am: Add the files necessary to use the DrawingAreaProxyImpl 9 to the source list. The source list also needs the LayerContextTree stubs. 10 * Shared/LayerTreeContext.h: This file should not be guarded by 11 USE(ACCELERATED_COMPOSITING) as it's needed for the DrawingAreaProxyImpl 12 IPC messaging. 13 * Shared/gtk/LayerTreeContextGtk.cpp: Added this stub. 14 * UIProcess/API/gtk/PageClientImpl.cpp: 15 (WebKit::PageClientImpl::createDrawingAreaProxy): Instead of creating the deprecated 16 chunked drawing area, create a DrawingAreaProxyImpl. 17 (WebKit::PageClientImpl::setViewNeedsDisplay): Here we must now queue a redraw. Previously 18 the chunked drawing area was doing this manually. This is the appropriate place though. 19 (WebKit::PageClientImpl::scrollView): Add an implementation that just calls into setViewNeedsDisplay. 20 * UIProcess/API/gtk/PageClientImpl.h: Added a getter for m_viewWidget. 21 (WebKit::PageClientImpl::viewWidget): 22 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 23 (callDrawingAreaPaintMethod): Added this helper which reduces code duplication between 24 GTK+ 2.x and 3.x 25 (webkitWebViewBaseExpose): Call the new helper now. 26 (webkitWebViewBaseDraw): Ditto. 27 * UIProcess/BackingStore.h: Updated to include GTK+ specific types. 28 * UIProcess/DrawingAreaProxy.h: Ditto. 29 * UIProcess/DrawingAreaProxy.messages.in: Do not the DrawingAreaProxyImpl-specific 30 message with USE(ACCELERATED_COMPOSITING). 31 * UIProcess/WebPageProxy.cpp: Removed these guards, as DrawingAreProxyImpl is used on all platforms now. 32 (WebKit::WebPageProxy::didReceiveMessage): Ditto. 33 * UIProcess/WebPageProxy.h: Ditto. 34 * UIProcess/gtk/BackingStoreGtk.cpp: Added. This implementation heavily uses Cairo, 35 but depends on GTK+/GDK in a few places. 36 (WebKit::BackingStore::paint): 37 (WebKit::BackingStore::incorporateUpdate): 38 (WebKit::BackingStore::scroll): 39 * UIProcess/gtk/WebPageProxyGtk.cpp: Added a getting for the viewWidget, which is 40 required by BackingStoreGtk. A similar getter exists for Windows and Mac. 41 (WebKit::WebPageProxy::viewWidget): Ditto. 42 * WebProcess/WebPage/DrawingArea.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. 43 (WebKit::DrawingArea::create): Ditto. 44 * WebProcess/WebPage/DrawingArea.h: Ditto. 45 * WebProcess/WebPage/DrawingAreaImpl.cpp: 46 (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Do not guard 47 this DrawingAreaProxyImpl-specific message with USE(ACCELERATED_COMPOSITING) 48 * WebProcess/WebPage/WebPage.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. 49 (WebKit::WebPage::didReceiveMessage): Ditto. 50 1 51 2011-05-16 Maciej Stachowiak <mjs@apple.com> 2 52 -
trunk/Source/WebKit2/GNUmakefile.am
r86549 r86612 103 103 Source/WebKit2/Platform/Module.h \ 104 104 Source/WebKit2/Platform/PlatformProcessIdentifier.h \ 105 Source/WebKit2/Platform/Region.cpp \ 106 Source/WebKit2/Platform/Region.h \ 105 107 Source/WebKit2/Platform/RunLoop.cpp \ 106 108 Source/WebKit2/Platform/RunLoop.h \ … … 188 190 Source/WebKit2/Shared/FontSmoothingLevel.h \ 189 191 Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \ 192 Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp \ 190 193 Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \ 191 194 Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \ … … 242 245 Source/WebKit2/Shared/TextCheckerState.h \ 243 246 Source/WebKit2/Shared/UserMessageCoders.h \ 247 Source/WebKit2/Shared/UpdateInfo.cpp \ 248 Source/WebKit2/Shared/UpdateInfo.h \ 244 249 Source/WebKit2/Shared/VisitedLinkTable.cpp \ 245 250 Source/WebKit2/Shared/VisitedLinkTable.h \ … … 371 376 Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.cpp \ 372 377 Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h \ 378 Source/WebKit2/UIProcess/BackingStore.cpp \ 379 Source/WebKit2/UIProcess/BackingStore.h \ 373 380 Source/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.cpp \ 374 381 Source/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h \ … … 377 384 Source/WebKit2/UIProcess/DrawingAreaProxy.cpp \ 378 385 Source/WebKit2/UIProcess/DrawingAreaProxy.h \ 386 Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp \ 387 Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h \ 379 388 Source/WebKit2/UIProcess/FindIndicator.cpp \ 380 389 Source/WebKit2/UIProcess/FindIndicator.h \ … … 384 393 Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.cpp \ 385 394 Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.h \ 395 Source/WebKit2/UIProcess/gtk/BackingStoreGtk.cpp \ 386 396 Source/WebKit2/UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp \ 387 397 Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp \ … … 660 670 Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp \ 661 671 Source/WebKit2/WebProcess/WebPage/DrawingArea.h \ 672 Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp \ 662 673 Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp \ 663 674 Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h \ … … 667 678 Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp \ 668 679 Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp \ 680 Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp \ 669 681 Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp \ 670 682 Source/WebKit2/WebProcess/WebPage/PageOverlay.h \ … … 822 834 DerivedSources/WebKit2/AuthenticationManagerMessageReceiver.cpp \ 823 835 DerivedSources/WebKit2/AuthenticationManagerMessages.h \ 836 DerivedSources/WebKit2/DrawingAreaMessageReceiver.cpp \ 837 DerivedSources/WebKit2/DrawingAreaMessages.h \ 838 DerivedSources/WebKit2/DrawingAreaProxyMessages.h \ 839 DerivedSources/WebKit2/DrawingAreaProxyMessageReceiver.cpp \ 824 840 DerivedSources/WebKit2/DownloadProxyMessageReceiver.cpp \ 825 841 DerivedSources/WebKit2/DownloadProxyMessages.h \ -
trunk/Source/WebKit2/Shared/LayerTreeContext.h
r80596 r86612 32 32 } 33 33 34 #if USE(ACCELERATED_COMPOSITING)35 36 34 namespace WebKit { 37 35 … … 60 58 }; 61 59 62 #endif // USE(ACCELERATED_COMPOSITING)63 64 60 #endif // LayerTreeContext_h -
trunk/Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp
r86610 r86612 24 24 */ 25 25 26 #i fndef LayerTreeContext_h27 # define LayerTreeContext_h26 #include "config.h" 27 #include "LayerTreeContext.h" 28 28 29 namespace CoreIPC { 30 class ArgumentDecoder; 31 class ArgumentEncoder; 32 } 33 34 #if USE(ACCELERATED_COMPOSITING) 29 #include "NotImplemented.h" 35 30 36 31 namespace WebKit { 37 32 38 class LayerTreeContext { 39 public: 40 LayerTreeContext(); 41 ~LayerTreeContext(); 42 43 void encode(CoreIPC::ArgumentEncoder*) const; 44 static bool decode(CoreIPC::ArgumentDecoder*, LayerTreeContext&); 45 46 bool isEmpty() const; 47 48 #if PLATFORM(MAC) 49 uint32_t contextID; 50 #endif 51 }; 52 53 bool operator==(const LayerTreeContext&, const LayerTreeContext&); 54 55 inline bool operator!=(const LayerTreeContext& a, const LayerTreeContext& b) 33 LayerTreeContext::LayerTreeContext() 56 34 { 57 return !(a == b);35 notImplemented(); 58 36 } 59 37 60 }; 38 LayerTreeContext::~LayerTreeContext() 39 { 40 notImplemented(); 41 } 61 42 62 #endif // USE(ACCELERATED_COMPOSITING) 43 void LayerTreeContext::encode(CoreIPC::ArgumentEncoder*) const 44 { 45 notImplemented(); 46 } 63 47 64 #endif // LayerTreeContext_h 48 bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder*, LayerTreeContext&) 49 { 50 notImplemented(); 51 return true; 52 } 53 54 bool LayerTreeContext::isEmpty() const 55 { 56 notImplemented(); 57 return true; 58 } 59 60 bool operator==(const LayerTreeContext&, const LayerTreeContext&) 61 { 62 notImplemented(); 63 return true; 64 } 65 66 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
r86436 r86612 29 29 #include "PageClientImpl.h" 30 30 31 #include " ChunkedUpdateDrawingAreaProxy.h"31 #include "DrawingAreaProxyImpl.h" 32 32 #include "NativeWebKeyboardEvent.h" 33 33 #include "NativeWebMouseEvent.h" … … 65 65 PassOwnPtr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy() 66 66 { 67 WebKitWebViewBase* view = WEBKIT_WEB_VIEW_BASE(m_viewWidget); 68 return ChunkedUpdateDrawingAreaProxy::create(view, webkitWebViewBaseGetPage(view)); 69 } 70 71 void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect&) 72 { 73 notImplemented(); 67 return DrawingAreaProxyImpl::create(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))); 68 } 69 70 void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect& rect) 71 { 72 gtk_widget_queue_draw_area(m_viewWidget, rect.x(), rect.y(), rect.width(), rect.height()); 74 73 } 75 74 … … 81 80 void PageClientImpl::scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) 82 81 { 83 notImplemented();82 setViewNeedsDisplay(scrollRect); 84 83 } 85 84 -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
r86436 r86612 48 48 return adoptPtr(new PageClientImpl(viewWidget)); 49 49 } 50 51 GtkWidget* viewWidget() { return m_viewWidget; } 50 52 51 53 private: -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r85856 r86612 29 29 #include "WebKitWebViewBase.h" 30 30 31 #include "DrawingAreaProxyImpl.h" 31 32 #include "GOwnPtrGtk.h" 32 33 #include "GtkClickCounter.h" … … 38 39 #include "PageClientImpl.h" 39 40 #include "RefPtrCairo.h" 41 #include "Region.h" 40 42 #include "WebContext.h" 41 43 #include "WebEventFactory.h" … … 147 149 } 148 150 151 static void callDrawingAreaPaintMethod(DrawingAreaProxy* drawingArea, cairo_t* context, const IntRect& area) 152 { 153 WebKit::Region unpaintedRegion; // This is simply unused. 154 static_cast<DrawingAreaProxyImpl*>(drawingArea)->paint(context, area, unpaintedRegion); 155 } 156 149 157 #ifdef GTK_API_VERSION_2 150 158 static gboolean webkitWebViewBaseExpose(GtkWidget* widget, GdkEventExpose* event) 151 159 { 152 WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);153 154 160 GdkRectangle clipRect; 155 161 gdk_region_get_clipbox(event->region, &clipRect); 156 162 157 163 RefPtr<cairo_t> cr = adoptRef(gdk_cairo_create(gtk_widget_get_window(widget))); 158 webViewBase->priv->pageProxy->drawingArea()->paint(clipRect, cr.get()); 159 164 callDrawingAreaPaintMethod(WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea(), cr.get(), clipRect); 160 165 return FALSE; 161 166 } … … 163 168 static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr) 164 169 { 165 WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);166 167 170 GdkRectangle clipRect; 168 171 if (!gdk_cairo_get_clip_rectangle(cr, &clipRect)) 169 172 return FALSE; 170 173 171 webViewBase->priv->pageProxy->drawingArea()->paint(clipRect, cr); 172 174 callDrawingAreaPaintMethod(WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea(), cr, clipRect); 173 175 return FALSE; 174 176 } -
trunk/Source/WebKit2/UIProcess/BackingStore.h
r84613 r86612 42 42 #endif 43 43 44 #if PLATFORM(GTK) 45 #include <WebCore/RefPtrCairo.h> 46 #endif 47 44 48 namespace WebCore { 45 49 class IntRect; … … 67 71 #elif PLATFORM(QT) 68 72 typedef QPainter* PlatformGraphicsContext; 73 #elif PLATFORM(GTK) 74 typedef cairo_t* PlatformGraphicsContext; 69 75 #endif 70 76 … … 90 96 #elif PLATFORM(QT) 91 97 QPixmap m_pixmap; 98 #elif PLATFORM(GTK) 99 RefPtr<cairo_surface_t> m_surface; 92 100 #endif 93 101 }; -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h
r86495 r86612 73 73 DrawingAreaType type() const { return m_type; } 74 74 75 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)76 75 void didReceiveDrawingAreaProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 77 #endif78 76 79 77 virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0; -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
r80661 r86612 23 23 messages -> DrawingAreaProxy { 24 24 Update(uint64_t stateID, WebKit::UpdateInfo updateInfo) 25 DidUpdateBackingStoreState(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo, WebKit::LayerTreeContext context) 25 26 #if USE(ACCELERATED_COMPOSITING) 26 DidUpdateBackingStoreState(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo, WebKit::LayerTreeContext context)27 27 EnterAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::LayerTreeContext context) 28 28 ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r86584 r86612 1332 1332 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) 1333 1333 { 1334 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)1335 1334 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) { 1336 1335 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments); 1337 1336 return; 1338 1337 } 1339 #endif1340 1338 1341 1339 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxyLegacy>()) { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r86584 r86612 309 309 310 310 HWND nativeWindow() const; 311 #endif 312 #if PLATFORM(GTK) 313 GtkWidget* viewWidget(); 311 314 #endif 312 315 #if ENABLE(TILED_BACKING_STORE) -
trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
r84011 r86612 30 30 #include "NativeWebKeyboardEvent.h" 31 31 #include "NotImplemented.h" 32 #include "PageClient .h"32 #include "PageClientImpl.h" 33 33 34 34 namespace WebKit { 35 36 GtkWidget* WebPageProxy::viewWidget() 37 { 38 return static_cast<PageClientImpl*>(m_pageClient)->viewWidget(); 39 } 35 40 36 41 String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent) -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp
r85603 r86612 29 29 // Subclasses 30 30 #include "ChunkedUpdateDrawingArea.h" 31 32 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)33 31 #include "DrawingAreaImpl.h" 34 #endif35 32 36 33 #if ENABLE(TILED_BACKING_STORE) … … 46 43 switch (parameters.drawingAreaType) { 47 44 case DrawingAreaTypeImpl: 48 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)49 45 return DrawingAreaImpl::create(webPage, parameters); 50 #else51 return nullptr;52 #endif53 46 case DrawingAreaTypeChunkedUpdate: 54 47 return adoptPtr(new ChunkedUpdateDrawingArea(webPage)); -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r84613 r86612 54 54 virtual ~DrawingArea(); 55 55 56 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)57 56 void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 58 #endif59 57 60 58 virtual void setNeedsDisplay(const WebCore::IntRect&) = 0; -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r86590 r86612 330 330 display(updateInfo); 331 331 332 #if USE(ACCELERATED_COMPOSITING)333 332 LayerTreeContext layerTreeContext; 334 333 … … 350 349 m_webPage->send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext)); 351 350 m_compositingAccordingToProxyMessages = !layerTreeContext.isEmpty(); 352 #endif353 351 } 354 352 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r86409 r86612 1971 1971 } 1972 1972 1973 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)1974 1973 if (messageID.is<CoreIPC::MessageClassDrawingArea>()) { 1975 1974 if (m_drawingArea) … … 1977 1976 return; 1978 1977 } 1979 #endif1980 1978 1981 1979 #if ENABLE(INSPECTOR)
Note: See TracChangeset
for help on using the changeset viewer.