diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h | 105 |
1 files changed, 27 insertions, 78 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h index f327e2074..3fce0a7a7 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h @@ -23,16 +23,13 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DrawingAreaImpl_h -#define DrawingAreaImpl_h +#pragma once -#include "DrawingArea.h" -#include "LayerTreeHost.h" +#include "AcceleratedDrawingArea.h" #include <WebCore/Region.h> -#include <wtf/RunLoop.h> namespace WebCore { - class GraphicsContext; +class GraphicsContext; } namespace WebKit { @@ -40,100 +37,52 @@ namespace WebKit { class ShareableBitmap; class UpdateInfo; -class DrawingAreaImpl : public DrawingArea { +class DrawingAreaImpl final : public AcceleratedDrawingArea { public: - DrawingAreaImpl(WebPage*, const WebPageCreationParameters&); + DrawingAreaImpl(WebPage&, const WebPageCreationParameters&); virtual ~DrawingAreaImpl(); - void layerHostDidFlushLayers(); - private: // DrawingArea - virtual void setNeedsDisplay() override; - virtual void setNeedsDisplayInRect(const WebCore::IntRect&) override; - virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta); - virtual void pageBackgroundTransparencyChanged() override; - virtual void setLayerTreeStateIsFrozen(bool); - virtual bool layerTreeStateIsFrozen() const { return m_layerTreeStateIsFrozen; } - virtual LayerTreeHost* layerTreeHost() const { return m_layerTreeHost.get(); } - virtual void forceRepaint(); - virtual bool forceRepaintAsync(uint64_t callbackID); - - virtual void didInstallPageOverlay(PageOverlay*); - virtual void didUninstallPageOverlay(PageOverlay*); - virtual void setPageOverlayNeedsDisplay(PageOverlay*, const WebCore::IntRect&); - virtual void setPageOverlayOpacity(PageOverlay*, float); - - virtual void setPaintingEnabled(bool); - virtual void updatePreferences(const WebPreferencesStore&) override; - -#if USE(ACCELERATED_COMPOSITING) - virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() override; - virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override; - virtual void scheduleCompositingLayerFlush() override; -#endif + void setNeedsDisplay() override; + void setNeedsDisplayInRect(const WebCore::IntRect&) override; + void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override; + void forceRepaint() override; + + void mainFrameContentSizeChanged(const WebCore::IntSize&) override; + void updatePreferences(const WebPreferencesStore&) override; + + void setRootCompositingLayer(WebCore::GraphicsLayer*) override; // IPC message handlers. - virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset); - virtual void didUpdate(); - virtual void suspendPainting(); - virtual void resumePainting(); - - void sendDidUpdateBackingStoreState(); - - void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*); - void exitAcceleratedCompositingModeSoon(); - bool exitAcceleratedCompositingModePending() const { return m_exitCompositingTimer.isActive(); } - void exitAcceleratedCompositingMode(); + void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override; + void didUpdate() override; + + // AcceleratedDrawingArea + void suspendPainting() override; + void sendDidUpdateBackingStoreState() override; + void didUpdateBackingStoreState() override; + + void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*) override; + void exitAcceleratedCompositingMode() override; void scheduleDisplay(); void displayTimerFired(); void display(); void display(UpdateInfo&); - uint64_t m_backingStoreStateID; - WebCore::Region m_dirtyRegion; WebCore::IntRect m_scrollRect; WebCore::IntSize m_scrollOffset; - // Whether painting is enabled. If painting is disabled, any calls to setNeedsDisplay and scroll are ignored. - bool m_isPaintingEnabled; - - // Whether we're currently processing an UpdateBackingStoreState message. - bool m_inUpdateBackingStoreState; - - // When true, we should send an UpdateBackingStoreState message instead of any other messages - // we normally send to the UI process. - bool m_shouldSendDidUpdateBackingStoreState; - // Whether we're waiting for a DidUpdate message. Used for throttling paints so that the // web process won't paint more frequent than the UI process can handle. - bool m_isWaitingForDidUpdate; - - // True between sending the 'enter compositing' messages, and the 'exit compositing' message. - bool m_compositingAccordingToProxyMessages; - - // When true, we maintain the layer tree in its current state by not leaving accelerated compositing mode - // and not scheduling layer flushes. - bool m_layerTreeStateIsFrozen; + bool m_isWaitingForDidUpdate { false }; - // True when we were asked to exit accelerated compositing mode but couldn't because layer tree - // state was frozen. - bool m_wantsToExitAcceleratedCompositingMode; - - // Whether painting is suspended. We'll still keep track of the dirty region but we - // won't paint until painting has resumed again. - bool m_isPaintingSuspended; - bool m_alwaysUseCompositing; + bool m_alwaysUseCompositing {false }; + bool m_forceRepaintAfterBackingStoreStateUpdate { false }; RunLoop::Timer<DrawingAreaImpl> m_displayTimer; - RunLoop::Timer<DrawingAreaImpl> m_exitCompositingTimer; - - // The layer tree host that handles accelerated compositing. - RefPtr<LayerTreeHost> m_layerTreeHost; }; } // namespace WebKit - -#endif // DrawingAreaImpl_h |