#ifndef LayerTile_h
#define LayerTile_h
#if USE(ACCELERATED_COMPOSITING)
#include "Texture.h"
#include <wtf/RefPtr.h>
class SkBitmap;
namespace WebCore {
class Color;
class IntRect;
class TileIndex;
class LayerTileData {
public:
LayerTileData()
: m_visible(false)
{
}
bool isVisible() const { return m_visible; }
protected:
bool m_visible;
};
class LayerTile : public LayerTileData {
WTF_MAKE_FAST_ALLOCATED;
public:
LayerTile();
~LayerTile();
Texture* texture() const { return m_texture.get(); }
bool isVisible() const { return m_visible; }
void setVisible(bool);
bool isDirty() const { return m_contentsDirty || !m_texture || m_texture->isDirty(); }
bool hasTexture() const { return m_texture && m_texture->hasTexture(); }
void setContents(const SkBitmap& contents, const IntRect& tileRect, const TileIndex&, bool isOpaque);
void setContentsToColor(const Color&);
void updateContents(const SkBitmap& contents, const IntRect& dirtyRect, const IntRect& tileRect, bool isOpaque);
void discardContents();
void setContentsDirty() { m_contentsDirty = true; }
private:
void setTexture(PassRefPtr<Texture>);
RefPtr<Texture> m_texture;
bool m_contentsDirty;
};
}
#endif // USE(ACCELERATED_COMPOSITING)
#endif // Texture_h