#ifndef LayerTreeHostCA_h
#define LayerTreeHostCA_h
#include "LayerTreeContext.h"
#include "LayerTreeHost.h"
#include <WebCore/GraphicsLayerClient.h>
#include <wtf/OwnPtr.h>
namespace WebKit {
class LayerTreeHostCA : public LayerTreeHost, WebCore::GraphicsLayerClient {
public:
virtual ~LayerTreeHostCA();
protected:
explicit LayerTreeHostCA(WebPage*);
WebCore::GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
void initialize();
void performScheduledLayerFlush();
virtual void invalidate();
virtual void sizeDidChange(const WebCore::IntSize& newSize);
virtual void deviceScaleFactorDidChange();
virtual void forceRepaint();
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
virtual void didPerformScheduledLayerFlush();
virtual bool flushPendingLayerChanges();
bool m_layerFlushSchedulingEnabled;
LayerTreeContext m_layerTreeContext;
private:
virtual const LayerTreeContext& layerTreeContext();
virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool);
virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
virtual void didInstallPageOverlay();
virtual void didUninstallPageOverlay();
virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&);
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
virtual float deviceScaleFactor() const;
virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
virtual void platformInitialize() = 0;
void createPageOverlayLayer();
void destroyPageOverlayLayer();
bool m_isValid;
bool m_notifyAfterScheduledLayerFlush;
OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
OwnPtr<WebCore::GraphicsLayer> m_nonCompositedContentLayer;
OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
};
}
#endif // LayerTreeHostCA_h