From 4c0f1a51d7d3b51a1f241aa700f9ed5b3b23998c Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Wed, 26 Jan 2011 14:46:30 -0800 Subject: Fix the flickering bug. We return any previous textures used by the layer until we get the new one ready. bug:3391157 bug:3393571 Change-Id: I81dce23f79be788c3c0bfb0ccfd54d08156dfe3f --- WebCore/platform/graphics/android/LayerTexture.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'WebCore/platform/graphics/android/LayerTexture.h') diff --git a/WebCore/platform/graphics/android/LayerTexture.h b/WebCore/platform/graphics/android/LayerTexture.h index fb1b9fb..042422d 100644 --- a/WebCore/platform/graphics/android/LayerTexture.h +++ b/WebCore/platform/graphics/android/LayerTexture.h @@ -38,15 +38,22 @@ class LayerTexture : public BackedDoubleBufferedTexture { : BackedDoubleBufferedTexture(w, h, config) , m_id(0) , m_scale(1) - , m_pictureUsed(-1) + , m_pictureUsed(0) + , m_ready(false) {} virtual ~LayerTexture() {}; int id() { return m_id; } void setId(int id) { m_id = id; } + bool ready() { return m_ready; } unsigned int pictureUsed() { return m_pictureUsed; } - void setPictureUsed(unsigned pictureUsed) { m_pictureUsed = pictureUsed; } + void setPictureUsed(unsigned pictureUsed) + { + if (!m_ready) + m_ready = true; + m_pictureUsed = pictureUsed; + } void setRect(const IntRect& r) { m_rect = r; } IntRect& rect() { return m_rect; } float scale() { return m_scale; } @@ -58,6 +65,7 @@ class LayerTexture : public BackedDoubleBufferedTexture { IntRect m_rect; float m_scale; unsigned int m_pictureUsed; + bool m_ready; }; } // namespace WebCore -- cgit v1.1