summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h80
1 files changed, 42 insertions, 38 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
index c059c4534..51af581c6 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
@@ -26,88 +26,92 @@
#ifndef LayerTreeHost_h
#define LayerTreeHost_h
+#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+
#include "LayerTreeContext.h"
-#include <WebCore/Color.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
namespace IPC {
class Connection;
-class MessageDecoder;
}
namespace WebCore {
-class FloatPoint;
-class FloatRect;
class IntRect;
class IntSize;
class GraphicsLayer;
class GraphicsLayerFactory;
+#if USE(COORDINATED_GRAPHICS_THREADED)
+struct ViewportAttributes;
+#endif
}
namespace WebKit {
-class PageOverlay;
-class UpdateInfo;
class WebPage;
class LayerTreeHost : public RefCounted<LayerTreeHost> {
public:
- static PassRefPtr<LayerTreeHost> create(WebPage*);
+ static RefPtr<LayerTreeHost> create(WebPage&);
virtual ~LayerTreeHost();
- static bool supportsAcceleratedCompositing();
+ const LayerTreeContext& layerTreeContext() const { return m_layerTreeContext; }
+ void setLayerFlushSchedulingEnabled(bool);
+ void setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush) { m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush; }
- virtual const LayerTreeContext& layerTreeContext() = 0;
virtual void scheduleLayerFlush() = 0;
- virtual void setLayerFlushSchedulingEnabled(bool) = 0;
- virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool) = 0;
+ virtual void cancelPendingLayerFlush() = 0;
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
- virtual void invalidate() = 0;
+ virtual void invalidate();
- virtual void setNonCompositedContentsNeedDisplay() = 0;
- virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) = 0;
- virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) = 0;
+ virtual void setNonCompositedContentsNeedDisplay() { };
+ virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) { };
+ virtual void scrollNonCompositedContents(const WebCore::IntRect&) { };
virtual void forceRepaint() = 0;
virtual bool forceRepaintAsync(uint64_t /*callbackID*/) { return false; }
virtual void sizeDidChange(const WebCore::IntSize& newSize) = 0;
- virtual void deviceOrPageScaleFactorChanged() = 0;
virtual void pageBackgroundTransparencyChanged() = 0;
- virtual void didInstallPageOverlay(PageOverlay*) = 0;
- virtual void didUninstallPageOverlay(PageOverlay*) = 0;
- virtual void setPageOverlayNeedsDisplay(PageOverlay*, const WebCore::IntRect&) = 0;
- virtual void setPageOverlayOpacity(PageOverlay*, float) { }
+ virtual void pauseRendering();
+ virtual void resumeRendering();
- virtual void pauseRendering() { }
- virtual void resumeRendering() { }
+ virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
- virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return 0; }
- virtual void setBackgroundColor(const WebCore::Color&) { }
+#if USE(COORDINATED_GRAPHICS_THREADED)
+ virtual void contentsSizeChanged(const WebCore::IntSize&) { };
+ virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) { };
+#endif
#if USE(COORDINATED_GRAPHICS)
- virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection*, IPC::MessageDecoder&) = 0;
+ virtual void scheduleAnimation() = 0;
+ virtual void setIsDiscardable(bool) { };
#endif
-#if PLATFORM(MAC)
- virtual void setLayerHostingMode(LayerHostingMode) { }
+#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)
+ virtual void setNativeSurfaceHandleForCompositing(uint64_t) { };
#endif
-#if USE(COORDINATED_GRAPHICS) && ENABLE(REQUEST_ANIMATION_FRAME)
- virtual void scheduleAnimation() = 0;
+#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+ virtual void deviceOrPageScaleFactorChanged() = 0;
#endif
-protected:
- explicit LayerTreeHost(WebPage*);
+ virtual void setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer) { m_viewOverlayRootLayer = viewOverlayRootLayer; }
- WebPage* m_webPage;
+protected:
+ explicit LayerTreeHost(WebPage&);
+
+ WebPage& m_webPage;
+ LayerTreeContext m_layerTreeContext;
+ bool m_layerFlushSchedulingEnabled { true };
+ bool m_notifyAfterScheduledLayerFlush { false };
+ bool m_isSuspended { false };
+ bool m_isValid { true };
+ WebCore::GraphicsLayer* m_viewOverlayRootLayer { nullptr };
};
-inline bool LayerTreeHost::supportsAcceleratedCompositing()
-{
- return true;
-}
-
} // namespace WebKit
+#endif // USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+
#endif // LayerTreeHost_h