OSDN Git Service

Fix layer initialization
authorChris Craik <ccraik@google.com>
Fri, 14 Oct 2011 22:06:28 +0000 (15:06 -0700)
committerChris Craik <ccraik@google.com>
Fri, 14 Oct 2011 22:22:26 +0000 (15:22 -0700)
bug:5452786

Fixed layer initialization to reference its current layer's SkPicture when it's
created

Change-Id: I4ac33ad6874a982d375859445e2a014ff35d7e12

Source/WebCore/platform/graphics/android/PaintedSurface.cpp
Source/WebCore/platform/graphics/android/PaintedSurface.h

index 1eb51c7..d48c116 100644 (file)
 
 namespace WebCore {
 
+PaintedSurface::PaintedSurface(LayerAndroid* layer)
+    : m_layer(layer)
+    , m_tiledTexture(0)
+    , m_scale(0)
+    , m_pictureUsed(0)
+{
+    TilesManager::instance()->addPaintedSurface(this);
+    SkSafeRef(m_layer);
+#ifdef DEBUG_COUNT
+    ClassTracker::instance()->increment("PaintedSurface");
+#endif
+    m_tiledTexture = new TiledTexture(this);
+    if (layer && layer->picture())
+        m_updateManager.updatePicture(layer->picture());
+}
+
 PaintedSurface::~PaintedSurface()
 {
     XLOG("dtor of %x m_layer: %x", this, m_layer);
index cda5960..5df76db 100644 (file)
@@ -47,19 +47,7 @@ class UpdateManager;
 
 class PaintedSurface : public SkRefCnt {
 public:
-    PaintedSurface(LayerAndroid* layer)
-        : m_layer(layer)
-        , m_tiledTexture(0)
-        , m_scale(0)
-        , m_pictureUsed(0)
-    {
-        TilesManager::instance()->addPaintedSurface(this);
-        SkSafeRef(m_layer);
-#ifdef DEBUG_COUNT
-        ClassTracker::instance()->increment("PaintedSurface");
-#endif
-        m_tiledTexture = new TiledTexture(this);
-    }
+    PaintedSurface(LayerAndroid* layer);
     virtual ~PaintedSurface();
 
     // PaintedSurface methods