summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/layers
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/android/layers')
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp8
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h1
-rw-r--r--Source/WebCore/platform/graphics/android/layers/CanvasLayer.cpp28
-rw-r--r--Source/WebCore/platform/graphics/android/layers/CanvasLayer.h4
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp69
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.h7
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerContent.h7
-rw-r--r--Source/WebCore/platform/graphics/android/layers/MediaLayer.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp41
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h (renamed from Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.h)22
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.cpp41
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PrerenderedInval.h58
12 files changed, 195 insertions, 93 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
index bc3b04b..4f89dc9 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
@@ -69,6 +69,14 @@ IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport,
return LayerAndroid::updatePosition(viewport, parentIframeLayer);
}
+void BaseLayerAndroid::updatePositionsRecursive(const SkRect& visibleContentRect)
+{
+ updateLayerPositions(visibleContentRect);
+ TransformationMatrix ident;
+ FloatRect clip(0, 0, 1e10, 1e10);
+ updateGLPositionsAndScale(ident, clip, 1, state()->scale());
+}
+
ForegroundBaseLayerAndroid::ForegroundBaseLayerAndroid(LayerContent* content)
: LayerAndroid((RenderLayer*)0)
{
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
index dc4c25f..6275dfd 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
@@ -42,6 +42,7 @@ public:
virtual bool needsTexture() { return content(); }
virtual IFrameLayerAndroid* updatePosition(SkRect viewport,
IFrameLayerAndroid* parentIframeLayer);
+ void updatePositionsRecursive(const SkRect& visibleContentRect);
void setBackgroundColor(Color& color) { m_color = color; }
Color getBackgroundColor() { return m_color; }
diff --git a/Source/WebCore/platform/graphics/android/layers/CanvasLayer.cpp b/Source/WebCore/platform/graphics/android/layers/CanvasLayer.cpp
index 1813903..93806ff 100644
--- a/Source/WebCore/platform/graphics/android/layers/CanvasLayer.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/CanvasLayer.cpp
@@ -63,13 +63,13 @@ CanvasLayer::CanvasLayer(const CanvasLayer& layer)
if (!layer.m_canvas) {
// The canvas has already been destroyed - this shouldn't happen
ALOGW("Creating a CanvasLayer for a destroyed canvas!");
- m_contentRect = IntRect();
+ m_visibleContentRect = IntRect();
m_offsetFromRenderer = IntSize();
m_texture->setHwAccelerated(false);
return;
}
// We are making a copy for the UI, sync the interesting bits
- m_contentRect = layer.contentRect();
+ m_visibleContentRect = layer.visibleContentRect();
m_offsetFromRenderer = layer.offsetFromRenderer();
bool previousState = m_texture->hasValidTexture();
if (!previousState && layer.m_dirtyCanvas.isEmpty()) {
@@ -86,7 +86,7 @@ CanvasLayer::CanvasLayer(const CanvasLayer& layer)
// Merge the canvas invals with the layer's invals to repaint the needed
// tiles.
SkRegion::Iterator iter(layer.m_dirtyCanvas);
- const IntPoint& offset = m_contentRect.location();
+ const IntPoint& offset = m_visibleContentRect.location();
for (; !iter.done(); iter.next()) {
SkIRect diff = iter.rect();
diff.fLeft += offset.x();
@@ -98,8 +98,8 @@ CanvasLayer::CanvasLayer(const CanvasLayer& layer)
}
if (previousState != m_texture->hasValidTexture()) {
// Need to do a full inval of the canvas content as we are mode switching
- m_dirtyRegion.op(m_contentRect.x(), m_contentRect.y(),
- m_contentRect.maxX(), m_contentRect.maxY(), SkRegion::kUnion_Op);
+ m_dirtyRegion.op(m_visibleContentRect.x(), m_visibleContentRect.y(),
+ m_visibleContentRect.maxX(), m_visibleContentRect.maxY(), SkRegion::kUnion_Op);
}
}
}
@@ -160,7 +160,7 @@ SkBitmapRef* CanvasLayer::bitmap() const
return m_canvas->copiedImage()->nativeImageForCurrentFrame();
}
-IntRect CanvasLayer::contentRect() const
+IntRect CanvasLayer::visibleContentRect() const
{
if (!m_canvas
|| !m_canvas->renderer()
@@ -178,18 +178,18 @@ IntSize CanvasLayer::offsetFromRenderer() const
bool CanvasLayer::needsTexture()
{
- return m_bitmap || LayerAndroid::needsTexture();
+ return (m_bitmap && !masksToBounds()) || LayerAndroid::needsTexture();
}
void CanvasLayer::contentDraw(SkCanvas* canvas, PaintStyle style)
{
LayerAndroid::contentDraw(canvas, style);
- if (!m_bitmap)
+ if (!m_bitmap || masksToBounds())
return;
SkBitmap& bitmap = m_bitmap->bitmap();
- SkRect dst = SkRect::MakeXYWH(m_contentRect.x() - m_offsetFromRenderer.width(),
- m_contentRect.y() - m_offsetFromRenderer.height(),
- m_contentRect.width(), m_contentRect.height());
+ SkRect dst = SkRect::MakeXYWH(m_visibleContentRect.x() - m_offsetFromRenderer.width(),
+ m_visibleContentRect.y() - m_offsetFromRenderer.height(),
+ m_visibleContentRect.width(), m_visibleContentRect.height());
canvas->drawBitmapRect(bitmap, 0, dst, 0);
}
@@ -198,9 +198,9 @@ bool CanvasLayer::drawGL(bool layerTilesDisabled)
bool ret = LayerAndroid::drawGL(layerTilesDisabled);
m_texture->requireTexture();
if (!m_bitmap && m_texture->updateTexImage()) {
- SkRect rect = SkRect::MakeXYWH(m_contentRect.x() - m_offsetFromRenderer.width(),
- m_contentRect.y() - m_offsetFromRenderer.height(),
- m_contentRect.width(), m_contentRect.height());
+ SkRect rect = SkRect::MakeXYWH(m_visibleContentRect.x() - m_offsetFromRenderer.width(),
+ m_visibleContentRect.y() - m_offsetFromRenderer.height(),
+ m_visibleContentRect.width(), m_visibleContentRect.height());
TextureQuadData data(m_texture->texture(), GL_TEXTURE_EXTERNAL_OES,
GL_LINEAR, LayerQuad, &m_drawTransform, &rect);
TilesManager::instance()->shader()->drawQuad(&data);
diff --git a/Source/WebCore/platform/graphics/android/layers/CanvasLayer.h b/Source/WebCore/platform/graphics/android/layers/CanvasLayer.h
index 532dbf2..2bfed1e 100644
--- a/Source/WebCore/platform/graphics/android/layers/CanvasLayer.h
+++ b/Source/WebCore/platform/graphics/android/layers/CanvasLayer.h
@@ -63,11 +63,11 @@ private:
void init();
SkBitmapRef* bitmap() const;
- IntRect contentRect() const;
+ IntRect visibleContentRect() const;
IntSize offsetFromRenderer() const;
HTMLCanvasElement* m_canvas;
- IntRect m_contentRect;
+ IntRect m_visibleContentRect;
IntSize m_offsetFromRenderer;
SkRegion m_dirtyCanvas;
SkBitmapRef* m_bitmap;
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
index 69c597f..5655ef6 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
@@ -20,6 +20,7 @@
#include "MediaLayer.h"
#include "ParseCanvas.h"
#include "PictureLayerContent.h"
+#include "PrerenderedInval.h"
#include "SkBitmapRef.h"
#include "SkDrawFilter.h"
#include "SkPaint.h"
@@ -248,9 +249,12 @@ void LayerAndroid::addDirtyArea()
{
IntSize layerSize(getSize().width(), getSize().height());
- FloatRect area = TilesManager::instance()->shader()->rectInInvScreenCoord(m_drawTransform, layerSize);
- FloatRect clippingRect = TilesManager::instance()->shader()->rectInScreenCoord(m_clippingRect);
- FloatRect clip = TilesManager::instance()->shader()->convertScreenCoordToInvScreenCoord(clippingRect);
+ FloatRect area =
+ TilesManager::instance()->shader()->rectInViewCoord(m_drawTransform, layerSize);
+ FloatRect clippingRect =
+ TilesManager::instance()->shader()->rectInInvViewCoord(m_clippingRect);
+ FloatRect clip =
+ TilesManager::instance()->shader()->convertInvViewCoordToViewCoord(clippingRect);
area.intersect(clip);
IntRect dirtyArea(area.x(), area.y(), area.width(), area.height());
@@ -409,7 +413,8 @@ void LayerAndroid::updatePositions()
}
void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentMatrix,
- const FloatRect& clipping, float opacity, float scale)
+ const FloatRect& clipping, float opacity,
+ float scale)
{
IntSize layerSize(getSize().width(), getSize().height());
FloatPoint anchorPoint(getAnchorPoint().fX, getAnchorPoint().fY);
@@ -440,7 +445,9 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM
m_drawTransform.setM42(desiredContentY);
}
- m_zValue = TilesManager::instance()->shader()->zValue(m_drawTransform, getSize().width(), getSize().height());
+ m_zValue = TilesManager::instance()->shader()->zValue(m_drawTransform,
+ getSize().width(),
+ getSize().height());
m_atomicSync.lock();
m_scale = scale;
@@ -450,7 +457,8 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM
setDrawOpacity(opacity);
if (m_haveClip) {
- // The clipping rect calculation and intersetion will be done in documents coordinates.
+ // The clipping rect calculation and intersetion will be done in content
+ // coordinates.
FloatRect rect(0, 0, layerSize.width(), layerSize.height());
FloatRect clip = m_drawTransform.mapRect(rect);
clip.intersect(clipping);
@@ -460,7 +468,8 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM
}
ALOGV("%s - %d %f %f %f %f",
subclassType() == BaseLayer ? "BASE" : "nonbase",
- m_haveClip, m_clippingRect.x(), m_clippingRect.y(), m_clippingRect.width(), m_clippingRect.height());
+ m_haveClip, m_clippingRect.x(), m_clippingRect.y(),
+ m_clippingRect.width(), m_clippingRect.height());
if (!m_backfaceVisibility
&& m_drawTransform.inverse().m33() < 0) {
@@ -524,6 +533,23 @@ void LayerAndroid::setContent(LayerContent* content)
m_content = content;
}
+bool LayerAndroid::canUpdateWithBlit()
+{
+ if (!m_content || !m_scale)
+ return false;
+ IntRect clip = clippedRect();
+ IntRect dirty = m_dirtyRegion.getBounds();
+ dirty.intersect(clip);
+ PrerenderedInval* prerendered = m_content->prerenderForRect(dirty);
+ if (!prerendered)
+ return false;
+ // Check that the scales are "close enough" to produce the same rects
+ FloatRect screenArea = prerendered->screenArea;
+ screenArea.scale(1 / m_scale);
+ IntRect enclosingDocArea = enclosingIntRect(screenArea);
+ return enclosingDocArea == prerendered->area;
+}
+
bool LayerAndroid::needsTexture()
{
return m_content && !m_content->isEmpty();
@@ -533,7 +559,7 @@ IntRect LayerAndroid::clippedRect() const
{
IntRect r(0, 0, getWidth(), getHeight());
IntRect tr = m_drawTransform.mapRect(r);
- IntRect cr = TilesManager::instance()->shader()->clippedRectWithViewport(tr);
+ IntRect cr = TilesManager::instance()->shader()->clippedRectWithVisibleContentRect(tr);
IntRect rect = m_drawTransform.inverse().mapRect(cr);
return rect;
}
@@ -567,20 +593,21 @@ void LayerAndroid::showLayer(int indent)
if (!indent) {
ALOGD("\n\n--- LAYERS TREE ---");
- IntRect documentViewport(TilesManager::instance()->shader()->documentViewport());
- ALOGD("documentViewport(%d, %d, %d, %d)",
- documentViewport.x(), documentViewport.y(),
- documentViewport.width(), documentViewport.height());
+ IntRect contentViewport(TilesManager::instance()->shader()->contentViewport());
+ ALOGD("contentViewport(%d, %d, %d, %d)",
+ contentViewport.x(), contentViewport.y(),
+ contentViewport.width(), contentViewport.height());
}
IntRect r(0, 0, getWidth(), getHeight());
IntRect tr = m_drawTransform.mapRect(r);
- IntRect visible = visibleArea();
+ IntRect visible = visibleContentArea();
IntRect clip(m_clippingRect.x(), m_clippingRect.y(),
m_clippingRect.width(), m_clippingRect.height());
ALOGD("%s %s %s (%d) [%d:0x%x] - %s %s - area (%d, %d, %d, %d) - visible (%d, %d, %d, %d) "
"clip (%d, %d, %d, %d) %s %s m_content(%x), pic w: %d h: %d",
- spaces, m_haveClip ? "CLIP LAYER" : "", subclassName().ascii().data(), subclassType(), uniqueId(), m_owningLayer,
+ spaces, m_haveClip ? "CLIP LAYER" : "", subclassName().ascii().data(),
+ subclassType(), uniqueId(), m_owningLayer,
needsTexture() ? "needs a texture" : "no texture",
m_imageCRC ? "has an image" : "no image",
tr.x(), tr.y(), tr.width(), tr.height(),
@@ -735,7 +762,7 @@ int LayerAndroid::setHwAccelerated(bool hwAccelerated)
return flags | onSetHwAccelerated(hwAccelerated);
}
-IntRect LayerAndroid::unclippedArea()
+IntRect LayerAndroid::fullContentArea()
{
IntRect area;
area.setX(0);
@@ -745,13 +772,13 @@ IntRect LayerAndroid::unclippedArea()
return area;
}
-IntRect LayerAndroid::visibleArea()
+IntRect LayerAndroid::visibleContentArea()
{
- IntRect area = unclippedArea();
+ IntRect area = fullContentArea();
if (subclassType() == LayerAndroid::FixedBackgroundBaseLayer)
return area;
// First, we get the transformed area of the layer,
- // in document coordinates
+ // in content coordinates
IntRect rect = m_drawTransform.mapRect(area);
int dx = rect.x();
int dy = rect.y();
@@ -760,9 +787,9 @@ IntRect LayerAndroid::visibleArea()
IntRect clip(m_clippingRect);
rect.intersect(clip);
- // Now clip with the viewport in documents coordinate
- IntRect documentViewport(TilesManager::instance()->shader()->documentViewport());
- rect.intersect(documentViewport);
+ // Now clip with the viewport in content coordinate
+ IntRect contentViewport(TilesManager::instance()->shader()->contentViewport());
+ rect.intersect(contentViewport);
// Finally, let's return the visible area, in layers coordinate
rect.move(-dx, -dy);
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
index 4f94698..170ef41 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h
@@ -140,8 +140,8 @@ public:
IntRect clippedRect() const;
bool outsideViewport();
- IntRect unclippedArea();
- IntRect visibleArea();
+ IntRect fullContentArea();
+ IntRect visibleContentArea();
virtual bool needsTexture();
@@ -185,6 +185,9 @@ public:
LayerContent* content() { return m_content; }
void setContent(LayerContent* content);
+ // Check to see if the dirty area of this layer can be updated with a blit
+ // from the prerender instead of needing to generate tiles from the LayerContent
+ bool canUpdateWithBlit();
void addAnimation(PassRefPtr<AndroidAnimation> anim);
void removeAnimationsForProperty(AnimatedPropertyID property);
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerContent.h b/Source/WebCore/platform/graphics/android/layers/LayerContent.h
index 97bc32a..2cd90a90 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerContent.h
+++ b/Source/WebCore/platform/graphics/android/layers/LayerContent.h
@@ -26,6 +26,7 @@
#ifndef LayerContent_h
#define LayerContent_h
+#include "IntRect.h"
#include "SkRefCnt.h"
#include <utils/threads.h>
@@ -35,14 +36,18 @@ class SkWStream;
namespace WebCore {
+class PrerenderedInval;
+
class LayerContent : public SkRefCnt {
public:
virtual int width() = 0;
virtual int height() = 0;
- virtual bool isEmpty() = 0;
+ virtual bool isEmpty() { return !width() || !height(); }
virtual void checkForOptimisations() = 0;
virtual bool hasText() = 0;
virtual void draw(SkCanvas* canvas) = 0;
+ virtual PrerenderedInval* prerenderForRect(const IntRect& dirty) { return 0; }
+ virtual void clearPrerenders() { };
virtual void serialize(SkWStream* stream) = 0;
diff --git a/Source/WebCore/platform/graphics/android/layers/MediaLayer.cpp b/Source/WebCore/platform/graphics/android/layers/MediaLayer.cpp
index 6227ea4..7a3730b 100644
--- a/Source/WebCore/platform/graphics/android/layers/MediaLayer.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/MediaLayer.cpp
@@ -56,7 +56,7 @@ MediaLayer::~MediaLayer()
bool MediaLayer::drawGL(bool layerTilesDisabled)
{
- FloatRect clippingRect = TilesManager::instance()->shader()->rectInScreenCoord(drawClip());
+ FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(drawClip());
TilesManager::instance()->shader()->clip(clippingRect);
// when the plugin gains focus webkit applies an outline to the
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
diff --git a/Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.h b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
index 61fc3f4..4216617 100644
--- a/Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.h
+++ b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
@@ -23,31 +23,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PictureSetLayerContent_h
-#define PictureSetLayerContent_h
+#ifndef PicturePileLayerContent_h
+#define PicturePileLayerContent_h
#include "LayerContent.h"
-#include "PictureSet.h"
+#include "PicturePile.h"
namespace WebCore {
-class PictureSetLayerContent : public LayerContent {
+class PicturePileLayerContent : public LayerContent {
public:
- PictureSetLayerContent(const android::PictureSet& pictureSet);
- ~PictureSetLayerContent();
+ PicturePileLayerContent(const PicturePile& picturePile);
- virtual int width() { return m_pictureSet.width(); }
- virtual int height() { return m_pictureSet.height(); }
- virtual bool isEmpty() { return m_pictureSet.isEmpty(); }
+ virtual int width() { return m_picturePile.size().width(); }
+ virtual int height() { return m_picturePile.size().height(); }
virtual void checkForOptimisations() {}
virtual bool hasText() { return true; }
virtual void draw(SkCanvas* canvas);
virtual void serialize(SkWStream* stream);
+ virtual PrerenderedInval* prerenderForRect(const IntRect& dirty);
+ virtual void clearPrerenders();
private:
- android::PictureSet m_pictureSet;
+ PicturePile m_picturePile;
};
} // WebCore
-#endif // PictureLayerContent_h
+#endif // PicturePileLayerContent_h
diff --git a/Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.cpp b/Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.cpp
deleted file mode 100644
index 8b72b0a..0000000
--- a/Source/WebCore/platform/graphics/android/layers/PictureSetLayerContent.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "config.h"
-#include "PictureSetLayerContent.h"
-
-#include "SkCanvas.h"
-#include "SkPicture.h"
-
-namespace WebCore {
-
-PictureSetLayerContent::PictureSetLayerContent(const android::PictureSet& pictureSet)
-{
- m_pictureSet.set(pictureSet);
-}
-
-PictureSetLayerContent::~PictureSetLayerContent()
-{
- m_pictureSet.clear();
-}
-
-void PictureSetLayerContent::draw(SkCanvas* canvas)
-{
- if (m_pictureSet.isEmpty())
- return;
-
- android::Mutex::Autolock lock(m_drawLock);
- SkRect r = SkRect::MakeWH(width(), height());
- canvas->clipRect(r);
- m_pictureSet.draw(canvas);
-}
-
-void PictureSetLayerContent::serialize(SkWStream* stream)
-{
- if (!stream)
- return;
- SkPicture picture;
- draw(picture.beginRecording(m_pictureSet.width(), m_pictureSet.height(),
- SkPicture::kUsePathBoundsForClip_RecordingFlag));
- picture.endRecording();
- picture.serialize(stream);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/layers/PrerenderedInval.h b/Source/WebCore/platform/graphics/android/layers/PrerenderedInval.h
new file mode 100644
index 0000000..91f385d
--- /dev/null
+++ b/Source/WebCore/platform/graphics/android/layers/PrerenderedInval.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PrerenderedInval_h
+#define PrerenderedInval_h
+
+#include "IntRect.h"
+#include "SkBitmap.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace WebCore {
+
+class PrerenderedInval : public ThreadSafeRefCounted<PrerenderedInval> {
+ WTF_MAKE_NONCOPYABLE(PrerenderedInval);
+public:
+ SkBitmap bitmap;
+ IntRect area;
+ IntRect screenArea;
+
+ static PassRefPtr<PrerenderedInval> create(const IntRect& ir)
+ {
+ return adoptRef(new PrerenderedInval(ir));
+ }
+
+private:
+ PrerenderedInval(const IntRect& ir)
+ : area(ir)
+ {}
+};
+
+} // namespace WebCore
+
+#endif // PrerenderedInval_h