[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 13:30:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0a00f3744ca32857cd99188759dbae628951be15
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 17 19:00:03 2010 +0000

    2010-09-17  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Chris Marrin.
    
            Remove scroll and clip layers for WKCACFLayerRenderer
            https://bugs.webkit.org/show_bug.cgi?id=45922
    
            WKCACFLayerRenderer no longer needs its own layers for managing scrolling
            and clipping, because RenderLayerCompositor provides this functionality.
    
            * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
            (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer): Remove call to setScrollFrame().
            (WebCore::MediaPlayerPrivateFullscreenWindow::wndProc): Ditto.
    
            * platform/graphics/win/WKCACFLayerRenderer.cpp: Remove references to scroll and clip layers
            (WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer):
            (WebCore::WKCACFLayerRenderer::setRootChildLayer):
            (WebCore::WKCACFLayerRenderer::destroyRenderer):
            (WebCore::WKCACFLayerRenderer::resize):
            * platform/graphics/win/WKCACFLayerRenderer.h:
    
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::layerTreeAsText): Dump the layers from the root platform layer.
            (WebCore::RenderLayerCompositor::requiresScrollLayer): On Windows,
            always say yes.
    
    2010-09-17  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Chris Marrin.
    
            Remove scroll and clip layers for WKCACFLayerRenderer
            https://bugs.webkit.org/show_bug.cgi?id=45922
    
            WKCACFLayerRenderer no longer needs its own layers for managing scrolling
            and clipping, because RenderLayerCompositor provides this functionality.
    
            * WebView.cpp:
            (WebView::sizeChanged): Moved code that handles the WM_SIZE message
            into this method. Use it to resize the layer renderer.
            (WebView::WebViewWndProc): Call sizeChanged().
            (WebView::updateRootLayerContents): No need to call setScrollFrame() any more.
            (WebView::layerRendererBecameVisible): Move this from the header (no need to be inline).
            * WebView.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67735 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1a550da..7c2b45c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-09-17  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Remove scroll and clip layers for WKCACFLayerRenderer
+        https://bugs.webkit.org/show_bug.cgi?id=45922
+
+        WKCACFLayerRenderer no longer needs its own layers for managing scrolling
+        and clipping, because RenderLayerCompositor provides this functionality.
+
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+        (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer): Remove call to setScrollFrame().
+        (WebCore::MediaPlayerPrivateFullscreenWindow::wndProc): Ditto.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp: Remove references to scroll and clip layers
+        (WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer):
+        (WebCore::WKCACFLayerRenderer::setRootChildLayer):
+        (WebCore::WKCACFLayerRenderer::destroyRenderer):
+        (WebCore::WKCACFLayerRenderer::resize):
+        * platform/graphics/win/WKCACFLayerRenderer.h:
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerTreeAsText): Dump the layers from the root platform layer.
+        (WebCore::RenderLayerCompositor::requiresScrollLayer): On Windows,
+        always say yes.
+
 2010-09-17  Jian Li  <jianli at chromium.org>
 
         Reviewed by Dmitry Titov.
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
old mode 100644
new mode 100755
index fab0114..e14f26c
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -876,15 +876,7 @@ String Frame::layerTreeAsText() const
     if (!contentRenderer())
         return String();
 
-    RenderLayerCompositor* compositor = contentRenderer()->compositor();
-    if (compositor->compositingLayerUpdatePending())
-        compositor->updateCompositingLayers();
-
-    GraphicsLayer* rootLayer = compositor->rootPlatformLayer();
-    if (!rootLayer)
-        return String();
-
-    return rootLayer->layerTreeAsText();
+    return contentRenderer()->compositor()->layerTreeAsText();
 #else
     return String();
 #endif
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index e2a3e1d..dad5da1 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -447,14 +447,6 @@ void GraphicsLayerCACF::swapFromOrToTiledLayer(bool useTiledLayer)
         m_layer = WebLayer::create(WKCACFLayer::Layer, this);
     
     m_usingTiledLayer = useTiledLayer;
-
-    // FIXME: need this?
-//    if (useTiledLayer) {
-//        if (GraphicsLayer::compositingCoordinatesOrientation() == GraphicsLayer::CompositingCoordinatesBottomUp)
-//            m_layer->setContentsGravity(WKCACFLayer::BottomLeft);
-//        else
-//            m_layer->setContentsGravity(WKCACFLayer::TopLeft);
-//    }
     
     m_layer->adoptSublayers(oldLayer.get());
     if (oldLayer->superlayer())
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
old mode 100644
new mode 100755
index e664f2a..4a7e45e
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
@@ -107,7 +107,6 @@ void MediaPlayerPrivateFullscreenWindow::setRootChildLayer(PassRefPtr<WKCACFLaye
     WKCACFLayer* rootLayer = m_rootChild->rootLayer();
     CGRect rootBounds = m_rootChild->rootLayer()->bounds();
     m_rootChild->setFrame(rootBounds);
-    m_layerRenderer->setScrollFrame(IntPoint(rootBounds.origin), IntSize(rootBounds.size));
     m_rootChild->setBackgroundColor(CGColorGetConstantColor(kCGColorBlack));
 #ifndef NDEBUG
     RetainPtr<CGColorRef> redColor(AdoptCF, CGColorCreateGenericRGB(1, 0, 0, 1));
@@ -165,7 +164,6 @@ LRESULT MediaPlayerPrivateFullscreenWindow::wndProc(HWND hWnd, UINT message, WPA
             CGRect rootBounds = m_rootChild->rootLayer()->bounds();
             m_rootChild->setFrame(rootBounds);
             m_rootChild->setNeedsLayout();
-            m_layerRenderer->setScrollFrame(IntPoint(rootBounds.origin), IntSize(rootBounds.size));
 #endif
         }
         break;
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
old mode 100644
new mode 100755
index 38d524e..4f39b13
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
@@ -226,15 +226,11 @@ WKCACFLayerRenderer::WKCACFLayerRenderer(WKCACFLayerRendererClient* client)
     : m_client(client)
     , m_mightBeAbleToCreateDeviceLater(true)
     , m_rootLayer(WKCACFRootLayer::create(this))
-    , m_scrollLayer(WKCACFLayer::create(WKCACFLayer::Layer))
-    , m_clipLayer(WKCACFLayer::create(WKCACFLayer::Layer))
     , m_context(AdoptCF, CACFContextCreate(0))
     , m_renderContext(static_cast<CARenderContext*>(CACFContextGetRenderContext(m_context.get())))
     , m_renderer(0)
     , m_hostWindow(0)
     , m_renderTimer(this, &WKCACFLayerRenderer::renderTimerFired)
-    , m_scrollPosition(0, 0)
-    , m_scrollSize(1, 1)
     , m_backingStoreDirty(false)
     , m_mustResetLostDeviceBeforeRendering(false)
 {
@@ -250,15 +246,8 @@ WKCACFLayerRenderer::WKCACFLayerRenderer(WKCACFLayerRendererClient* client)
     // Scrolling will affect only the position of the scroll layer without affecting the bounds.
 
     m_rootLayer->setName("WKCACFLayerRenderer rootLayer");
-    m_clipLayer->setName("WKCACFLayerRenderer clipLayer");
-    m_scrollLayer->setName("WKCACFLayerRenderer scrollLayer");
-
-    m_rootLayer->addSublayer(m_clipLayer);
-    m_clipLayer->addSublayer(m_scrollLayer);
-    m_clipLayer->setMasksToBounds(true);
     m_rootLayer->setAnchorPoint(CGPointMake(0, 0));
-    m_scrollLayer->setAnchorPoint(CGPointMake(0, 1));
-    m_clipLayer->setAnchorPoint(CGPointMake(0, 1));
+    m_rootLayer->setGeometryFlipped(true);
 
 #ifndef NDEBUG
     CGColorRef debugColor = createCGColor(Color(255, 0, 0, 204));
@@ -285,26 +274,6 @@ WKCACFLayer* WKCACFLayerRenderer::rootLayer() const
     return m_rootLayer.get();
 }
 
-void WKCACFLayerRenderer::setScrollFrame(const IntPoint& position, const IntSize& size)
-{
-    m_scrollSize = size;
-    m_scrollPosition = position;
-
-    updateScrollFrame();
-}
-
-void WKCACFLayerRenderer::updateScrollFrame()
-{
-    CGRect frameBounds = bounds();
-    m_clipLayer->setBounds(CGRectMake(0, 0, m_scrollSize.width(), m_scrollSize.height()));
-    m_clipLayer->setPosition(CGPointMake(0, frameBounds.size.height));
-    if (m_rootChildLayer) {
-        CGRect rootBounds = m_rootChildLayer->bounds();
-        m_scrollLayer->setBounds(rootBounds);
-    }
-    m_scrollLayer->setPosition(CGPointMake(-m_scrollPosition.x(), m_scrollPosition.y() + m_scrollSize.height()));
-}
-
 void WKCACFLayerRenderer::setRootContents(CGImageRef image)
 {
     ASSERT(m_rootLayer);
@@ -321,17 +290,10 @@ void WKCACFLayerRenderer::setRootContentsAndDisplay(CGImageRef image)
 
 void WKCACFLayerRenderer::setRootChildLayer(WKCACFLayer* layer)
 {
-    if (!m_scrollLayer)
-        return;
-
-    m_scrollLayer->removeAllSublayers();
+    m_rootLayer->removeAllSublayers();
     m_rootChildLayer = layer;
-    if (layer) {
-        layer->setGeometryFlipped(true);
-        m_scrollLayer->addSublayer(layer);
-        // Adjust the scroll frame accordingly
-        updateScrollFrame();
-    }
+    if (m_rootChildLayer)
+        m_rootLayer->addSublayer(m_rootChildLayer);
 }
    
 void WKCACFLayerRenderer::layerTreeDidChange()
@@ -436,8 +398,6 @@ void WKCACFLayerRenderer::destroyRenderer()
 
     s_d3d = 0;
     m_rootLayer = 0;
-    m_clipLayer = 0;
-    m_scrollLayer = 0;
     m_rootChildLayer = 0;
 
     m_mightBeAbleToCreateDeviceLater = true;
@@ -455,7 +415,6 @@ void WKCACFLayerRenderer::resize()
     if (m_rootLayer) {
         m_rootLayer->setBounds(bounds());
         WKCACFContextFlusher::shared().flushAllContexts();
-        updateScrollFrame();
     }
 }
 
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
old mode 100644
new mode 100755
index 2647c5f..1d73b99
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
@@ -66,7 +66,6 @@ public:
     static bool acceleratedCompositingAvailable();
     static void didFlushContext(CACFContextRef);
 
-    void setScrollFrame(const IntPoint&, const IntSize&);
     void setRootContents(CGImageRef);
     void setRootContentsAndDisplay(CGImageRef);
     void setRootChildLayer(WKCACFLayer* layer);
@@ -78,7 +77,6 @@ public:
     void destroyRenderer();
     void resize();
     void renderSoon();
-    void updateScrollFrame();
 
 protected:
     WKCACFLayer* rootLayer() const;
@@ -105,16 +103,12 @@ private:
     bool m_mightBeAbleToCreateDeviceLater;
     COMPtr<IDirect3DDevice9> m_d3dDevice;
     RefPtr<WKCACFRootLayer> m_rootLayer;
-    RefPtr<WKCACFLayer> m_scrollLayer;
     RefPtr<WKCACFLayer> m_rootChildLayer;
-    RefPtr<WKCACFLayer> m_clipLayer;
     RetainPtr<CACFContextRef> m_context;
     CARenderContext* m_renderContext;
     CARenderOGLContext* m_renderer;
     HWND m_hostWindow;
     Timer<WKCACFLayerRenderer> m_renderTimer;
-    IntPoint m_scrollPosition;
-    IntSize m_scrollSize;
     bool m_backingStoreDirty;
     bool m_mustResetLostDeviceBeforeRendering;
 #ifndef NDEBUG
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
old mode 100644
new mode 100755
index 4bebb08..1468b6c
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -821,6 +821,19 @@ void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition)
         m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
 }
 
+String RenderLayerCompositor::layerTreeAsText()
+{
+    if (compositingLayerUpdatePending())
+        updateCompositingLayers();
+
+    if (!m_rootPlatformLayer)
+        return String();
+
+    // We skip dumping the scroll and clip layers to keep layerTreeAsText output
+    // similar between platforms.
+    return m_rootPlatformLayer->layerTreeAsText();
+}
+
 RenderLayerCompositor* RenderLayerCompositor::iframeContentsCompositor(RenderIFrame* renderer)
 {
     HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(renderer->node());
@@ -1281,16 +1294,9 @@ bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
 
 bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
 {
-    if (attachment == RootLayerAttachedViaEnclosingIframe)
-        return true;
-
-#if PLATFORM(MAC)
-    // If we're viewless (i.e. WebKit2), we need to scroll ourselves.
-    // FIXME: eventually we should do this on other platforms too.
-    if (!m_renderView->frameView()->platformWidget())
-        return true;
-#endif
-    return false;
+    // We need to handle our own scrolling if we're:
+    return !m_renderView->frameView()->platformWidget() // viewless (i.e. non-Mac, or Mac in WebKit2)
+        || attachment == RootLayerAttachedViaEnclosingIframe; // a composited iframe on Mac
 }
 
 void RenderLayerCompositor::ensureRootPlatformLayer()
diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h
old mode 100644
new mode 100755
index eeac203..910e883
--- a/WebCore/rendering/RenderLayerCompositor.h
+++ b/WebCore/rendering/RenderLayerCompositor.h
@@ -166,6 +166,8 @@ public:
     void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint());
     void frameViewDidScroll(const IntPoint& = IntPoint());
 
+    String layerTreeAsText();
+
 private:
     // Whether the given RL needs a compositing layer.
     bool needsToBeComposited(const RenderLayer*) const;
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 41b6fa9..d42d6cd 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-17  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Remove scroll and clip layers for WKCACFLayerRenderer
+        https://bugs.webkit.org/show_bug.cgi?id=45922
+
+        WKCACFLayerRenderer no longer needs its own layers for managing scrolling
+        and clipping, because RenderLayerCompositor provides this functionality.
+
+        * WebView.cpp:
+        (WebView::sizeChanged): Moved code that handles the WM_SIZE message
+        into this method. Use it to resize the layer renderer.
+        (WebView::WebViewWndProc): Call sizeChanged().
+        (WebView::updateRootLayerContents): No need to call setScrollFrame() any more.
+        (WebView::layerRendererBecameVisible): Move this from the header (no need to be inline).
+        * WebView.h:
+
 2010-09-16  Darin Adler  <darin at apple.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
old mode 100644
new mode 100755
index 13040fe..17c686e
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -854,6 +854,19 @@ void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const Int
     ::ReleaseDC(m_viewWindow, windowDC);
 }
 
+void WebView::sizeChanged(const IntSize& newSize)
+{
+    deleteBackingStore();
+
+    if (Frame* coreFrame = core(topLevelFrame()))
+        coreFrame->view()->resize(newSize);
+
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_layerRenderer)
+        m_layerRenderer->resize();
+#endif
+}
+
 // This emulates the Mac smarts for painting rects intelligently.  This is very
 // important for us, since we double buffer based off dirty rects.
 static void getUpdateRects(HRGN region, const IntRect& dirtyRect, Vector<IntRect>& rects)
@@ -2080,15 +2093,8 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam,
             break;
         // FIXME: We need to check WM_UNICHAR to support supplementary characters (that don't fit in 16 bits).
         case WM_SIZE:
-            if (lParam != 0) {
-                webView->deleteBackingStore();
-#if USE(ACCELERATED_COMPOSITING)
-                if (webView->isAcceleratedCompositing())
-                    webView->resizeLayerRenderer();
-#endif
-                if (Frame* coreFrame = core(mainFrameImpl))
-                    coreFrame->view()->resize(LOWORD(lParam), HIWORD(lParam));
-            }
+            if (lParam != 0)
+                webView->sizeChanged(IntSize(LOWORD(lParam), HIWORD(lParam)));
             break;
         case WM_SHOWWINDOW:
             lResult = DefWindowProc(hWnd, message, wParam, lParam);
@@ -6279,14 +6285,11 @@ void WebView::updateRootLayerContents()
         m_nextDisplayIsSynchronous = false;
     } else
         m_layerRenderer->setRootContents(backingStoreImage.get());
+}
 
-    // Set the frame and scroll position
-    Frame* coreFrame = core(m_mainFrame);
-    if (!coreFrame)
-        return;
-    FrameView* frameView = coreFrame->view();
-
-    m_layerRenderer->setScrollFrame(IntPoint(frameView->scrollX(), frameView->scrollY()), IntSize(frameView->layoutWidth(), frameView->layoutHeight()));
+void WebView::layerRendererBecameVisible()
+{
+    m_layerRenderer->createRenderer();
 }
 #endif
 
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
old mode 100644
new mode 100755
index a406c2e..61eb946
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -921,6 +921,8 @@ private:
     HRESULT resetZoom(bool isTextOnly);
     bool active();
 
+    void sizeChanged(const WebCore::IntSize&);
+
     enum WindowsToPaint { PaintWebViewOnly, PaintWebViewAndChildren };
     void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, const WebCore::IntRect& dirtyRect, WindowsToPaint);
     void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false, WindowsToPaint = PaintWebViewOnly);
@@ -1042,8 +1044,7 @@ protected:
     bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; }
     void setAcceleratedCompositing(bool);
     void updateRootLayerContents();
-    void resizeLayerRenderer() { m_layerRenderer->resize(); }
-    void layerRendererBecameVisible() { m_layerRenderer->createRenderer(); }
+    void layerRendererBecameVisible();
 
     OwnPtr<WebCore::WKCACFLayerRenderer> m_layerRenderer;
     bool m_isAcceleratedCompositing;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list