diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp new file mode 100644 index 0000000..b648e72 --- /dev/null +++ b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp @@ -0,0 +1,41 @@ +#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 |