#ifndef TileCoverageMap_h
#define TileCoverageMap_h
#include "FloatRect.h"
#include "IntRect.h"
#include "PlatformCALayer.h"
#include "PlatformCALayerClient.h"
#include "Timer.h"
#include <wtf/Noncopyable.h>
#include <wtf/RetainPtr.h>
namespace WebCore {
class FloatRect;
class IntPoint;
class IntRect;
class TileController;
class TileCoverageMap : public PlatformCALayerClient {
WTF_MAKE_NONCOPYABLE(TileCoverageMap); WTF_MAKE_FAST_ALLOCATED;
public:
TileCoverageMap(const TileController&);
~TileCoverageMap();
void update();
void setPosition(const FloatPoint& position) { m_position = position; }
PlatformCALayer& layer() { return m_layer; }
void setDeviceScaleFactor(float);
void setNeedsUpdate();
private:
GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesTopDown; }
bool platformCALayerContentsOpaque() const override { return true; }
bool platformCALayerDrawsContent() const override { return true; }
void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) override;
float platformCALayerDeviceScaleFactor() const override;
void updateTimerFired();
const TileController& m_controller;
Timer m_updateTimer;
Ref<PlatformCALayer> m_layer;
Ref<PlatformCALayer> m_visibleRectIndicatorLayer;
Ref<PlatformCALayer> m_coverageRectIndicatorLayer;
FloatPoint m_position;
};
}
#endif