blob: b648e7222209f1928918dd292bcef23ecc9b9c98 [file] [log] [blame]
#include "config.h"
#include "PicturePileLayerContent.h"
#include "SkCanvas.h"
#include "SkPicture.h"
namespace WebCore {
PicturePileLayerContent::PicturePileLayerContent(const PicturePile& picturePile)
: m_picturePile(picturePile)
{
}
void PicturePileLayerContent::draw(SkCanvas* canvas)
{
android::Mutex::Autolock lock(m_drawLock);
m_picturePile.draw(canvas);
}
void PicturePileLayerContent::serialize(SkWStream* stream)
{
if (!stream)
return;
SkPicture picture;
draw(picture.beginRecording(width(), height(),
SkPicture::kUsePathBoundsForClip_RecordingFlag));
picture.endRecording();
picture.serialize(stream);
}
PrerenderedInval* PicturePileLayerContent::prerenderForRect(const IntRect& dirty)
{
return m_picturePile.prerenderedInvalForArea(dirty);
}
void PicturePileLayerContent::clearPrerenders()
{
m_picturePile.clearPrerenders();
}
} // namespace WebCore