+2012-01-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [WK2][Qt] REGRESSION: Pages with transform animations sometimes omit some of the layers since r105413
+ https://bugs.webkit.org/show_bug.cgi?id=76886
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ We now render the whole layer if it or one if its ancestors has an active transform
+ animations. It's possible to optimize further in the future, but not currently necessary.
+ Also, we make sure that when a WebGraphicsLayer's property that affects transformation is
+ changed, all its descandants layers are marked as modified so that we re-adjust their
+ visible rect in the next pass.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::notifyChangeRecursively):
+ (WebCore):
+ (WebCore::WebGraphicsLayer::setPosition):
+ (WebCore::WebGraphicsLayer::setAnchorPoint):
+ (WebCore::WebGraphicsLayer::setSize):
+ (WebCore::WebGraphicsLayer::setTransform):
+ (WebCore::WebGraphicsLayer::setChildrenTransform):
+ (WebCore::WebGraphicsLayer::setPreserves3D):
+ (WebCore::WebGraphicsLayer::setMasksToBounds):
+ (WebCore::WebGraphicsLayer::addAnimation):
+ (WebCore::WebGraphicsLayer::removeAnimation):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreVisibleRect):
+ (WebCore::WebGraphicsLayer::selfOrAncestorHasActiveTransformAnimations):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebGraphicsLayer):
+
2012-01-25 Hajime Morita <morrita@google.com>
ENABLE_SHADOW_DOM should be available via build-webkit --shadow-dom
client()->notifySyncRequired(this);
}
+void WebGraphicsLayer::notifyChangeRecursively()
+{
+ notifyChange();
+ for (size_t i = 0; i < children().size(); ++i)
+ toWebGraphicsLayer(children()[i])->notifyChangeRecursively();
+ if (replicaLayer())
+ toWebGraphicsLayer(replicaLayer())->notifyChange();
+}
+
WebGraphicsLayer::WebGraphicsLayer(GraphicsLayerClient* client)
: GraphicsLayer(client)
, m_maskTarget(0)
return;
GraphicsLayer::setPosition(p);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setAnchorPoint(const FloatPoint3D& p)
return;
GraphicsLayer::setAnchorPoint(p);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setSize(const FloatSize& size)
setNeedsDisplay();
if (maskLayer())
maskLayer()->setSize(size);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setTransform(const TransformationMatrix& t)
return;
GraphicsLayer::setTransform(t);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setChildrenTransform(const TransformationMatrix& t)
return;
GraphicsLayer::setChildrenTransform(t);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setPreserves3D(bool b)
return;
GraphicsLayer::setPreserves3D(b);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setMasksToBounds(bool b)
if (masksToBounds() == b)
return;
GraphicsLayer::setMasksToBounds(b);
- notifyChange();
+ notifyChangeRecursively();
}
void WebGraphicsLayer::setDrawsContent(bool b)
webAnimation.animation = Animation::create(anim);
webAnimation.startTime = timeOffset;
m_layerInfo.animations.append(webAnimation);
+ if (valueList.property() == AnimatedPropertyWebkitTransform)
+ m_transformAnimations.add(keyframesName);
m_hasPendingAnimations = true;
- notifyChange();
+ notifyChangeRecursively();
return true;
}
webAnimation.name = animationName;
webAnimation.operation = WebLayerAnimation::RemoveAnimation;
m_layerInfo.animations.append(webAnimation);
+ m_transformAnimations.remove(animationName);
notifyChange();
}
IntRect WebGraphicsLayer::tiledBackingStoreVisibleRect()
{
+ // If this layer is part of an active transform animation, the visible rect might change,
+ // so we rather render the whole layer until some better optimization is available.
+ if (selfOrAncestorHasActiveTransformAnimations())
+ return tiledBackingStoreContentsRect();
+
// Non-invertible layers are not visible.
if (!m_layerTransform.combined().isInvertible())
return IntRect();
GraphicsLayer::setGraphicsLayerFactory(createWebGraphicsLayer);
}
+bool WebGraphicsLayer::selfOrAncestorHasActiveTransformAnimations() const
+{
+ if (!m_transformAnimations.isEmpty())
+ return true;
+
+ if (parent())
+ return toWebGraphicsLayer(parent())->selfOrAncestorHasActiveTransformAnimations();
+
+ return false;
+}
+
}
#endif