Remove knowledge of WKCACFContextFlusher from WKCACFLayer
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jul 2010 17:37:26 +0000 (17:37 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jul 2010 17:37:26 +0000 (17:37 +0000)
Fixes <http://webkit.org/b/43248> WKCACFLayer shouldn't know about
WKCACFContextFlusher

Reviewed by Sam Weinig.

* platform/graphics/win/WKCACFLayer.cpp:
(WebCore::WKCACFLayer::setNeedsCommit): Don't bother calling to
WKCACFContextFlusher. Our root layer will do this for us.

* platform/graphics/win/WKCACFLayerRenderer.cpp:
(WebCore::WKCACFRootLayer::setNeedsRender): Changed to call the new
layerTreeDidChange function.
(WebCore::WKCACFLayerRenderer::layerTreeDidChange): Added. Tells
WKCACFContextFlusher that the context has changed, and schedules a
render.

* platform/graphics/win/WKCACFLayerRenderer.h: Added
layerTreeDidChange.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64360 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/win/WKCACFLayer.cpp
WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
WebCore/platform/graphics/win/WKCACFLayerRenderer.h

index 81d538e0cd08691b3e226801d341467760d1466e..b241f5652353fb92b89243d394b49a415eb0d1a0 100644 (file)
@@ -1,3 +1,26 @@
+2010-07-30  Adam Roben  <aroben@apple.com>
+
+        Remove knowledge of WKCACFContextFlusher from WKCACFLayer
+
+        Fixes <http://webkit.org/b/43248> WKCACFLayer shouldn't know about
+        WKCACFContextFlusher
+
+        Reviewed by Sam Weinig.
+
+        * platform/graphics/win/WKCACFLayer.cpp:
+        (WebCore::WKCACFLayer::setNeedsCommit): Don't bother calling to
+        WKCACFContextFlusher. Our root layer will do this for us.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFRootLayer::setNeedsRender): Changed to call the new
+        layerTreeDidChange function.
+        (WebCore::WKCACFLayerRenderer::layerTreeDidChange): Added. Tells
+        WKCACFContextFlusher that the context has changed, and schedules a
+        render.
+
+        * platform/graphics/win/WKCACFLayerRenderer.h: Added
+        layerTreeDidChange.
+
 2010-07-29  Jeremy Orlow  <jorlow@chromium.org>
 
         Reviewed by Steve Block.
index 9d7465cf62aab8f455051fc5c4faab1e6512b3ec..b5f342748c4d02b7f2d605348f64b0ea3a94be8c 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "WKCACFLayer.h"
 
-#include "WKCACFContextFlusher.h"
 #include "WKCACFLayerRenderer.h"
 #include <wtf/text/CString.h>
 
@@ -176,15 +175,6 @@ void WKCACFLayer::setNeedsCommit()
 {
     WKCACFLayer* root = rootLayer();
 
-    CACFContextRef context = CACFLayerGetContext(root->layer());
-
-    // The context might now be set yet. This happens if a property gets set
-    // before placing the layer in the tree. In this case we don't need to 
-    // worry about remembering the context because we will when the layer is
-    // added to the tree.
-    if (context)
-        WKCACFContextFlusher::shared().addContext(context);
-
     // Call setNeedsRender on the root layer, which will cause a render to 
     // happen in WKCACFLayerRenderer
     root->setNeedsRender();
index 0ee61f338bd1b58a59f9d632cceecf97662c9ec0..2a355c29e06a098d4a0d3df4b252d8932e94b98b 100644 (file)
@@ -98,7 +98,7 @@ public:
         return adoptRef(new WKCACFRootLayer(renderer));
     }
 
-    virtual void setNeedsRender() { m_renderer->renderSoon(); }
+    virtual void setNeedsRender() { m_renderer->layerTreeDidChange(); }
 
     // Overload this to avoid calling setNeedsDisplay on the layer, which would override the contents
     // we have placed on the root layer.
@@ -333,6 +333,12 @@ void WKCACFLayerRenderer::setRootChildLayer(WKCACFLayer* layer)
     }
 }
    
+void WKCACFLayerRenderer::layerTreeDidChange()
+{
+    WKCACFContextFlusher::shared().addContext(m_context.get());
+    renderSoon();
+}
+
 void WKCACFLayerRenderer::setNeedsDisplay()
 {
     ASSERT(m_rootLayer);
index 1ff955a490a1b42a49fa384a377b46148f7ba035..2647c5f32414e5acafafb56056ce765824c6ffb9 100644 (file)
@@ -70,6 +70,7 @@ public:
     void setRootContents(CGImageRef);
     void setRootContentsAndDisplay(CGImageRef);
     void setRootChildLayer(WKCACFLayer* layer);
+    void layerTreeDidChange();
     void setNeedsDisplay();
     void setHostWindow(HWND window) { m_hostWindow = window; }
     void setBackingStoreDirty(bool dirty) { m_backingStoreDirty = dirty; }