NonCompositedContentHost.h [plain text]
#ifndef NonCompositedContentHost_h
#define NonCompositedContentHost_h
#include "GraphicsLayerClient.h"
#include "IntSize.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class Color;
class GraphicsLayer;
class GraphicsContext;
class IntPoint;
class IntRect;
class LayerChromium;
class LayerPainterChromium;
}
namespace WebKit {
class NonCompositedContentHost : public WebCore::GraphicsLayerClient {
WTF_MAKE_NONCOPYABLE(NonCompositedContentHost);
public:
static PassOwnPtr<NonCompositedContentHost> create(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint)
{
return adoptPtr(new NonCompositedContentHost(contentPaint));
}
virtual ~NonCompositedContentHost();
void invalidateRect(const WebCore::IntRect&);
void setBackgroundColor(const WebCore::Color&);
void setScrollLayer(WebCore::GraphicsLayer*);
void setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float pageScale, int layerAdjustX);
void protectVisibleTileTextures();
WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); }
void setShowDebugBorders(bool);
protected:
explicit NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint);
private:
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;
WebCore::LayerChromium* scrollLayer();
OwnPtr<WebCore::GraphicsLayer> m_graphicsLayer;
OwnPtr<WebCore::LayerPainterChromium> m_contentPaint;
WebCore::IntSize m_viewportSize;
int m_layerAdjustX;
bool m_showDebugBorders;
};
}
#endif // NonCompositedContentHost_h