#ifndef Tile_h
#define Tile_h
#if ENABLE(TILED_BACKING_STORE)
#include "IntPoint.h"
#include "IntPointHash.h"
#include "IntRect.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPixmap;
class QRegion;
QT_END_NAMESPACE
#endif
namespace WebCore {
class GraphicsContext;
class TiledBackingStore;
class Tile : public RefCounted<Tile> {
public:
typedef IntPoint Coordinate;
static PassRefPtr<Tile> create(TiledBackingStore* backingStore, const Coordinate& tileCoordinate) { return adoptRef(new Tile(backingStore, tileCoordinate)); }
~Tile();
bool isDirty() const;
void invalidate(const IntRect&);
void updateBackBuffer();
void swapBackBufferToFront();
bool isReadyToPaint() const;
void paint(GraphicsContext*, const IntRect&);
const Tile::Coordinate& coordinate() const { return m_coordinate; }
const IntRect& rect() const { return m_rect; }
static void paintCheckerPattern(GraphicsContext*, const FloatRect&);
private:
Tile(TiledBackingStore*, const Coordinate&);
TiledBackingStore* m_backingStore;
Coordinate m_coordinate;
IntRect m_rect;
#if PLATFORM(QT)
QPixmap* m_buffer;
QPixmap* m_backBuffer;
QRegion* m_dirtyRegion;
#endif
};
}
#endif
#endif