DisplayLayerController.h [plain text]
#pragma once
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
#include "GraphicsLayer.h"
#include <wtf/IsoMalloc.h>
namespace WebCore {
class GraphicsLayer;
class GraphicsLayerFactory;
namespace Display {
class Tree;
class View;
class LayerController {
WTF_MAKE_FAST_ALLOCATED(LayerController);
public:
explicit LayerController(View&);
~LayerController();
void prepareForDisplay(Tree&);
void flushLayers();
void setIsInWindow(bool);
void setNeedsDisplay();
const View& view() const { return m_view; }
private:
void attachRootLayer();
void detachRootLayer();
void ensureRootLayer(FloatSize viewSize, FloatSize contentSize);
void updateRootLayerGeometry(FloatSize viewSize, FloatSize contentSize);
void setupRootLayerHierarchy();
void scheduleRenderingUpdate();
GraphicsLayer* rootGraphicsLayer() const { return m_rootLayer.get(); }
GraphicsLayer* contentLayer() const { return m_contentLayer.get(); }
GraphicsLayerFactory* graphicsLayerFactory() const;
FloatRect visibleRectForLayerFlushing() const;
class RootLayerClient : public GraphicsLayerClient {
public:
RootLayerClient(LayerController&);
private:
void notifyFlushRequired(const GraphicsLayer*) final;
void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) final;
float deviceScaleFactor() const final;
LayerController& m_layerController;
};
View& m_view;
RootLayerClient m_rootLayerClient;
RefPtr<GraphicsLayer> m_rootLayer;
RefPtr<GraphicsLayer> m_contentHostLayer;
RefPtr<GraphicsLayer> m_contentLayer;
};
} }
#endif // ENABLE(LAYOUT_FORMATTING_CONTEXT)