TiledDrawingArea.h [plain text]
#ifndef TiledDrawingArea_h
#define TiledDrawingArea_h
#if ENABLE(TILED_BACKING_STORE)
#include "DrawingArea.h"
#include "RunLoop.h"
#include <WebCore/IntRect.h>
#include <wtf/Vector.h>
namespace WebKit {
class UpdateChunk;
class TiledDrawingArea : public DrawingArea {
public:
explicit TiledDrawingArea(WebPage*);
virtual ~TiledDrawingArea();
virtual void setNeedsDisplay(const WebCore::IntRect&);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
virtual void display();
#if USE(ACCELERATED_COMPOSITING)
virtual void attachCompositingContext() { }
virtual void detachCompositingContext() { }
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) { }
virtual void scheduleCompositingLayerSync() { }
virtual void syncCompositingLayers() { }
#endif
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
private:
void scheduleDisplay();
void setSize(const WebCore::IntSize& viewSize);
void suspendPainting();
void resumePainting();
void didUpdate();
void updateTile(int tileID, const WebCore::IntRect& dirtyRect, float scale);
void paintIntoUpdateChunk(UpdateChunk*, float scale);
void tileUpdateTimerFired();
WebCore::IntRect m_dirtyRect;
bool m_isWaitingForUpdate;
bool m_shouldPaint;
RunLoop::Timer<TiledDrawingArea> m_displayTimer;
struct TileUpdate {
int tileID;
WebCore::IntRect dirtyRect;
float scale;
};
typedef HashMap<int, TileUpdate> UpdateMap;
UpdateMap m_pendingUpdates;
RunLoop::Timer<TiledDrawingArea> m_tileUpdateTimer;
};
}
#endif // TILED_BACKING_STORE
#endif // TiledDrawingArea_h