Commit eee5ae0d authored by andersca@apple.com's avatar andersca@apple.com
Browse files

Add new GraphicsLayer::create overload to all ports

https://bugs.webkit.org/show_bug.cgi?id=98082

Reviewed by Andreas Kling.

Add the GraphicsLayer::create variant that takes a factory to all ports.

* platform/graphics/GraphicsLayer.cpp:
(WebCore):
(WebCore::GraphicsLayer::setGraphicsLayerFactory):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
Rename the GraphicsLayerFactory function typedef to GraphicsLayerFactoryCallback to avoid collisions.

* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/clutter/GraphicsLayerClutter.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 97562786
2012-10-02 Anders Carlsson <andersca@apple.com>
Add new GraphicsLayer::create overload to all ports
https://bugs.webkit.org/show_bug.cgi?id=98082
Reviewed by Andreas Kling.
Add the GraphicsLayer::create variant that takes a factory to all ports.
* platform/graphics/GraphicsLayer.cpp:
(WebCore):
(WebCore::GraphicsLayer::setGraphicsLayerFactory):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
Rename the GraphicsLayerFactory function typedef to GraphicsLayerFactoryCallback to avoid collisions.
* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/clutter/GraphicsLayerClutter.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
2012-10-02 Takashi Sakamoto <tasak@google.com>
 
[Shadow] ShadowRoot should know whether <shadow> in its treescope
......@@ -387,9 +387,9 @@ void GraphicsLayer::distributeOpacity(float accumulatedOpacity)
}
#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
GraphicsLayer::GraphicsLayerFactory* GraphicsLayer::s_graphicsLayerFactory = 0;
GraphicsLayer::GraphicsLayerFactoryCallback* GraphicsLayer::s_graphicsLayerFactory = 0;
void GraphicsLayer::setGraphicsLayerFactory(GraphicsLayer::GraphicsLayerFactory factory)
void GraphicsLayer::setGraphicsLayerFactory(GraphicsLayer::GraphicsLayerFactoryCallback factory)
{
s_graphicsLayerFactory = factory;
}
......
......@@ -402,8 +402,8 @@ public:
#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
// This allows several alternative GraphicsLayer implementations in the same port,
// e.g. if a different GraphicsLayer implementation is needed in WebKit1 vs. WebKit2.
typedef PassOwnPtr<GraphicsLayer> GraphicsLayerFactory(GraphicsLayerClient*);
static void setGraphicsLayerFactory(GraphicsLayerFactory);
typedef PassOwnPtr<GraphicsLayer> GraphicsLayerFactoryCallback(GraphicsLayerClient*);
static void setGraphicsLayerFactory(GraphicsLayerFactoryCallback);
#endif
protected:
......@@ -491,7 +491,7 @@ protected:
int m_repaintCount;
#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
static GraphicsLayer::GraphicsLayerFactory* s_graphicsLayerFactory;
static GraphicsLayer::GraphicsLayerFactoryCallback* s_graphicsLayerFactory;
#endif
};
......
......@@ -48,6 +48,7 @@
#include "FloatConversion.h"
#include "FloatRect.h"
#include "GraphicsLayerFactory.h"
#include "Image.h"
#include "LayerAnimation.h"
#include "LayerWebKitThread.h"
......@@ -79,6 +80,14 @@ static void clearLayerBackgroundColor(LayerWebKitThread& layer)
layer.setBackgroundColor(Color::transparent);
}
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
{
if (!factory)
return adoptPtr(new GraphicsLayerBlackBerry(client));
return factory->createGraphicsLayer(client);
}
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
return adoptPtr(new GraphicsLayerBlackBerry(client));
......
......@@ -49,6 +49,7 @@
#include "FloatConversion.h"
#include "FloatRect.h"
#include "GraphicsContext.h"
#include "GraphicsLayerFactory.h"
#include "Image.h"
#include "NativeImageSkia.h"
#include "PlatformContextSkia.h"
......@@ -77,6 +78,14 @@ using namespace WebKit;
namespace WebCore {
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));
......
......@@ -28,11 +28,20 @@
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayerClutter.h"
#include "GraphicsLayerFactory.h"
#include "NotImplemented.h"
namespace WebCore {
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
{
if (!factory)
return adoptPtr(new GraphicsLayerClutter(client));
return factory->createGraphicsLayer(client);
}
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
return adoptPtr(new GraphicsLayerClutter(client));
......
......@@ -20,10 +20,19 @@
#include "config.h"
#include "GraphicsLayerTextureMapper.h"
#include "GraphicsLayerFactory.h"
#include "TextureMapperLayer.h"
namespace WebCore {
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
{
if (!factory)
return adoptPtr(new GraphicsLayerTextureMapper(client));
return factory->createGraphicsLayer(client);
}
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
if (s_graphicsLayerFactory)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment