Changeset 242346 in webkit
- Timestamp:
- Mar 4, 2019 1:58:08 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 added
- 6 deleted
- 15 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r242340 r242346 1 2019-03-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [CoordinatedGraphics] Unify DrawingArea classes 4 https://bugs.webkit.org/show_bug.cgi?id=195167 5 6 Reviewed by Žan Doberšek. 7 8 Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics. 9 10 * PlatformGTK.cmake: 11 * PlatformWPE.cmake: 12 * PlatformWin.cmake: 13 * Shared/DrawingAreaInfo.h: 14 * SourcesGTK.txt: 15 * SourcesWPE.txt: 16 * UIProcess/API/gtk/PageClientImpl.cpp: 17 (WebKit::PageClientImpl::createDrawingAreaProxy): 18 (WebKit::PageClientImpl::viewSize): 19 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 20 (webkitWebViewBaseRealize): 21 (webkitWebViewBaseUnrealize): 22 (webkitWebViewBaseDraw): 23 (webkitWebViewBaseSizeAllocate): 24 (webkitWebViewBaseDidRelaunchWebProcess): 25 (webkitWebViewBasePageClosed): 26 * UIProcess/API/wpe/PageClientImpl.cpp: 27 (WebKit::PageClientImpl::createDrawingAreaProxy): 28 * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed. 29 * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added. 30 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics): 31 (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): 32 (WebKit::DrawingAreaProxyCoordinatedGraphics::paint): 33 (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange): 34 (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange): 35 (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint): 36 (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable): 37 (WebKit::DrawingAreaProxyCoordinatedGraphics::update): 38 (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): 39 (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): 40 (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode): 41 (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode): 42 (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate): 43 (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const): 44 (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange): 45 (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState): 46 (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState): 47 (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon): 48 (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore): 49 (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): 50 (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): 51 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor): 52 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor): 53 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback): 54 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start): 55 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop): 56 (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw): 57 (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing): 58 * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h. 59 * UIProcess/DrawingAreaProxyImpl.cpp: Removed. 60 * UIProcess/DrawingAreaProxyImpl.h: Removed. 61 * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: 62 (WebKit::AcceleratedBackingStoreX11::update): 63 * UIProcess/win/PageClientImpl.cpp: 64 (WebKit::PageClientImpl::createDrawingAreaProxy): 65 * UIProcess/win/WebView.cpp: 66 (WebKit::WebView::paint): 67 * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed. 68 * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added. 69 (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics): 70 (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics): 71 (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay): 72 (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect): 73 (WebKit::DrawingAreaCoordinatedGraphics::scroll): 74 (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): 75 (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): 76 (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen): 77 (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): 78 (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged): 79 (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged): 80 (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes): 81 (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory): 82 (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer): 83 (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush): 84 (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers): 85 (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor): 86 (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): 87 (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): 88 (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange): 89 (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer): 90 (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): 91 (WebKit::DrawingAreaCoordinatedGraphics::didUpdate): 92 (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState): 93 (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon): 94 (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow): 95 (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost): 96 (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting): 97 (WebKit::DrawingAreaCoordinatedGraphics::resumePainting): 98 (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): 99 (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode): 100 (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay): 101 (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired): 102 (WebKit::DrawingAreaCoordinatedGraphics::display): 103 (WebKit::shouldPaintBoundsRect): 104 * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h. 105 * WebProcess/WebPage/DrawingArea.cpp: 106 (WebKit::DrawingArea::create): 107 * WebProcess/WebPage/DrawingArea.h: 108 (WebKit::DrawingArea::layerFlushThrottlingIsActive const): 109 * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed. 110 * WebProcess/WebPage/DrawingAreaImpl.h: Removed. 111 1 112 2019-03-03 Zalan Bujtas <zalan@apple.com> 2 113 -
trunk/Source/WebKit/PlatformGTK.cmake
r241790 r242346 394 394 "${WEBKIT_DIR}/UIProcess/API/glib" 395 395 "${WEBKIT_DIR}/UIProcess/API/gtk" 396 "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics" 396 397 "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup" 397 398 "${WEBKIT_DIR}/UIProcess/Plugins/gtk" -
trunk/Source/WebKit/PlatformWPE.cmake
r242312 r242346 254 254 "${WEBKIT_DIR}/UIProcess/API/glib" 255 255 "${WEBKIT_DIR}/UIProcess/API/wpe" 256 "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics" 256 257 "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup" 257 258 "${WEBKIT_DIR}/UIProcess/gstreamer" -
trunk/Source/WebKit/PlatformWin.cmake
r242199 r242346 34 34 Shared/win/WebEventFactory.cpp 35 35 36 UIProcess/AcceleratedDrawingAreaProxy.cpp37 36 UIProcess/BackingStore.cpp 38 37 UIProcess/DefaultUndoController.cpp 39 UIProcess/DrawingAreaProxyImpl.cpp40 38 UIProcess/LegacySessionStateCodingNone.cpp 41 39 UIProcess/WebGrammarDetail.cpp … … 50 48 51 49 UIProcess/API/win/APIWebsiteDataStoreWin.cpp 50 51 UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp 52 52 53 53 UIProcess/Launcher/win/ProcessLauncherWin.cpp … … 79 79 WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp 80 80 81 WebProcess/WebPage/AcceleratedDrawingArea.cpp82 81 WebProcess/WebPage/AcceleratedSurface.cpp 83 WebProcess/WebPage/DrawingAreaImpl.cpp84 82 85 83 WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 84 WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 86 85 WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp 87 86 … … 116 115 "${WEBKIT_DIR}/UIProcess/API/cpp/win" 117 116 "${WEBKIT_DIR}/UIProcess/API/win" 117 "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics" 118 118 "${WEBKIT_DIR}/UIProcess/Plugins/win" 119 119 "${WEBKIT_DIR}/UIProcess/win" -
trunk/Source/WebKit/Shared/DrawingAreaInfo.h
r241988 r242346 36 36 #endif 37 37 DrawingAreaTypeRemoteLayerTree, 38 #el se39 DrawingAreaType Impl38 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 39 DrawingAreaTypeCoordinatedGraphics 40 40 #endif 41 41 }; -
trunk/Source/WebKit/SourcesGTK.txt
r242199 r242346 108 108 Shared/unix/AuxiliaryProcessMain.cpp @no-unify 109 109 110 UIProcess/AcceleratedDrawingAreaProxy.cpp111 110 UIProcess/BackingStore.cpp 112 111 UIProcess/DefaultUndoController.cpp 113 UIProcess/DrawingAreaProxyImpl.cpp114 112 UIProcess/LegacySessionStateCodingNone.cpp 115 113 UIProcess/ViewGestureController.cpp … … 209 207 210 208 UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp 209 210 UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp 211 211 212 212 UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @no-unify … … 402 402 WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp 403 403 404 WebProcess/WebPage/AcceleratedDrawingArea.cpp405 404 WebProcess/WebPage/AcceleratedSurface.cpp 406 405 WebProcess/WebPage/ViewGestureGeometryCollector.cpp 407 406 408 407 WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 408 WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 409 409 WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp 410 411 WebProcess/WebPage/DrawingAreaImpl.cpp412 410 413 411 WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp -
trunk/Source/WebKit/SourcesWPE.txt
r242199 r242346 99 99 Shared/unix/AuxiliaryProcessMain.cpp 100 100 101 UIProcess/AcceleratedDrawingAreaProxy.cpp102 101 UIProcess/DefaultUndoController.cpp 103 102 UIProcess/LegacySessionStateCodingNone.cpp … … 183 182 UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp 184 183 184 UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp 185 185 186 UIProcess/glib/WebProcessPoolGLib.cpp 186 187 UIProcess/glib/WebProcessProxyGLib.cpp … … 242 243 WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp 243 244 244 WebProcess/WebPage/AcceleratedDrawingArea.cpp245 245 WebProcess/WebPage/AcceleratedSurface.cpp 246 246 247 247 WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 248 WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 248 249 WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp 249 250 -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
r242317 r242346 29 29 #include "PageClientImpl.h" 30 30 31 #include "DrawingAreaProxy Impl.h"31 #include "DrawingAreaProxyCoordinatedGraphics.h" 32 32 #include "NativeWebKeyboardEvent.h" 33 33 #include "NativeWebMouseEvent.h" … … 65 65 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process) 66 66 { 67 return std::make_unique<DrawingAreaProxy Impl>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process);67 return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process); 68 68 } 69 69 … … 95 95 WebCore::IntSize PageClientImpl::viewSize() 96 96 { 97 auto* drawingArea = static_cast<DrawingAreaProxy Impl*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea());97 auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea()); 98 98 return drawingArea ? drawingArea->size() : IntSize(); 99 99 } -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
r241224 r242346 32 32 #include "APIPageConfiguration.h" 33 33 #include "AcceleratedBackingStore.h" 34 #include "DrawingAreaProxy Impl.h"34 #include "DrawingAreaProxyCoordinatedGraphics.h" 35 35 #include "InputMethodFilter.h" 36 36 #include "KeyBindingTranslator.h" … … 379 379 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) 380 380 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) { 381 if ( DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()))381 if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea())) 382 382 drawingArea->setNativeSurfaceHandleForCompositing(GDK_WINDOW_XID(window)); 383 383 } … … 394 394 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) 395 395 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) { 396 if ( DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(webView->priv->pageProxy->drawingArea()))396 if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webView->priv->pageProxy->drawingArea())) 397 397 drawingArea->destroyNativeSurfaceHandleForCompositing(); 398 398 } … … 531 531 { 532 532 WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget); 533 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(webViewBase->priv->pageProxy->drawingArea());533 auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webViewBase->priv->pageProxy->drawingArea()); 534 534 if (!drawingArea) 535 535 return FALSE; … … 617 617 } 618 618 619 if ( DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()))619 if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea())) 620 620 drawingArea->setSize(viewRect.size()); 621 621 } … … 1634 1634 1635 1635 WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv; 1636 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());1636 auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()); 1637 1637 ASSERT(drawingArea); 1638 1638 … … 1659 1659 1660 1660 WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv; 1661 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());1661 auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()); 1662 1662 ASSERT(drawingArea); 1663 1663 drawingArea->destroyNativeSurfaceHandleForCompositing(); -
trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
r242317 r242346 27 27 #include "PageClientImpl.h" 28 28 29 #include " AcceleratedDrawingAreaProxy.h"29 #include "DrawingAreaProxyCoordinatedGraphics.h" 30 30 #include "NativeWebMouseEvent.h" 31 31 #include "NativeWebWheelEvent.h" … … 60 60 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process) 61 61 { 62 return std::make_unique< AcceleratedDrawingAreaProxy>(m_view.page(), process);62 return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(m_view.page(), process); 63 63 } 64 64 -
trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
r242344 r242346 2 2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 4 * Copyright (C) 2016 Igalia S.L.4 * Copyright (C) 2016-2019 Igalia S.L. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without … … 28 28 #pragma once 29 29 30 #include "BackingStore.h" 30 31 #include "DrawingAreaProxy.h" 31 32 #include "LayerTreeContext.h" 33 #include <wtf/RunLoop.h> 34 35 namespace WebCore { 36 class Region; 37 } 32 38 33 39 namespace WebKit { 34 40 35 class AcceleratedDrawingAreaProxy: public DrawingAreaProxy {41 class DrawingAreaProxyCoordinatedGraphics final : public DrawingAreaProxy { 36 42 public: 37 AcceleratedDrawingAreaProxy(WebPageProxy&, WebProcessProxy&); 38 virtual ~AcceleratedDrawingAreaProxy(); 43 DrawingAreaProxyCoordinatedGraphics(WebPageProxy&, WebProcessProxy&); 44 virtual ~DrawingAreaProxyCoordinatedGraphics(); 45 46 #if !PLATFORM(WPE) 47 void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&, WebCore::Region& unpaintedRegion); 48 #endif 39 49 40 50 bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); } 41 void visibilityDidChange();42 51 43 52 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) … … 46 55 #endif 47 56 48 void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override; 49 50 protected: 57 private: 51 58 // DrawingAreaProxy 52 59 void sizeDidChange() override; 53 60 void deviceScaleFactorDidChange() override; 54 61 void waitForBackingStoreUpdateOnNextPaint() override; 62 void setBackingStoreIsDiscardable(bool) override; 55 63 56 64 // IPC message handlers 65 void update(uint64_t backingStoreStateID, const UpdateInfo&) override; 57 66 void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override; 58 67 void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; 59 68 void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override; 60 69 void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; 70 71 #if !PLATFORM(WPE) 72 void incorporateUpdate(const UpdateInfo&); 73 #endif 74 75 bool alwaysUseCompositing() const; 76 void enterAcceleratedCompositingMode(const LayerTreeContext&); 77 void exitAcceleratedCompositingMode(); 78 void updateAcceleratedCompositingMode(const LayerTreeContext&); 61 79 62 80 enum RespondImmediatelyOrNot { DoNotRespondImmediately, RespondImmediately }; … … 65 83 void waitForAndDispatchDidUpdateBackingStoreState(); 66 84 67 virtual void enterAcceleratedCompositingMode(const LayerTreeContext&); 68 void exitAcceleratedCompositingMode(); 69 void updateAcceleratedCompositingMode(const LayerTreeContext&); 85 #if !PLATFORM(WPE) 86 void discardBackingStoreSoon(); 87 void discardBackingStore(); 88 #endif 70 89 71 bool alwaysUseCompositing() const; 90 void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override; 91 92 class DrawingMonitor { 93 WTF_MAKE_NONCOPYABLE(DrawingMonitor); WTF_MAKE_FAST_ALLOCATED; 94 public: 95 DrawingMonitor(WebPageProxy&); 96 ~DrawingMonitor(); 97 98 void start(WTF::Function<void(CallbackBase::Error)>&&); 99 100 private: 101 static int webViewDrawCallback(DrawingMonitor*); 102 103 void stop(); 104 void didDraw(); 105 106 MonotonicTime m_startTime; 107 WTF::Function<void(CallbackBase::Error)> m_callback; 108 RunLoop::Timer<DrawingMonitor> m_timer; 109 #if PLATFORM(GTK) 110 WebPageProxy& m_webPage; 111 #endif 112 }; 72 113 73 114 // The state ID corresponding to our current backing store. Updated whenever we allocate … … 93 134 uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 }; 94 135 #endif 136 137 #if !PLATFORM(WPE) 138 bool m_isBackingStoreDiscardable { true }; 139 std::unique_ptr<BackingStore> m_backingStore; 140 RunLoop::Timer<DrawingAreaProxyCoordinatedGraphics> m_discardBackingStoreTimer; 141 #endif 142 std::unique_ptr<DrawingMonitor> m_drawingMonitor; 95 143 }; 96 144 97 145 } // namespace WebKit 98 -
trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
r242082 r242346 29 29 #if USE(REDIRECTED_XCOMPOSITE_WINDOW) 30 30 31 #include "DrawingAreaProxy Impl.h"31 #include "DrawingAreaProxyCoordinatedGraphics.h" 32 32 #include "LayerTreeContext.h" 33 33 #include "WebPageProxy.h" … … 158 158 return; 159 159 160 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_webPage.drawingArea());160 auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_webPage.drawingArea()); 161 161 if (!drawingArea) 162 162 return; -
trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp
r242317 r242346 28 28 #include "PageClientImpl.h" 29 29 30 #include "DrawingAreaProxy Impl.h"30 #include "DrawingAreaProxyCoordinatedGraphics.h" 31 31 #include "NotImplemented.h" 32 32 #include "WebContextMenuProxyWin.h" … … 47 47 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process) 48 48 { 49 return std::make_unique<DrawingAreaProxy Impl>(*m_view.page(), process);49 return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*m_view.page(), process); 50 50 } 51 51 -
trunk/Source/WebKit/UIProcess/win/WebView.cpp
r242082 r242346 29 29 30 30 #include "APIPageConfiguration.h" 31 #include "DrawingAreaProxy Impl.h"31 #include "DrawingAreaProxyCoordinatedGraphics.h" 32 32 #include "Logging.h" 33 33 #include "NativeWebKeyboardEvent.h" … … 464 464 return; 465 465 m_page->endPrinting(); 466 if ( DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_page->drawingArea())) {466 if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page->drawingArea())) { 467 467 // FIXME: We should port WebKit1's rect coalescing logic here. 468 468 Region unpaintedRegion; -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
r242344 r242346 2 2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 4 * Copyright (C) 2019 Igalia S.L. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 28 29 29 30 #include "DrawingArea.h" 31 #include <WebCore/Region.h> 30 32 #include <wtf/RunLoop.h> 33 34 namespace WebCore { 35 class GraphicsContext; 36 } 31 37 32 38 namespace WebKit { 33 39 34 class LayerTreeHost; 40 class ShareableBitmap; 41 class UpdateInfo; 35 42 36 class AcceleratedDrawingArea: public DrawingArea {43 class DrawingAreaCoordinatedGraphics final : public DrawingArea { 37 44 public: 38 AcceleratedDrawingArea(WebPage&, const WebPageCreationParameters&);39 virtual ~ AcceleratedDrawingArea();45 DrawingAreaCoordinatedGraphics(WebPage&, const WebPageCreationParameters&); 46 virtual ~DrawingAreaCoordinatedGraphics(); 40 47 41 pr otected:48 private: 42 49 // DrawingArea 43 void setNeedsDisplay() override { };44 void setNeedsDisplayInRect(const WebCore::IntRect&) override { };50 void setNeedsDisplay() override; 51 void setNeedsDisplayInRect(const WebCore::IntRect&) override; 45 52 void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override; 46 void setLayerTreeStateIsFrozen(bool) override;47 bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; }48 LayerTreeHost* layerTreeHost() const override { return m_layerTreeHost.get(); }49 53 void forceRepaint() override; 50 54 bool forceRepaintAsync(CallbackID) override; 51 55 52 void setPaintingEnabled(bool) override; 56 void setLayerTreeStateIsFrozen(bool) override; 57 bool layerTreeStateIsFrozen() const override { return m_layerTreeStateIsFrozen; } 58 59 void setPaintingEnabled(bool paintingEnabled) override { m_isPaintingEnabled = paintingEnabled; }; 53 60 void updatePreferences(const WebPreferencesStore&) override; 54 61 void mainFrameContentSizeChanged(const WebCore::IntSize&) override; 62 void deviceOrPageScaleFactorChanged() override; 63 void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override; 55 64 56 65 WebCore::GraphicsLayerFactory* graphicsLayerFactory() override; 57 66 void setRootCompositingLayer(WebCore::GraphicsLayer*) override; 58 void scheduleInitialDeferredPaint() override ;67 void scheduleInitialDeferredPaint() override { }; 59 68 void scheduleCompositingLayerFlush() override; 60 void scheduleCompositingLayerFlushImmediately() override; 69 void scheduleCompositingLayerFlushImmediately() override { scheduleCompositingLayerFlush(); }; 70 void layerHostDidFlushLayers() override; 61 71 62 72 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 63 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID);73 RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override; 64 74 #endif 65 75 … … 72 82 void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override; 73 83 74 void layerHostDidFlushLayers() override;75 76 #if USE(COORDINATED_GRAPHICS)77 void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;78 #endif79 80 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)81 void deviceOrPageScaleFactorChanged() override;82 #endif83 84 84 // IPC message handlers. 85 85 void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override; 86 void didUpdate() override; 87 88 void sendDidUpdateBackingStoreState(); 86 89 87 90 void exitAcceleratedCompositingModeSoon(); 88 91 bool exitAcceleratedCompositingModePending() const { return m_exitCompositingTimer.isActive(); } 89 void exitAcceleratedCompositingModeNow();90 92 void discardPreviousLayerTreeHost(); 91 93 92 v irtual void suspendPainting();93 v irtual void resumePainting();94 void suspendPainting(); 95 void resumePainting(); 94 96 95 v irtual void sendDidUpdateBackingStoreState();96 v irtual void didUpdateBackingStoreState() { }97 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*); 98 void exitAcceleratedCompositingMode(); 97 99 98 virtual void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*); 99 virtual void exitAcceleratedCompositingMode() { } 100 void scheduleDisplay(); 101 void displayTimerFired(); 102 void display(); 103 void display(UpdateInfo&); 100 104 101 105 uint64_t m_backingStoreStateID { 0 }; … … 126 130 bool m_isPaintingSuspended { false }; 127 131 128 RunLoop::Timer< AcceleratedDrawingArea> m_exitCompositingTimer;132 RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_exitCompositingTimer; 129 133 130 134 // The layer tree host that handles accelerated compositing. … … 132 136 133 137 std::unique_ptr<LayerTreeHost> m_previousLayerTreeHost; 134 RunLoop::Timer<AcceleratedDrawingArea> m_discardPreviousLayerTreeHostTimer; 138 RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_discardPreviousLayerTreeHostTimer; 139 140 WebCore::Region m_dirtyRegion; 141 WebCore::IntRect m_scrollRect; 142 WebCore::IntSize m_scrollOffset; 143 144 // Whether we're waiting for a DidUpdate message. Used for throttling paints so that the 145 // web process won't paint more frequent than the UI process can handle. 146 bool m_isWaitingForDidUpdate { false }; 147 148 bool m_alwaysUseCompositing {false }; 149 bool m_forceRepaintAfterBackingStoreStateUpdate { false }; 150 151 RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_displayTimer; 135 152 }; 136 153 -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp
r241988 r242346 38 38 #include "RemoteLayerTreeDrawingArea.h" 39 39 #include "TiledCoreAnimationDrawingArea.h" 40 #elif PLATFORM(WPE) 41 #include "AcceleratedDrawingArea.h" 42 #else 43 #include "DrawingAreaImpl.h" 40 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 41 #include "DrawingAreaCoordinatedGraphics.h" 44 42 #endif 45 43 … … 57 55 case DrawingAreaTypeRemoteLayerTree: 58 56 return std::make_unique<RemoteLayerTreeDrawingArea>(webPage, parameters); 59 #else 60 case DrawingAreaTypeImpl: 61 #if PLATFORM(WPE) 62 return std::make_unique<AcceleratedDrawingArea>(webPage, parameters); 63 #else 64 return std::make_unique<DrawingAreaImpl>(webPage, parameters); 65 #endif 57 #elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 58 case DrawingAreaTypeCoordinatedGraphics: 59 return std::make_unique<DrawingAreaCoordinatedGraphics>(webPage, parameters); 66 60 #endif 67 61 } -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h
r242082 r242346 87 87 virtual bool layerTreeStateIsFrozen() const { return false; } 88 88 virtual bool layerFlushThrottlingIsActive() const { return false; } 89 virtual LayerTreeHost* layerTreeHost() const { return 0; }90 89 91 90 virtual void setPaintingEnabled(bool) { } … … 143 142 virtual void layerHostDidFlushLayers() { } 144 143 145 #if USE(COORDINATED_GRAPHICS) 144 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) 146 145 virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) = 0; 147 #endif148 149 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)150 146 virtual void deviceOrPageScaleFactorChanged() = 0; 151 147 #endif
Note: See TracChangeset
for help on using the changeset viewer.