2011-06-07 Young Han Lee <joybro@company100.net>

        Reviewed by Kenneth Rohde Christiansen.

        [Texmap][Qt] Accelerated animation is not paused properly.
        https://bugs.webkit.org/show_bug.cgi?id=61446

        The transform matrix of an accelerated animation shouldn't be synced with the matrix of the GraphicsLayer when the animation is paused.

        * animations/play-state-paused-expected.png: Added.
        * animations/play-state-paused-expected.txt: Added.
        * animations/play-state-paused.html: Added.
2011-06-07  Young Han Lee  <joybro@company100.net>

        Reviewed by Kenneth Rohde Christiansen.

        [Texmap][Qt] Accelerated animation is not paused properly.
        https://bugs.webkit.org/show_bug.cgi?id=61446

        The transform matrix of an accelerated animation shouldn't be synced with the matrix of the GraphicsLayer when the animation is paused.

        Test: animations/play-state-paused.html

        * platform/graphics/texmap/TextureMapperNode.cpp:
        (WebCore::TextureMapperNode::syncCompositingStateSelf):
        (WebCore::TextureMapperNode::hasOpacityAnimation):
        (WebCore::TextureMapperNode::hasTransformAnimation):
        * platform/graphics/texmap/TextureMapperNode.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d0e4d419
2011-06-07 Young Han Lee <joybro@company100.net>
Reviewed by Kenneth Rohde Christiansen.
[Texmap][Qt] Accelerated animation is not paused properly.
https://bugs.webkit.org/show_bug.cgi?id=61446
The transform matrix of an accelerated animation shouldn't be synced with the matrix of the GraphicsLayer when the animation is paused.
* animations/play-state-paused-expected.png: Added.
* animations/play-state-paused-expected.txt: Added.
* animations/play-state-paused.html: Added.
2011-06-07 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r88238.
......
PASS - "webkitTransform" property for "box" element at 0.5s saw something close to: 1,0,0,1,75,0
PASS - "webkitTransform" property for "box" element at 1s saw something close to: 1,0,0,1,150,0
PASS - "webkitTransform" property for "box" element at 2.5s saw something close to: 1,0,0,1,150,0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test of -webkit-animation-play-state</title>
<style type="text/css" media="screen">
body {
margin: 0;
}
#box {
position: absolute;
left: 0px;
top: 100px;
height: 100px;
width: 100px;
background-color: red;
margin: 0;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "move1";
-webkit-animation-play-state: running;
}
#safezone {
position: absolute;
top: 100px;
height: 100px;
width: 200px;
left: 100px;
background-color: green;
}
@-webkit-keyframes "move1" {
from { -webkit-transform: translateX(0px); }
to { -webkit-transform: translateX(300px); }
}
#result {
color: white; /* hide from pixel results */
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["move1", 0.5, "box", "webkitTransform", [1,0,0,1,75,0], 20],
["move1", 1.0, "box", "webkitTransform", [1,0,0,1,150,0], 20],
["move1", 2.5, "box", "webkitTransform", [1,0,0,1,150,0], 20],
];
function pauseAnimation()
{
document.getElementById("box").style.webkitAnimationPlayState = "paused";
}
function setTimers()
{
setTimeout(pauseAnimation, 1000);
}
runAnimationTest(expectedValues, setTimers, null, true);
</script>
</head>
<body>
<!-- This tests the operation of -webkit-animation-play-state. After 1 second the red boxes should be hidden by the green boxes. You should see no red boxes. -->
<div id="box"></div>
<div id="safezone"></div>
<div id="result"></div>
</div>
</body>
</html>
2011-06-07 Young Han Lee <joybro@company100.net>
Reviewed by Kenneth Rohde Christiansen.
[Texmap][Qt] Accelerated animation is not paused properly.
https://bugs.webkit.org/show_bug.cgi?id=61446
The transform matrix of an accelerated animation shouldn't be synced with the matrix of the GraphicsLayer when the animation is paused.
Test: animations/play-state-paused.html
* platform/graphics/texmap/TextureMapperNode.cpp:
(WebCore::TextureMapperNode::syncCompositingStateSelf):
(WebCore::TextureMapperNode::hasOpacityAnimation):
(WebCore::TextureMapperNode::hasTransformAnimation):
* platform/graphics/texmap/TextureMapperNode.h:
2011-06-07 Lucas De Marchi <lucas.demarchi@profusion.mobi>
Reviewed by Antonio Gomes.
......
......@@ -653,9 +653,9 @@ void TextureMapperNode::syncCompositingStateSelf(GraphicsLayerTextureMapper* gra
if (!m_currentContent.needsDisplay)
m_currentContent.needsDisplayRect.unite(pendingContent.needsDisplayRect);
if (!hasRunningOpacityAnimation())
if (!hasOpacityAnimation())
m_opacity = m_state.opacity;
if (!hasRunningTransformAnimation())
if (!hasTransformAnimation())
m_transforms.base = m_state.transform;
}
......@@ -815,21 +815,21 @@ void TextureMapperNode::applyAnimation(const TextureMapperAnimation& animation,
}
}
bool TextureMapperNode::hasRunningOpacityAnimation() const
bool TextureMapperNode::hasOpacityAnimation() const
{
for (size_t i = 0; i < m_animations.size(); ++i) {
const TextureMapperAnimation& animation = *m_animations[i].get();
if (!animation.paused && animation.keyframes.property() == AnimatedPropertyOpacity)
if (animation.keyframes.property() == AnimatedPropertyOpacity)
return true;
}
return false;
}
bool TextureMapperNode::hasRunningTransformAnimation() const
bool TextureMapperNode::hasTransformAnimation() const
{
for (size_t i = 0; i < m_animations.size(); ++i) {
const TextureMapperAnimation& animation = *m_animations[i].get();
if (!animation.paused && animation.keyframes.property() == AnimatedPropertyWebkitTransform)
if (animation.keyframes.property() == AnimatedPropertyWebkitTransform)
return true;
}
return false;
......
......@@ -177,8 +177,8 @@ private:
void applyAnimationFrame(const TextureMapperAnimation&, const AnimationValue* from, const AnimationValue* to, float progress);
void applyOpacityAnimation(float fromOpacity, float toOpacity, double);
void applyTransformAnimation(const TextureMapperAnimation&, const TransformOperations* start, const TransformOperations* end, double);
bool hasRunningOpacityAnimation() const;
bool hasRunningTransformAnimation() const;
bool hasOpacityAnimation() const;
bool hasTransformAnimation() const;
struct TransformData {
TransformationMatrix target;
......
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