Changeset 242346 in webkit


Ignore:
Timestamp:
Mar 4, 2019 1:58:08 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[CoordinatedGraphics] Unify DrawingArea classes
https://bugs.webkit.org/show_bug.cgi?id=195167

Reviewed by Žan Doberšek.

Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.

  • PlatformGTK.cmake:
  • PlatformWPE.cmake:
  • PlatformWin.cmake:
  • Shared/DrawingAreaInfo.h:
  • SourcesGTK.txt:
  • SourcesWPE.txt:
  • UIProcess/API/gtk/PageClientImpl.cpp:

(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::viewSize):

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseRealize):
(webkitWebViewBaseUnrealize):
(webkitWebViewBaseDraw):
(webkitWebViewBaseSizeAllocate):
(webkitWebViewBaseDidRelaunchWebProcess):
(webkitWebViewBasePageClosed):

  • UIProcess/API/wpe/PageClientImpl.cpp:

(WebKit::PageClientImpl::createDrawingAreaProxy):

  • UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
  • UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.

(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
(WebKit::DrawingAreaProxyCoordinatedGraphics::update):
(WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
(WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
(WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
(WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):

  • UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
  • UIProcess/DrawingAreaProxyImpl.cpp: Removed.
  • UIProcess/DrawingAreaProxyImpl.h: Removed.
  • UIProcess/gtk/AcceleratedBackingStoreX11.cpp:

(WebKit::AcceleratedBackingStoreX11::update):

  • UIProcess/win/PageClientImpl.cpp:

(WebKit::PageClientImpl::createDrawingAreaProxy):

  • UIProcess/win/WebView.cpp:

(WebKit::WebView::paint):

  • WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
  • WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.

(WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
(WebKit::DrawingAreaCoordinatedGraphics::scroll):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
(WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
(WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
(WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
(WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
(WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
(WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
(WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
(WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
(WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
(WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
(WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
(WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
(WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
(WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
(WebKit::DrawingAreaCoordinatedGraphics::display):
(WebKit::shouldPaintBoundsRect):

  • WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
  • WebProcess/WebPage/DrawingArea.cpp:

(WebKit::DrawingArea::create):

  • WebProcess/WebPage/DrawingArea.h:

(WebKit::DrawingArea::layerFlushThrottlingIsActive const):

  • WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
  • WebProcess/WebPage/DrawingAreaImpl.h: Removed.
Location:
trunk/Source/WebKit
Files:
3 added
6 deleted
15 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r242340 r242346  
     12019-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
    11122019-03-03  Zalan Bujtas  <zalan@apple.com>
    2113
  • trunk/Source/WebKit/PlatformGTK.cmake

    r241790 r242346  
    394394    "${WEBKIT_DIR}/UIProcess/API/glib"
    395395    "${WEBKIT_DIR}/UIProcess/API/gtk"
     396    "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
    396397    "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
    397398    "${WEBKIT_DIR}/UIProcess/Plugins/gtk"
  • trunk/Source/WebKit/PlatformWPE.cmake

    r242312 r242346  
    254254    "${WEBKIT_DIR}/UIProcess/API/glib"
    255255    "${WEBKIT_DIR}/UIProcess/API/wpe"
     256    "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
    256257    "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
    257258    "${WEBKIT_DIR}/UIProcess/gstreamer"
  • trunk/Source/WebKit/PlatformWin.cmake

    r242199 r242346  
    3434    Shared/win/WebEventFactory.cpp
    3535
    36     UIProcess/AcceleratedDrawingAreaProxy.cpp
    3736    UIProcess/BackingStore.cpp
    3837    UIProcess/DefaultUndoController.cpp
    39     UIProcess/DrawingAreaProxyImpl.cpp
    4038    UIProcess/LegacySessionStateCodingNone.cpp
    4139    UIProcess/WebGrammarDetail.cpp
     
    5048
    5149    UIProcess/API/win/APIWebsiteDataStoreWin.cpp
     50
     51    UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
    5252
    5353    UIProcess/Launcher/win/ProcessLauncherWin.cpp
     
    7979    WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
    8080
    81     WebProcess/WebPage/AcceleratedDrawingArea.cpp
    8281    WebProcess/WebPage/AcceleratedSurface.cpp
    83     WebProcess/WebPage/DrawingAreaImpl.cpp
    8482
    8583    WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
     84    WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
    8685    WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
    8786
     
    116115    "${WEBKIT_DIR}/UIProcess/API/cpp/win"
    117116    "${WEBKIT_DIR}/UIProcess/API/win"
     117    "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
    118118    "${WEBKIT_DIR}/UIProcess/Plugins/win"
    119119    "${WEBKIT_DIR}/UIProcess/win"
  • trunk/Source/WebKit/Shared/DrawingAreaInfo.h

    r241988 r242346  
    3636#endif
    3737    DrawingAreaTypeRemoteLayerTree,
    38 #else
    39     DrawingAreaTypeImpl
     38#elif USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
     39    DrawingAreaTypeCoordinatedGraphics
    4040#endif
    4141};
  • trunk/Source/WebKit/SourcesGTK.txt

    r242199 r242346  
    108108Shared/unix/AuxiliaryProcessMain.cpp @no-unify
    109109
    110 UIProcess/AcceleratedDrawingAreaProxy.cpp
    111110UIProcess/BackingStore.cpp
    112111UIProcess/DefaultUndoController.cpp
    113 UIProcess/DrawingAreaProxyImpl.cpp
    114112UIProcess/LegacySessionStateCodingNone.cpp
    115113UIProcess/ViewGestureController.cpp
     
    209207
    210208UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp
     209
     210UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
    211211
    212212UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @no-unify
     
    402402WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
    403403
    404 WebProcess/WebPage/AcceleratedDrawingArea.cpp
    405404WebProcess/WebPage/AcceleratedSurface.cpp
    406405WebProcess/WebPage/ViewGestureGeometryCollector.cpp
    407406
    408407WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
     408WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
    409409WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
    410 
    411 WebProcess/WebPage/DrawingAreaImpl.cpp
    412410
    413411WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
  • trunk/Source/WebKit/SourcesWPE.txt

    r242199 r242346  
    9999Shared/unix/AuxiliaryProcessMain.cpp
    100100
    101 UIProcess/AcceleratedDrawingAreaProxy.cpp
    102101UIProcess/DefaultUndoController.cpp
    103102UIProcess/LegacySessionStateCodingNone.cpp
     
    183182UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp
    184183
     184UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
     185
    185186UIProcess/glib/WebProcessPoolGLib.cpp
    186187UIProcess/glib/WebProcessProxyGLib.cpp
     
    242243WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp
    243244
    244 WebProcess/WebPage/AcceleratedDrawingArea.cpp
    245245WebProcess/WebPage/AcceleratedSurface.cpp
    246246
    247247WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
     248WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
    248249WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
    249250
  • trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp

    r242317 r242346  
    2929#include "PageClientImpl.h"
    3030
    31 #include "DrawingAreaProxyImpl.h"
     31#include "DrawingAreaProxyCoordinatedGraphics.h"
    3232#include "NativeWebKeyboardEvent.h"
    3333#include "NativeWebMouseEvent.h"
     
    6565std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
    6666{
    67     return std::make_unique<DrawingAreaProxyImpl>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process);
     67    return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), process);
    6868}
    6969
     
    9595WebCore::IntSize PageClientImpl::viewSize()
    9696{
    97     auto* drawingArea = static_cast<DrawingAreaProxyImpl*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea());
     97    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget))->drawingArea());
    9898    return drawingArea ? drawingArea->size() : IntSize();
    9999}
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r241224 r242346  
    3232#include "APIPageConfiguration.h"
    3333#include "AcceleratedBackingStore.h"
    34 #include "DrawingAreaProxyImpl.h"
     34#include "DrawingAreaProxyCoordinatedGraphics.h"
    3535#include "InputMethodFilter.h"
    3636#include "KeyBindingTranslator.h"
     
    379379#if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    380380    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()))
    382382            drawingArea->setNativeSurfaceHandleForCompositing(GDK_WINDOW_XID(window));
    383383    }
     
    394394#if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    395395    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()))
    397397            drawingArea->destroyNativeSurfaceHandleForCompositing();
    398398    }
     
    531531{
    532532    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());
    534534    if (!drawingArea)
    535535        return FALSE;
     
    617617    }
    618618
    619     if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()))
     619    if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea()))
    620620        drawingArea->setSize(viewRect.size());
    621621}
     
    16341634
    16351635    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
    1636     DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
     1636    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
    16371637    ASSERT(drawingArea);
    16381638
     
    16591659
    16601660    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
    1661     DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
     1661    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
    16621662    ASSERT(drawingArea);
    16631663    drawingArea->destroyNativeSurfaceHandleForCompositing();
  • trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp

    r242317 r242346  
    2727#include "PageClientImpl.h"
    2828
    29 #include "AcceleratedDrawingAreaProxy.h"
     29#include "DrawingAreaProxyCoordinatedGraphics.h"
    3030#include "NativeWebMouseEvent.h"
    3131#include "NativeWebWheelEvent.h"
     
    6060std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
    6161{
    62     return std::make_unique<AcceleratedDrawingAreaProxy>(m_view.page(), process);
     62    return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(m_view.page(), process);
    6363}
    6464
  • trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h

    r242344 r242346  
    22 * Copyright (C) 2011 Apple Inc. All rights reserved.
    33 * 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.
    55 *
    66 * Redistribution and use in source and binary forms, with or without
     
    2828#pragma once
    2929
     30#include "BackingStore.h"
    3031#include "DrawingAreaProxy.h"
    3132#include "LayerTreeContext.h"
     33#include <wtf/RunLoop.h>
     34
     35namespace WebCore {
     36class Region;
     37}
    3238
    3339namespace WebKit {
    3440
    35 class AcceleratedDrawingAreaProxy : public DrawingAreaProxy {
     41class DrawingAreaProxyCoordinatedGraphics final : public DrawingAreaProxy {
    3642public:
    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
    3949
    4050    bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); }
    41     void visibilityDidChange();
    4251
    4352#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
     
    4655#endif
    4756
    48     void dispatchAfterEnsuringDrawing(WTF::Function<void(CallbackBase::Error)>&&) override;
    49 
    50 protected:
     57private:
    5158    // DrawingAreaProxy
    5259    void sizeDidChange() override;
    5360    void deviceScaleFactorDidChange() override;
    5461    void waitForBackingStoreUpdateOnNextPaint() override;
     62    void setBackingStoreIsDiscardable(bool) override;
    5563
    5664    // IPC message handlers
     65    void update(uint64_t backingStoreStateID, const UpdateInfo&) override;
    5766    void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
    5867    void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
    5968    void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
    6069    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&);
    6179
    6280    enum RespondImmediatelyOrNot { DoNotRespondImmediately, RespondImmediately };
     
    6583    void waitForAndDispatchDidUpdateBackingStoreState();
    6684
    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
    7089
    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    };
    72113
    73114    // The state ID corresponding to our current backing store. Updated whenever we allocate
     
    93134    uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
    94135#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;
    95143};
    96144
    97145} // namespace WebKit
    98 
  • trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp

    r242082 r242346  
    2929#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
    3030
    31 #include "DrawingAreaProxyImpl.h"
     31#include "DrawingAreaProxyCoordinatedGraphics.h"
    3232#include "LayerTreeContext.h"
    3333#include "WebPageProxy.h"
     
    158158        return;
    159159
    160     DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_webPage.drawingArea());
     160    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_webPage.drawingArea());
    161161    if (!drawingArea)
    162162        return;
  • trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp

    r242317 r242346  
    2828#include "PageClientImpl.h"
    2929
    30 #include "DrawingAreaProxyImpl.h"
     30#include "DrawingAreaProxyCoordinatedGraphics.h"
    3131#include "NotImplemented.h"
    3232#include "WebContextMenuProxyWin.h"
     
    4747std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
    4848{
    49     return std::make_unique<DrawingAreaProxyImpl>(*m_view.page(), process);
     49    return std::make_unique<DrawingAreaProxyCoordinatedGraphics>(*m_view.page(), process);
    5050}
    5151
  • trunk/Source/WebKit/UIProcess/win/WebView.cpp

    r242082 r242346  
    2929
    3030#include "APIPageConfiguration.h"
    31 #include "DrawingAreaProxyImpl.h"
     31#include "DrawingAreaProxyCoordinatedGraphics.h"
    3232#include "Logging.h"
    3333#include "NativeWebKeyboardEvent.h"
     
    464464        return;
    465465    m_page->endPrinting();
    466     if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(m_page->drawingArea())) {
     466    if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page->drawingArea())) {
    467467        // FIXME: We should port WebKit1's rect coalescing logic here.
    468468        Region unpaintedRegion;
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h

    r242344 r242346  
    22 * Copyright (C) 2011 Apple Inc. All rights reserved.
    33 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
     4 * Copyright (C) 2019 Igalia S.L.
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    2829
    2930#include "DrawingArea.h"
     31#include <WebCore/Region.h>
    3032#include <wtf/RunLoop.h>
     33
     34namespace WebCore {
     35class GraphicsContext;
     36}
    3137
    3238namespace WebKit {
    3339
    34 class LayerTreeHost;
     40class ShareableBitmap;
     41class UpdateInfo;
    3542
    36 class AcceleratedDrawingArea : public DrawingArea {
     43class DrawingAreaCoordinatedGraphics final : public DrawingArea {
    3744public:
    38     AcceleratedDrawingArea(WebPage&, const WebPageCreationParameters&);
    39     virtual ~AcceleratedDrawingArea();
     45    DrawingAreaCoordinatedGraphics(WebPage&, const WebPageCreationParameters&);
     46    virtual ~DrawingAreaCoordinatedGraphics();
    4047
    41 protected:
     48private:
    4249    // DrawingArea
    43     void setNeedsDisplay() override { };
    44     void setNeedsDisplayInRect(const WebCore::IntRect&) override { };
     50    void setNeedsDisplay() override;
     51    void setNeedsDisplayInRect(const WebCore::IntRect&) override;
    4552    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(); }
    4953    void forceRepaint() override;
    5054    bool forceRepaintAsync(CallbackID) override;
    5155
    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; };
    5360    void updatePreferences(const WebPreferencesStore&) override;
    5461    void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
     62    void deviceOrPageScaleFactorChanged() override;
     63    void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
    5564
    5665    WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
    5766    void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
    58     void scheduleInitialDeferredPaint() override;
     67    void scheduleInitialDeferredPaint() override { };
    5968    void scheduleCompositingLayerFlush() override;
    60     void scheduleCompositingLayerFlushImmediately() override;
     69    void scheduleCompositingLayerFlushImmediately() override { scheduleCompositingLayerFlush(); };
     70    void layerHostDidFlushLayers() override;
    6171
    6272#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    63     virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID);
     73    RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
    6474#endif
    6575
     
    7282    void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
    7383
    74     void layerHostDidFlushLayers() override;
    75 
    76 #if USE(COORDINATED_GRAPHICS)
    77     void didChangeViewportAttributes(WebCore::ViewportAttributes&&) override;
    78 #endif
    79 
    80 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
    81     void deviceOrPageScaleFactorChanged() override;
    82 #endif
    83 
    8484    // IPC message handlers.
    8585    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();
    8689
    8790    void exitAcceleratedCompositingModeSoon();
    8891    bool exitAcceleratedCompositingModePending() const { return m_exitCompositingTimer.isActive(); }
    89     void exitAcceleratedCompositingModeNow();
    9092    void discardPreviousLayerTreeHost();
    9193
    92     virtual void suspendPainting();
    93     virtual void resumePainting();
     94    void suspendPainting();
     95    void resumePainting();
    9496
    95     virtual void sendDidUpdateBackingStoreState();
    96     virtual void didUpdateBackingStoreState() { }
     97    void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
     98    void exitAcceleratedCompositingMode();
    9799
    98     virtual void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
    99     virtual void exitAcceleratedCompositingMode() { }
     100    void scheduleDisplay();
     101    void displayTimerFired();
     102    void display();
     103    void display(UpdateInfo&);
    100104
    101105    uint64_t m_backingStoreStateID { 0 };
     
    126130    bool m_isPaintingSuspended { false };
    127131
    128     RunLoop::Timer<AcceleratedDrawingArea> m_exitCompositingTimer;
     132    RunLoop::Timer<DrawingAreaCoordinatedGraphics> m_exitCompositingTimer;
    129133
    130134    // The layer tree host that handles accelerated compositing.
     
    132136
    133137    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;
    135152};
    136153
  • trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp

    r241988 r242346  
    3838#include "RemoteLayerTreeDrawingArea.h"
    3939#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"
    4442#endif
    4543
     
    5755    case DrawingAreaTypeRemoteLayerTree:
    5856        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);
    6660#endif
    6761    }
  • trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h

    r242082 r242346  
    8787    virtual bool layerTreeStateIsFrozen() const { return false; }
    8888    virtual bool layerFlushThrottlingIsActive() const { return false; }
    89     virtual LayerTreeHost* layerTreeHost() const { return 0; }
    9089
    9190    virtual void setPaintingEnabled(bool) { }
     
    143142    virtual void layerHostDidFlushLayers() { }
    144143
    145 #if USE(COORDINATED_GRAPHICS)
     144#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
    146145    virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) = 0;
    147 #endif
    148 
    149 #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
    150146    virtual void deviceOrPageScaleFactorChanged() = 0;
    151147#endif
Note: See TracChangeset for help on using the changeset viewer.