OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 } | 1112 } |
1113 | 1113 |
1114 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); | 1114 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); |
1115 } | 1115 } |
1116 | 1116 |
1117 bool GraphicsLayer::addAnimation(PassOwnPtr<WebCompositorAnimation> popAnimation
) | 1117 bool GraphicsLayer::addAnimation(PassOwnPtr<WebCompositorAnimation> popAnimation
) |
1118 { | 1118 { |
1119 OwnPtr<WebCompositorAnimation> animation(std::move(popAnimation)); | 1119 OwnPtr<WebCompositorAnimation> animation(std::move(popAnimation)); |
1120 ASSERT(animation); | 1120 ASSERT(animation); |
1121 platformLayer()->setAnimationDelegate(this); | 1121 platformLayer()->setAnimationDelegate(this); |
1122 | |
1123 // Remove any existing animations with the same animation id and target prop
erty. | |
1124 platformLayer()->removeAnimation(animation->id(), animation->targetProperty(
)); | |
1125 return platformLayer()->addAnimation(animation.leakPtr()); | 1122 return platformLayer()->addAnimation(animation.leakPtr()); |
1126 } | 1123 } |
1127 | 1124 |
1128 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) | 1125 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) |
1129 { | 1126 { |
1130 platformLayer()->pauseAnimation(animationId, timeOffset); | 1127 platformLayer()->pauseAnimation(animationId, timeOffset); |
1131 } | 1128 } |
1132 | 1129 |
1133 void GraphicsLayer::removeAnimation(int animationId) | 1130 void GraphicsLayer::removeAnimation(int animationId) |
1134 { | 1131 { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 { | 1264 { |
1268 if (!layer) { | 1265 if (!layer) { |
1269 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1266 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1270 return; | 1267 return; |
1271 } | 1268 } |
1272 | 1269 |
1273 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1270 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1274 fprintf(stderr, "%s\n", output.utf8().data()); | 1271 fprintf(stderr, "%s\n", output.utf8().data()); |
1275 } | 1272 } |
1276 #endif | 1273 #endif |
OLD | NEW |