Diff
Modified: trunk/Source/WebCore/ChangeLog (148741 => 148742)
--- trunk/Source/WebCore/ChangeLog 2013-04-19 13:32:56 UTC (rev 148741)
+++ trunk/Source/WebCore/ChangeLog 2013-04-19 13:51:10 UTC (rev 148742)
@@ -1,3 +1,26 @@
+2013-04-19 ChangSeok Oh <[email protected]>
+
+ [GTK][AC] Support masksToBounds for clutter AC backend.
+ https://bugs.webkit.org/show_bug.cgi?id=114113
+
+ Reviewed by Gustavo Noronha Silva.
+
+ We can support the masksToBounds property by using clutter_actor_set_clip simply.
+
+ Covered by existing AC tests.
+
+ * platform/graphics/clutter/GraphicsLayerActor.cpp:
+ (graphicsLayerActorSetMasksToBounds):
+ * platform/graphics/clutter/GraphicsLayerActor.h:
+ * platform/graphics/clutter/GraphicsLayerClutter.cpp:
+ (WebCore::GraphicsLayerClutter::setMasksToBounds):
+ (WebCore):
+ (WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerClutter::setupContentsLayer):
+ (WebCore::GraphicsLayerClutter::updateMasksToBounds):
+ * platform/graphics/clutter/GraphicsLayerClutter.h:
+ (GraphicsLayerClutter):
+
2013-04-19 Dan Beam <[email protected]>
Remove unmaintained feature REQUEST_AUTOCOMPLETE
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp (148741 => 148742)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp 2013-04-19 13:32:56 UTC (rev 148741)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp 2013-04-19 13:51:10 UTC (rev 148742)
@@ -524,6 +524,15 @@
priv->flatten = flatten;
}
+void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor* layer, bool masksToBounds)
+{
+ ClutterActor* actor = CLUTTER_ACTOR(layer);
+ if (masksToBounds)
+ clutter_actor_set_clip(actor, 0, 0, clutter_actor_get_width(actor), clutter_actor_get_height(actor));
+ else
+ clutter_actor_remove_clip(actor);
+}
+
WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor* layer, const String key)
{
return static_cast<WebCore::PlatformClutterAnimation*>(g_object_get_data(G_OBJECT(layer), key.utf8().data()));
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h (148741 => 148742)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h 2013-04-19 13:32:56 UTC (rev 148741)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h 2013-04-19 13:51:10 UTC (rev 148742)
@@ -97,6 +97,7 @@
gboolean graphicsLayerActorGetDrawsContent(GraphicsLayerActor*);
void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, bool drawsContent);
void graphicsLayerActorSetFlatten(GraphicsLayerActor*, bool flatten);
+void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor*, bool masksToBounds);
WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor*, const String);
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp (148741 => 148742)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp 2013-04-19 13:32:56 UTC (rev 148741)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp 2013-04-19 13:51:10 UTC (rev 148742)
@@ -444,6 +444,15 @@
noteLayerPropertyChanged(Preserves3DChanged);
}
+void GraphicsLayerClutter::setMasksToBounds(bool masksToBounds)
+{
+ if (masksToBounds == m_masksToBounds)
+ return;
+
+ GraphicsLayer::setMasksToBounds(masksToBounds);
+ noteLayerPropertyChanged(MasksToBoundsChanged);
+}
+
void GraphicsLayerClutter::setDrawsContent(bool drawsContent)
{
if (drawsContent == m_drawsContent)
@@ -736,6 +745,9 @@
if (m_uncommittedChanges & TransformChanged)
updateTransform();
+ if (m_uncommittedChanges & MasksToBoundsChanged)
+ updateMasksToBounds();
+
if (m_uncommittedChanges & OpacityChanged)
updateOpacityOnLayer();
@@ -760,6 +772,7 @@
void GraphicsLayerClutter::setupContentsLayer(GraphicsLayerActor* contentsLayer)
{
+ graphicsLayerActorSetMasksToBounds(contentsLayer, true);
graphicsLayerActorSetAnchorPoint(contentsLayer, 0.0, 0.0, 0.0);
}
@@ -860,6 +873,11 @@
clutter_actor_set_transform(CLUTTER_ACTOR(primaryLayer()), &matrix);
}
+void GraphicsLayerClutter::updateMasksToBounds()
+{
+ graphicsLayerActorSetMasksToBounds(m_layer.get(), m_masksToBounds);
+}
+
void GraphicsLayerClutter::updateStructuralLayer()
{
ensureStructuralLayer(structuralLayerPurpose());
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h (148741 => 148742)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h 2013-04-19 13:32:56 UTC (rev 148741)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h 2013-04-19 13:51:10 UTC (rev 148742)
@@ -63,7 +63,9 @@
virtual void addChildAtIndex(GraphicsLayer*, int index);
virtual void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling);
virtual void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling);
+
virtual void removeFromParent();
+
virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
virtual bool setChildren(const Vector<GraphicsLayer*>&);
virtual void setParent(GraphicsLayer*);
@@ -86,6 +88,7 @@
virtual bool hasContentsLayer() const { return m_contentsLayer; }
virtual void setPreserves3D(bool);
+ virtual void setMasksToBounds(bool);
virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& animationName, double timeOffset);
virtual void removeAnimation(const String& animationName);
@@ -190,6 +193,7 @@
void updateSublayerList();
void updateGeometry(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase);
void updateTransform();
+ void updateMasksToBounds();
void updateLayerDrawsContent(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase);
void updateContentsImage();
void updateContentsRect();