summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h')
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
index 4fc123e..9f3a263 100644
--- a/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
+++ b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.h
@@ -35,18 +35,23 @@ class PicturePileLayerContent : public LayerContent {
public:
PicturePileLayerContent(const PicturePile& picturePile);
- virtual int width() { return m_picturePile.size().width(); }
- virtual int height() { return m_picturePile.size().height(); }
+ // return 0 when no content, so don't have to paint
+ virtual int width() { return m_hasContent ? m_picturePile.size().width() : 0; }
+ virtual int height() { return m_hasContent ? m_picturePile.size().height() : 0; }
+
virtual void setCheckForOptimisations(bool check) {}
- virtual void checkForOptimisations() {}
- virtual bool hasText() { return true; }
+ virtual void checkForOptimisations() {} // already performed, stored in m_hasText/m_hasContent
+ virtual bool hasText() { return m_hasText; }
virtual void draw(SkCanvas* canvas);
virtual void serialize(SkWStream* stream);
virtual PrerenderedInval* prerenderForRect(const IntRect& dirty);
virtual void clearPrerenders();
+ PicturePile* picturePile() { return &m_picturePile; }
private:
PicturePile m_picturePile;
+ bool m_hasText;
+ bool m_hasContent;
};
} // WebCore