Title: [124927] trunk/Source
Revision
124927
Author
jam...@google.com
Date
2012-08-07 15:30:09 -0700 (Tue, 07 Aug 2012)

Log Message

[chromium] Switch PlatformLayer typedef to Platform API type for PLATFORM(CHROMIUM)
https://bugs.webkit.org/show_bug.cgi?id=93335

Reviewed by Adrienne Walker.

Source/Platform:

Add APIs to control scrolling behavior on WebScrollableLayer.

* chromium/public/WebScrollableLayer.h:
(WebScrollableLayer):

Source/WebCore:

This converts the PlatformLayer typedef to WebKit::WebLayer (part of the chromium Platform API) for the
Chromium port. This involves some odd const_cast<>s in places since cross-platform interfaces assume that
PlatformLayer is a potentially heavy implementation class, but WebLayer is a thin smart pointer type.

* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::createScrollbarLayer):
(WebCore::ScrollingCoordinator::setScrollLayer):
(WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
(WebCore::ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers):
(WebCore::ScrollingCoordinator::setLayerIsFixedToContainerLayer):
* platform/graphics/PlatformLayer.h:
(WebKit):
(WebCore):
* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::Canvas2DLayerBridge::layer):
* platform/graphics/chromium/Canvas2DLayerBridge.h:
(Canvas2DLayerBridge):
* platform/graphics/chromium/DrawingBufferChromium.cpp:
(WebCore::DrawingBufferPrivate::layer):
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::removeFromParent):
(WebCore::GraphicsLayerChromium::setDrawsContent):
(WebCore::GraphicsLayerChromium::setContentsVisible):
(WebCore::GraphicsLayerChromium::setMaskLayer):
(WebCore::GraphicsLayerChromium::setContentsToCanvas):
(WebCore::GraphicsLayerChromium::setContentsToMedia):
(WebCore::GraphicsLayerChromium::primaryLayer):
(WebCore::GraphicsLayerChromium::platformLayer):
(WebCore::GraphicsLayerChromium::updateChildList):
* platform/graphics/chromium/GraphicsLayerChromium.h:
(GraphicsLayerChromium):

Source/WebKit/chromium:

Update for new PlatformLayer typedef. This removes knowledge of WebCore::LayerChromium from all classes
except for NonCompositedContentHost, which still punches through for a few minor APIs that I'll address
in a separate patch.

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::NonCompositedContentHost):
(WebKit::NonCompositedContentHost::setScrollLayer):
(WebKit::NonCompositedContentHost::scrollLayer):
(WebKit::NonCompositedContentHost::notifySyncRequired):
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::platformLayer):
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::platformLayer):
* src/WebPluginContainerImpl.h:
(WebCore):
(WebPluginContainerImpl):
* src/WebScrollableLayer.cpp:
(WebKit::WebScrollableLayer::setNonFastScrollableRegion):
(WebKit):
(WebKit::WebScrollableLayer::setIsContainerForFixedPositionLayers):
(WebKit::WebScrollableLayer::setFixedToContainerLayer):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setRootGraphicsLayer):
* tests/Canvas2DLayerBridgeTest.cpp:
* tests/GraphicsLayerChromiumTest.cpp:
(WebKitTests::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
(WebKitTests::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (124926 => 124927)


--- trunk/Source/Platform/ChangeLog	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/Platform/ChangeLog	2012-08-07 22:30:09 UTC (rev 124927)
@@ -1,5 +1,17 @@
 2012-08-07  James Robinson  <jam...@chromium.org>
 
+        [chromium] Switch PlatformLayer typedef to Platform API type for PLATFORM(CHROMIUM)
+        https://bugs.webkit.org/show_bug.cgi?id=93335
+
+        Reviewed by Adrienne Walker.
+
+        Add APIs to control scrolling behavior on WebScrollableLayer.
+
+        * chromium/public/WebScrollableLayer.h:
+        (WebScrollableLayer):
+
+2012-08-07  James Robinson  <jam...@chromium.org>
+
         [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
         https://bugs.webkit.org/show_bug.cgi?id=93398
 

Modified: trunk/Source/Platform/chromium/public/WebScrollableLayer.h (124926 => 124927)


--- trunk/Source/Platform/chromium/public/WebScrollableLayer.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/Platform/chromium/public/WebScrollableLayer.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -29,6 +29,8 @@
 #include "WebCommon.h"
 #include "WebLayer.h"
 #include "WebPoint.h"
+#include "WebRect.h"
+#include "WebVector.h"
 
 namespace WebKit {
 
@@ -47,7 +49,11 @@
     WEBKIT_EXPORT void setScrollable(bool);
     WEBKIT_EXPORT void setHaveWheelEventHandlers(bool);
     WEBKIT_EXPORT void setShouldScrollOnMainThread(bool);
+    WEBKIT_EXPORT void setNonFastScrollableRegion(const WebVector<WebRect>&);
+    WEBKIT_EXPORT void setIsContainerForFixedPositionLayers(bool);
+    WEBKIT_EXPORT void setFixedToContainerLayer(bool);
 
+
 #if WEBKIT_IMPLEMENTATION
     WebScrollableLayer(const WTF::PassRefPtr<WebCore::LayerChromium>& layer) : WebLayer(layer) { }
 #endif

Modified: trunk/Source/WebCore/ChangeLog (124926 => 124927)


--- trunk/Source/WebCore/ChangeLog	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/ChangeLog	2012-08-07 22:30:09 UTC (rev 124927)
@@ -1,5 +1,44 @@
 2012-08-07  James Robinson  <jam...@chromium.org>
 
+        [chromium] Switch PlatformLayer typedef to Platform API type for PLATFORM(CHROMIUM)
+        https://bugs.webkit.org/show_bug.cgi?id=93335
+
+        Reviewed by Adrienne Walker.
+
+        This converts the PlatformLayer typedef to WebKit::WebLayer (part of the chromium Platform API) for the
+        Chromium port. This involves some odd const_cast<>s in places since cross-platform interfaces assume that
+        PlatformLayer is a potentially heavy implementation class, but WebLayer is a thin smart pointer type.
+
+        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+        (WebCore::createScrollbarLayer):
+        (WebCore::ScrollingCoordinator::setScrollLayer):
+        (WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
+        (WebCore::ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers):
+        (WebCore::ScrollingCoordinator::setLayerIsFixedToContainerLayer):
+        * platform/graphics/PlatformLayer.h:
+        (WebKit):
+        (WebCore):
+        * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+        (WebCore::Canvas2DLayerBridge::layer):
+        * platform/graphics/chromium/Canvas2DLayerBridge.h:
+        (Canvas2DLayerBridge):
+        * platform/graphics/chromium/DrawingBufferChromium.cpp:
+        (WebCore::DrawingBufferPrivate::layer):
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::removeFromParent):
+        (WebCore::GraphicsLayerChromium::setDrawsContent):
+        (WebCore::GraphicsLayerChromium::setContentsVisible):
+        (WebCore::GraphicsLayerChromium::setMaskLayer):
+        (WebCore::GraphicsLayerChromium::setContentsToCanvas):
+        (WebCore::GraphicsLayerChromium::setContentsToMedia):
+        (WebCore::GraphicsLayerChromium::primaryLayer):
+        (WebCore::GraphicsLayerChromium::platformLayer):
+        (WebCore::GraphicsLayerChromium::updateChildList):
+        * platform/graphics/chromium/GraphicsLayerChromium.h:
+        (GraphicsLayerChromium):
+
+2012-08-07  James Robinson  <jam...@chromium.org>
+
         [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
         https://bugs.webkit.org/show_bug.cgi?id=93398
 

Modified: trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (124926 => 124927)


--- trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -29,7 +29,6 @@
 
 #include "Frame.h"
 #include "FrameView.h"
-#include "LayerChromium.h"
 #include "Region.h"
 #include "RenderLayerCompositor.h"
 #include "RenderView.h"
@@ -42,8 +41,10 @@
 #include <public/WebScrollbarThemePainter.h>
 
 using WebKit::WebLayer;
+using WebKit::WebRect;
 using WebKit::WebScrollableLayer;
 using WebKit::WebScrollbarLayer;
+using WebKit::WebVector;
 
 namespace WebCore {
 
@@ -118,7 +119,7 @@
 
     if (scrollLayer.isNull()) {
         // FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves.
-        scrollLayer = WebScrollableLayer(scrollLayerForFrameView(frameView)->platformLayer());
+        scrollLayer = scrollLayerForFrameView(frameView)->platformLayer()->to<WebScrollableLayer>();
         ASSERT(!scrollLayer.isNull());
     }
 
@@ -148,7 +149,7 @@
     WebScrollbarLayer scrollbarLayer = WebScrollbarLayer::create(scrollbar, painter, geometry.release());
     scrollbarLayer.setScrollLayer(scrollLayer);
 
-    scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer.unwrap<LayerChromium>());
+    scrollbarGraphicsLayer->setContentsToMedia(&scrollbarLayer);
     scrollbarGraphicsLayer->setDrawsContent(false);
     scrollbarLayer.setOpaque(scrollbarGraphicsLayer->contentsOpaque());
 
@@ -173,13 +174,21 @@
 
 void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
 {
-    m_private->setScrollLayer(WebScrollableLayer(scrollLayer ? scrollLayer->platformLayer() : 0));
+    WebScrollableLayer layer;
+    if (scrollLayer)
+        layer = scrollLayer->platformLayer()->to<WebScrollableLayer>();
+    m_private->setScrollLayer(layer);
 }
 
 void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
 {
-    if (m_private->hasScrollLayer())
-        m_private->scrollLayer().unwrap<LayerChromium>()->setNonFastScrollableRegion(region);
+    if (m_private->hasScrollLayer()) {
+        Vector<IntRect> rects = region.rects();
+        WebVector<WebRect> webRects(rects.size());
+        for (size_t i = 0; i < rects.size(); ++i)
+            webRects[i] = rects[i];
+        m_private->scrollLayer().setNonFastScrollableRegion(webRects);
+    }
 }
 
 void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
@@ -206,14 +215,14 @@
 
 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer* layer, bool enable)
 {
-    if (LayerChromium* platformLayer = layer->platformLayer())
-        platformLayer->setIsContainerForFixedPositionLayers(enable);
+    if (WebLayer* platformLayer = layer->platformLayer())
+        platformLayer->to<WebScrollableLayer>().setIsContainerForFixedPositionLayers(enable);
 }
 
 void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
 {
-    if (LayerChromium* platformLayer = layer->platformLayer())
-        platformLayer->setFixedToContainerLayer(enable);
+    if (WebLayer* platformLayer = layer->platformLayer())
+        platformLayer->to<WebScrollableLayer>().setFixedToContainerLayer(enable);
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/PlatformLayer.h (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/PlatformLayer.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/PlatformLayer.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -39,9 +39,11 @@
 typedef TextureMapperPlatformLayer PlatformLayer;
 };
 #elif PLATFORM(CHROMIUM)
+namespace WebKit {
+class WebLayer;
+}
 namespace WebCore {
-class LayerChromium;
-typedef LayerChromium PlatformLayer;
+typedef WebKit::WebLayer PlatformLayer;
 }
 #elif PLATFORM(GTK)
 #if USE(TEXTURE_MAPPER_CAIRO) || USE(TEXTURE_MAPPER_GL)

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -155,9 +155,9 @@
     return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get());
 }
 
-LayerChromium* Canvas2DLayerBridge::layer() const
+WebKit::WebLayer* Canvas2DLayerBridge::layer()
 {
-    return m_layer.unwrap<LayerChromium>();
+    return &m_layer;
 }
 
 void Canvas2DLayerBridge::contextAcquired()

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -60,7 +60,7 @@
     virtual WebKit::WebGraphicsContext3D* context() OVERRIDE;
 
     SkCanvas* skCanvas(SkDevice*);
-    LayerChromium* layer() const;
+    WebKit::WebLayer* layer();
     void contextAcquired();
 
     unsigned backBufferTexture();

Modified: trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -187,7 +187,7 @@
         return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_drawingBuffer->graphicsContext3D());
     }
 
-    LayerChromium* layer() const { return m_layer.unwrap<LayerChromium>(); }
+    WebKit::WebLayer* layer() { return &m_layer; }
 
 private:
     DrawingBuffer* m_drawingBuffer;

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -52,7 +52,6 @@
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "Image.h"
-#include "LayerChromium.h"
 #include "LinkHighlight.h"
 #include "NativeImageSkia.h"
 #include "PlatformContextSkia.h"
@@ -204,7 +203,7 @@
 void GraphicsLayerChromium::removeFromParent()
 {
     GraphicsLayer::removeFromParent();
-    layerForParent().removeFromParent();
+    primaryLayer().removeFromParent();
 }
 
 void GraphicsLayerChromium::setPosition(const FloatPoint& point)
@@ -271,8 +270,8 @@
 
 void GraphicsLayerChromium::setDrawsContent(bool drawsContent)
 {
-    // Note carefully this early-exit is only correct because we also properly initialize
-    // LayerChromium::m_isDrawable whenever m_contentsLayer is set to a new layer in setupContentsLayer().
+    // Note carefully this early-exit is only correct because we also properly call
+    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
     if (drawsContent == m_drawsContent)
         return;
 
@@ -282,8 +281,8 @@
 
 void GraphicsLayerChromium::setContentsVisible(bool contentsVisible)
 {
-    // Note carefully this early-exit is only correct because we also properly initialize
-    // LayerChromium::m_isDrawable whenever m_contentsLayer is set to a new layer in setupContentsLayer().
+    // Note carefully this early-exit is only correct because we also properly call
+    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
     if (contentsVisible == m_contentsVisible)
         return;
 
@@ -410,7 +409,9 @@
 
     GraphicsLayer::setMaskLayer(maskLayer);
 
-    WebLayer maskWebLayer(m_maskLayer ? m_maskLayer->platformLayer() : 0);
+    WebLayer maskWebLayer;
+    if (m_maskLayer)
+        maskWebLayer = *m_maskLayer->platformLayer();
     m_layer.setMaskLayer(maskWebLayer);
 }
 
@@ -498,8 +499,8 @@
 {
     bool childrenChanged = false;
     if (platformLayer) {
-        if (m_contentsLayer != WebLayer(platformLayer)) {
-            setupContentsLayer(WebLayer(platformLayer));
+        if (m_contentsLayer != *platformLayer) {
+            setupContentsLayer(*platformLayer);
             m_contentsLayerPurpose = ContentsLayerForCanvas;
             childrenChanged = true;
         }
@@ -577,7 +578,7 @@
     bool childrenChanged = false;
     if (layer) {
         if (m_contentsLayer.isNull() || m_contentsLayerPurpose != ContentsLayerForVideo) {
-            setupContentsLayer(WebLayer(layer));
+            setupContentsLayer(*layer);
             m_contentsLayerPurpose = ContentsLayerForVideo;
             childrenChanged = true;
         }
@@ -595,19 +596,14 @@
         updateChildList();
 }
 
-WebLayer GraphicsLayerChromium::hostLayerForChildren() const
+WebKit::WebLayer GraphicsLayerChromium::primaryLayer() const
 {
-    return m_transformLayer.isNull() ? m_layer :  m_transformLayer;
+    return m_transformLayer.isNull() ? m_layer : m_transformLayer;
 }
 
-WebLayer GraphicsLayerChromium::layerForParent() const
-{
-    return m_transformLayer.isNull() ? m_layer :  m_transformLayer;
-}
-
 PlatformLayer* GraphicsLayerChromium::platformLayer() const
 {
-    return primaryLayer().unwrap<LayerChromium>();
+    return const_cast<PlatformLayer*>(m_transformLayer.isNull() ? &m_layer : &m_transformLayer);
 }
 
 void GraphicsLayerChromium::setDebugBackgroundColor(const Color& color)
@@ -648,7 +644,7 @@
     for (size_t i = 0; i < numChildren; ++i) {
         GraphicsLayerChromium* curChild = static_cast<GraphicsLayerChromium*>(childLayers[i]);
 
-        newChildren.append(curChild->layerForParent());
+        newChildren.append(curChild->primaryLayer());
     }
 
     if (m_linkHighlight)

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h (124926 => 124927)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -131,9 +131,7 @@
 private:
     virtual void willBeDestroyed();
 
-    WebKit::WebLayer primaryLayer() const  { return m_transformLayer.isNull() ? m_layer : m_transformLayer; }
-    WebKit::WebLayer hostLayerForChildren() const;
-    WebKit::WebLayer layerForParent() const;
+    WebKit::WebLayer primaryLayer() const;
 
     void updateNames();
     void updateChildList();

Modified: trunk/Source/WebKit/chromium/ChangeLog (124926 => 124927)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-07 22:30:09 UTC (rev 124927)
@@ -1,5 +1,42 @@
 2012-08-07  James Robinson  <jam...@chromium.org>
 
+        [chromium] Switch PlatformLayer typedef to Platform API type for PLATFORM(CHROMIUM)
+        https://bugs.webkit.org/show_bug.cgi?id=93335
+
+        Reviewed by Adrienne Walker.
+
+        Update for new PlatformLayer typedef. This removes knowledge of WebCore::LayerChromium from all classes
+        except for NonCompositedContentHost, which still punches through for a few minor APIs that I'll address
+        in a separate patch.
+
+        * src/NonCompositedContentHost.cpp:
+        (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+        (WebKit::NonCompositedContentHost::setScrollLayer):
+        (WebKit::NonCompositedContentHost::scrollLayer):
+        (WebKit::NonCompositedContentHost::notifySyncRequired):
+        * src/WebMediaPlayerClientImpl.cpp:
+        (WebKit::WebMediaPlayerClientImpl::platformLayer):
+        * src/WebMediaPlayerClientImpl.h:
+        (WebMediaPlayerClientImpl):
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::platformLayer):
+        * src/WebPluginContainerImpl.h:
+        (WebCore):
+        (WebPluginContainerImpl):
+        * src/WebScrollableLayer.cpp:
+        (WebKit::WebScrollableLayer::setNonFastScrollableRegion):
+        (WebKit):
+        (WebKit::WebScrollableLayer::setIsContainerForFixedPositionLayers):
+        (WebKit::WebScrollableLayer::setFixedToContainerLayer):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setRootGraphicsLayer):
+        * tests/Canvas2DLayerBridgeTest.cpp:
+        * tests/GraphicsLayerChromiumTest.cpp:
+        (WebKitTests::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+        (WebKitTests::TEST_F):
+
+2012-08-07  James Robinson  <jam...@chromium.org>
+
         [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
         https://bugs.webkit.org/show_bug.cgi?id=93398
 

Modified: trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -33,9 +33,10 @@
 #include "LayerChromium.h"
 #include "PlatformContextSkia.h"
 #include "WebViewImpl.h"
-#include "cc/CCLayerTreeHost.h"
 #include <public/WebFloatPoint.h>
 
+using WebCore::LayerChromium;
+
 namespace WebKit {
 
 NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
@@ -49,10 +50,10 @@
     m_graphicsLayer->setName("non-composited content");
 #endif
     m_graphicsLayer->setDrawsContent(true);
-    m_graphicsLayer->platformLayer()->setIsNonCompositedContent(true);
+    m_graphicsLayer->platformLayer()->unwrap<LayerChromium>()->setIsNonCompositedContent(true);
     m_graphicsLayer->platformLayer()->setOpaque(true);
 #if !OS(ANDROID)
-    m_graphicsLayer->platformLayer()->setDrawCheckerboardForMissingTiles(true);
+    m_graphicsLayer->platformLayer()->unwrap<LayerChromium>()->setDrawCheckerboardForMissingTiles(true);
 #endif
 }
 
@@ -77,11 +78,10 @@
 
     if (!layer) {
         m_graphicsLayer->removeFromParent();
-        m_graphicsLayer->platformLayer()->setLayerTreeHost(0);
         return;
     }
 
-    if (WebScrollableLayer(layer->platformLayer()) == scrollLayer())
+    if (*layer->platformLayer() == scrollLayer())
         return;
 
     layer->addChildAtIndex(m_graphicsLayer.get(), 0);
@@ -152,7 +152,7 @@
 {
     if (!m_graphicsLayer->parent())
         return WebScrollableLayer();
-    return WebScrollableLayer(m_graphicsLayer->parent()->platformLayer());
+    return m_graphicsLayer->parent()->platformLayer()->to<WebScrollableLayer>();
 }
 
 void NonCompositedContentHost::invalidateRect(const WebCore::IntRect& rect)
@@ -169,9 +169,7 @@
 
 void NonCompositedContentHost::notifySyncRequired(const WebCore::GraphicsLayer*)
 {
-    WebCore::CCLayerTreeHost* layerTreeHost = m_graphicsLayer->platformLayer()->layerTreeHost();
-    if (layerTreeHost)
-        layerTreeHost->setNeedsCommit();
+    m_webView->scheduleCompositingLayerSync();
 }
 
 void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext& context, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)

Modified: trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -341,10 +341,10 @@
 }
 
 #if USE(ACCELERATED_COMPOSITING)
-LayerChromium* WebMediaPlayerClientImpl::platformLayer() const
+WebLayer* WebMediaPlayerClientImpl::platformLayer() const
 {
     ASSERT(m_supportsAcceleratedCompositing);
-    return m_videoLayer.unwrap<LayerChromium>();
+    return const_cast<WebVideoLayer*>(&m_videoLayer);
 }
 #endif
 

Modified: trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -98,7 +98,7 @@
     virtual void load(const WTF::String& url);
     virtual void cancelLoad();
 #if USE(ACCELERATED_COMPOSITING)
-    virtual WebCore::PlatformLayer* platformLayer() const;
+    virtual WebKit::WebLayer* platformLayer() const;
 #endif
     virtual WebCore::PlatformMedia platformMedia() const;
     virtual void play();

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -569,12 +569,12 @@
 }
 
 #if USE(ACCELERATED_COMPOSITING)
-WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const
+WebLayer* WebPluginContainerImpl::platformLayer() const
 {
     if (m_textureId)
-        return m_textureLayer.unwrap<LayerChromium>();
+        return const_cast<WebExternalTextureLayer*>(&m_textureLayer);
     if (m_ioSurfaceId)
-        return m_ioSurfaceLayer.unwrap<LayerChromium>();
+        return const_cast<WebIOSurfaceLayer*>(&m_ioSurfaceLayer);
     return 0;
 }
 #endif

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-08-07 22:30:09 UTC (rev 124927)
@@ -49,7 +49,6 @@
 class HTMLPlugInElement;
 class IntRect;
 class KeyboardEvent;
-class LayerChromium;
 class MouseEvent;
 class ResourceError;
 class ResourceResponse;
@@ -150,7 +149,7 @@
     void willDestroyPluginLoadObserver(WebPluginLoadObserver*);
 
 #if USE(ACCELERATED_COMPOSITING)
-    virtual WebCore::LayerChromium* platformLayer() const;
+    virtual WebLayer* platformLayer() const;
 #endif
 
     ScrollbarGroup* scrollbarGroup();

Modified: trunk/Source/WebKit/chromium/src/WebScrollableLayer.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebScrollableLayer.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebScrollableLayer.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -27,8 +27,8 @@
 #include <public/WebScrollableLayer.h>
 
 #include "LayerChromium.h"
+#include "Region.h"
 
-
 namespace WebKit {
 
 void WebScrollableLayer::setScrollPosition(WebPoint position)
@@ -51,4 +51,25 @@
     m_private->setShouldScrollOnMainThread(shouldScrollOnMainThread);
 }
 
+void WebScrollableLayer::setNonFastScrollableRegion(const WebVector<WebRect>& rects)
+{
+    WebCore::Region region;
+    for (size_t i = 0; i < rects.size(); ++i) {
+        WebCore::IntRect rect = rects[i];
+        region.unite(rect);
+    }
+    m_private->setNonFastScrollableRegion(region);
+
+}
+
+void WebScrollableLayer::setIsContainerForFixedPositionLayers(bool enable)
+{
+    m_private->setIsContainerForFixedPositionLayers(enable);
+}
+
+void WebScrollableLayer::setFixedToContainerLayer(bool enable)
+{
+    m_private->setFixedToContainerLayer(enable);
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -82,7 +82,6 @@
 #include "InspectorInstrumentation.h"
 #include "KeyboardCodes.h"
 #include "KeyboardEvent.h"
-#include "LayerChromium.h"
 #include "LayerPainterChromium.h"
 #include "MIMETypeRegistry.h"
 #include "NodeRenderStyle.h"
@@ -3530,7 +3529,7 @@
     }
 
     if (layer)
-        m_rootLayer = WebLayer(layer->platformLayer());
+        m_rootLayer = *layer->platformLayer();
 
     if (!m_layerTreeView.isNull())
         m_layerTreeView.setRootLayer(layer ? &m_rootLayer : 0);

Modified: trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -143,17 +143,4 @@
     fullLifecycleTest(Threaded, Deferred);
 }
 
-TEST(Canvas2DLayerBridgeTest2, testClearClient)
-{
-    GraphicsContext3D::Attributes attrs;
-
-    RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
-    OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainContext.get(), IntSize(100, 100), Deferred, 1);
-    RefPtr<LayerChromium> layer = bridge->layer();
-    bridge.clear();
-    CCTextureUpdateQueue queue;
-    CCRenderingStats stats;
-    layer->update(queue, 0, stats);
-}
-
 } // namespace

Modified: trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp (124926 => 124927)


--- trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2012-08-07 22:22:43 UTC (rev 124926)
+++ trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2012-08-07 22:30:09 UTC (rev 124927)
@@ -95,7 +95,7 @@
         WebCompositor::setAcceleratedAnimationEnabled(true);
         WebCompositor::initialize(0);
         m_graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&m_client));
-        m_platformLayer = static_cast<LayerChromium*>(m_graphicsLayer->platformLayer());
+        m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
         m_layerTreeHost = MockLayerTreeHost::create();
         m_platformLayer->setLayerTreeHost(m_layerTreeHost.get());
     }
@@ -133,7 +133,7 @@
 
     m_graphicsLayer->setPreserves3D(true);
 
-    m_platformLayer = static_cast<LayerChromium*>(m_graphicsLayer->platformLayer());
+    m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
     ASSERT_TRUE(m_platformLayer);
 
     ASSERT_TRUE(m_platformLayer->hasActiveAnimation());
@@ -142,7 +142,7 @@
 
     m_graphicsLayer->setPreserves3D(false);
 
-    m_platformLayer = static_cast<LayerChromium*>(m_graphicsLayer->platformLayer());
+    m_platformLayer = m_graphicsLayer->platformLayer()->unwrap<LayerChromium>();
     ASSERT_TRUE(m_platformLayer);
 
     ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to