Diff
Modified: trunk/Source/WebCore/ChangeLog (139828 => 139829)
--- trunk/Source/WebCore/ChangeLog 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebCore/ChangeLog 2013-01-16 04:36:33 UTC (rev 139829)
@@ -1,3 +1,17 @@
+2013-01-15 Ian Vollick <[email protected]>
+
+ [chromium] Create GraphicsLayerChromiums using a factory
+ https://bugs.webkit.org/show_bug.cgi?id=103635
+
+ Reviewed by James Robinson.
+
+ Refactor graphics layer creation for chromium to go through a factory.
+
+ No new tests, no change in functionality.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayer::create):
+
2013-01-15 Charles Wei <[email protected]>
[BlackBerry] LayerRenderingResults doesn't need to maintain the hole punch rect
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (139828 => 139829)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -84,15 +84,13 @@
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
{
- if (!factory)
- return adoptPtr(new GraphicsLayerChromium(client));
-
return factory->createGraphicsLayer(client);
}
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
- return adoptPtr(new GraphicsLayerChromium(client));
+ ASSERT_NOT_REACHED();
+ return nullptr;
}
GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client)
Modified: trunk/Source/WebKit/chromium/ChangeLog (139828 => 139829)
--- trunk/Source/WebKit/chromium/ChangeLog 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/ChangeLog 2013-01-16 04:36:33 UTC (rev 139829)
@@ -1,3 +1,42 @@
+2013-01-15 Ian Vollick <[email protected]>
+
+ [chromium] Create GraphicsLayerChromiums using a factory
+ https://bugs.webkit.org/show_bug.cgi?id=103635
+
+ Reviewed by James Robinson.
+
+ Refactor graphics layer creation for chromium to go through a factory.
+
+ * src/ChromeClientImpl.cpp:
+ (WebCore):
+ (GraphicsLayerFactoryChromium):
+ (WebCore::GraphicsLayerFactoryChromium::~GraphicsLayerFactoryChromium):
+ (WebKit::ChromeClientImpl::ChromeClientImpl):
+ (WebKit::ChromeClientImpl::graphicsLayerFactory):
+ (WebKit):
+ * src/ChromeClientImpl.h:
+ (WebCore):
+ (ChromeClientImpl):
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+ * src/NonCompositedContentHost.h:
+ (WebCore):
+ (WebKit::NonCompositedContentHost::create):
+ (NonCompositedContentHost):
+ * src/PageOverlay.cpp:
+ (WebKit::PageOverlay::update):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::graphicsLayerFactory):
+ (WebKit):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ * src/WebViewImpl.h:
+ (WebCore):
+ (WebViewImpl):
+ * tests/GraphicsLayerChromiumTest.cpp:
+ (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+ * tests/ImageLayerChromiumTest.cpp:
+ (WebCore::TEST):
+
2013-01-15 Mark Pilgrim <[email protected]>
[Chromium] Move SocketStreamHandle and SocketStreamHandleInternal to WebCore/platform
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -57,7 +57,8 @@
#include "FrameLoadRequest.h"
#include "FrameView.h"
#include "Geolocation.h"
-#include "GraphicsLayer.h"
+#include "GraphicsLayerChromium.h"
+#include "GraphicsLayerFactory.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HitTestResult.h"
@@ -111,6 +112,20 @@
using namespace WebCore;
+namespace {
+
+class GraphicsLayerFactoryChromium : public GraphicsLayerFactory {
+public:
+ virtual ~GraphicsLayerFactoryChromium() { }
+
+ virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient* client) OVERRIDE
+ {
+ return adoptPtr(new GraphicsLayerChromium(client));
+ }
+};
+
+} // namespace
+
namespace WebKit {
// Converts a WebCore::PopupContainerType to a WebKit::WebPopupType.
@@ -145,6 +160,9 @@
#if ENABLE(PAGE_POPUP)
, m_pagePopupDriver(webView)
#endif
+#if USE(ACCELERATED_COMPOSITING)
+ , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium))
+#endif
{
}
@@ -932,6 +950,11 @@
}
#if USE(ACCELERATED_COMPOSITING)
+GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const
+{
+ return m_graphicsLayerFactory.get();
+}
+
void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
{
m_webView->setRootGraphicsLayer(graphicsLayer);
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.h (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2013-01-16 04:36:33 UTC (rev 139829)
@@ -38,6 +38,7 @@
#include "SearchPopupMenu.h"
#include "WebNavigationPolicy.h"
#include <public/WebColor.h>
+#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -46,6 +47,7 @@
class ColorChooserClient;
class Element;
class FileChooser;
+class GraphicsLayerFactory;
class PopupContainer;
class PopupMenuClient;
class RenderBox;
@@ -163,6 +165,8 @@
#endif
#if USE(ACCELERATED_COMPOSITING)
+ virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() const OVERRIDE;
+
// Pass 0 as the GraphicsLayer to detatch the root layer.
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
@@ -244,6 +248,10 @@
#if ENABLE(PAGE_POPUP)
WebCore::PagePopupDriver* m_pagePopupDriver;
#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+ OwnPtr<WebCore::GraphicsLayerFactory> m_graphicsLayerFactory;
+#endif
};
class NavigatorContentUtilsClientImpl : public WebCore::NavigatorContentUtilsClient {
Modified: trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -39,11 +39,11 @@
namespace WebKit {
-NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
+NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView, WebCore::GraphicsLayerFactory* graphicsLayerFactory)
: m_webView(webView)
, m_showDebugBorders(false)
{
- m_graphicsLayer = WebCore::GraphicsLayer::create(0, this);
+ m_graphicsLayer = WebCore::GraphicsLayer::create(graphicsLayerFactory, this);
#ifndef NDEBUG
m_graphicsLayer->setName("non-composited content");
#endif
Modified: trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h 2013-01-16 04:36:33 UTC (rev 139829)
@@ -37,6 +37,7 @@
namespace WebCore {
class Color;
class GraphicsLayer;
+class GraphicsLayerFactory;
class GraphicsContext;
class IntPoint;
class IntRect;
@@ -48,9 +49,9 @@
class NonCompositedContentHost : public WebCore::GraphicsLayerClient {
WTF_MAKE_NONCOPYABLE(NonCompositedContentHost);
public:
- static PassOwnPtr<NonCompositedContentHost> create(WebViewImpl* webView)
+ static PassOwnPtr<NonCompositedContentHost> create(WebViewImpl* webView, WebCore::GraphicsLayerFactory* graphicsLayerFactory)
{
- return adoptPtr(new NonCompositedContentHost(webView));
+ return adoptPtr(new NonCompositedContentHost(webView, graphicsLayerFactory));
}
virtual ~NonCompositedContentHost();
@@ -64,7 +65,7 @@
void setShowDebugBorders(bool);
protected:
- explicit NonCompositedContentHost(WebViewImpl*);
+ NonCompositedContentHost(WebViewImpl*, WebCore::GraphicsLayerFactory*);
private:
// GraphicsLayerClient
Modified: trunk/Source/WebKit/chromium/src/PageOverlay.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/PageOverlay.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/PageOverlay.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -126,7 +126,7 @@
#if USE(ACCELERATED_COMPOSITING)
if (!m_layer) {
m_layerClient = OverlayGraphicsLayerClientImpl::create(m_viewImpl, m_overlay);
- m_layer = GraphicsLayer::create(m_layerClient.get());
+ m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_layerClient.get());
m_layer->setName("WebViewImpl page overlay content");
m_layer->setDrawsContent(true);
}
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -3947,6 +3947,11 @@
m_layerTreeView->setBackgroundColor(webDocumentBackgroundColor);
}
+WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const
+{
+ return m_chromeClientImpl.graphicsLayerFactory();
+}
+
WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer()
{
return m_rootGraphicsLayer;
@@ -4030,7 +4035,7 @@
layerTreeViewSettings.defaultTileSize = settingsImpl()->defaultTileSize();
layerTreeViewSettings.maxUntiledLayerSize = settingsImpl()->maxUntiledLayerSize();
- m_nonCompositedContentHost = NonCompositedContentHost::create(this);
+ m_nonCompositedContentHost = NonCompositedContentHost::create(this, graphicsLayerFactory());
m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders());
m_nonCompositedContentHost->setOpaque(!isTransparent());
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (139828 => 139829)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2013-01-16 04:36:33 UTC (rev 139829)
@@ -68,6 +68,7 @@
class FloatSize;
class Frame;
class GraphicsContext3D;
+class GraphicsLayerFactory;
class HistoryItem;
class HitTestResult;
class KeyboardEvent;
@@ -543,6 +544,7 @@
void paintRootLayer(WebCore::GraphicsContext&, const WebCore::IntRect& contentRect);
NonCompositedContentHost* nonCompositedContentHost();
void setBackgroundColor(const WebCore::Color&);
+ WebCore::GraphicsLayerFactory* graphicsLayerFactory() const;
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME)
void scheduleAnimation();
Modified: trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -60,7 +60,7 @@
GraphicsLayerChromiumTest()
{
Platform::current()->compositorSupport()->initialize(0);
- m_graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&m_client));
+ m_graphicsLayer = adoptPtr(new GraphicsLayerChromium(&m_client));
m_platformLayer = m_graphicsLayer->platformLayer();
m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(&m_layerTreeViewClient, *m_platformLayer, WebLayerTreeView::Settings()));
m_layerTreeView->setViewportSize(WebSize(1, 1), WebSize(1, 1));
Modified: trunk/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp (139828 => 139829)
--- trunk/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp 2013-01-16 03:53:35 UTC (rev 139828)
+++ trunk/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp 2013-01-16 04:36:33 UTC (rev 139829)
@@ -110,7 +110,7 @@
TEST(ImageLayerChromiumTest, opaqueImages)
{
MockGraphicsLayerClient client;
- OwnPtr<GraphicsLayerChromium> graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&client));
+ OwnPtr<GraphicsLayerChromium> graphicsLayer = adoptPtr(new GraphicsLayerChromium(&client));
ASSERT_TRUE(graphicsLayer.get());
RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), true);