Title: [88541] trunk/Source/WebCore
- Revision
- 88541
- Author
- [email protected]
- Date
- 2011-06-10 04:56:37 -0700 (Fri, 10 Jun 2011)
Log Message
2011-06-10 No'am Rosenthal <[email protected]> and Viatcheslav Ostapenko <[email protected]>
Reviewed by Kenneth Rohde Christiansen.
Add layer factory to GraphicsLayer for creating non-default layer type.
https://bugs.webkit.org/show_bug.cgi?id=61925
Added a static factory protected member to GraphicsLayer, which should be accessed from
a port-specific implementation of GraphicsLayer::create. For now this is enabled for Qt only.
This is needed for accelerated compositing across processes in WebKit2, since WebCore
doesn't know in compile time whether it's in WebKit or WebKit2, which makes having two
different implementations of GraphicsLayer coexist impossible without some runtime
factory that can be overridden by the web process.
Note that the use of the factory would be optional, and the port-specific GraphicsLayer::create
would have to explicitly call it, in order to be unintrusive with current implementations.
No new functionality, so no new tests.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setGraphicsLayerFactory):
* platform/graphics/GraphicsLayer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (88540 => 88541)
--- trunk/Source/WebCore/ChangeLog 2011-06-10 11:34:59 UTC (rev 88540)
+++ trunk/Source/WebCore/ChangeLog 2011-06-10 11:56:37 UTC (rev 88541)
@@ -1,3 +1,27 @@
+2011-06-10 No'am Rosenthal <[email protected]> and Viatcheslav Ostapenko <[email protected]>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add layer factory to GraphicsLayer for creating non-default layer type.
+ https://bugs.webkit.org/show_bug.cgi?id=61925
+
+ Added a static factory protected member to GraphicsLayer, which should be accessed from
+ a port-specific implementation of GraphicsLayer::create. For now this is enabled for Qt only.
+
+ This is needed for accelerated compositing across processes in WebKit2, since WebCore
+ doesn't know in compile time whether it's in WebKit or WebKit2, which makes having two
+ different implementations of GraphicsLayer coexist impossible without some runtime
+ factory that can be overridden by the web process.
+
+ Note that the use of the factory would be optional, and the port-specific GraphicsLayer::create
+ would have to explicitly call it, in order to be unintrusive with current implementations.
+
+ No new functionality, so no new tests.
+
+ * platform/graphics/GraphicsLayer.cpp:
+ (WebCore::GraphicsLayer::setGraphicsLayerFactory):
+ * platform/graphics/GraphicsLayer.h:
+
2011-06-10 Lucas De Marchi <[email protected]>
Reviewed by Kenneth Rohde Christiansen.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (88540 => 88541)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2011-06-10 11:34:59 UTC (rev 88540)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2011-06-10 11:56:37 UTC (rev 88541)
@@ -312,6 +312,15 @@
}
}
+#if PLATFORM(QT)
+GraphicsLayer::GraphicsLayerFactory* GraphicsLayer::s_graphicsLayerFactory = 0;
+
+void GraphicsLayer::setGraphicsLayerFactory(GraphicsLayer::GraphicsLayerFactory factory)
+{
+ s_graphicsLayerFactory = factory;
+}
+#endif
+
// An "invalid" list is one whose functions don't match, and therefore has to be animated as a Matrix
// The hasBigRotation flag will always return false if isValid is false. Otherwise hasBigRotation is
// true if the rotation between any two keyframes is >= 180 degrees.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (88540 => 88541)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-06-10 11:34:59 UTC (rev 88540)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-06-10 11:56:37 UTC (rev 88541)
@@ -367,6 +367,13 @@
bool usingTiledLayer() const { return m_usingTiledLayer; }
+#if PLATFORM(QT)
+ // 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);
+#endif
+
protected:
typedef Vector<TransformOperation::OperationType> TransformOperationList;
@@ -375,7 +382,7 @@
static void fetchTransformOperationList(const KeyframeValueList&, TransformOperationList&, bool& isValid, bool& hasBigRotation);
virtual void setOpacityInternal(float) { }
-
+
// The layer being replicated.
GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
@@ -428,6 +435,10 @@
IntRect m_contentsRect;
int m_repaintCount;
+
+#if PLATFORM(QT)
+ static GraphicsLayer::GraphicsLayerFactory* s_graphicsLayerFactory;
+#endif
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes