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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 void GraphicsLayer::setContentsToCanvas(WebLayer* layer) | 1016 void GraphicsLayer::setContentsToCanvas(WebLayer* layer) |
1017 { | 1017 { |
1018 setContentsTo(ContentsLayerForCanvas, layer); | 1018 setContentsTo(ContentsLayerForCanvas, layer); |
1019 } | 1019 } |
1020 | 1020 |
1021 void GraphicsLayer::setContentsToMedia(WebLayer* layer) | 1021 void GraphicsLayer::setContentsToMedia(WebLayer* layer) |
1022 { | 1022 { |
1023 setContentsTo(ContentsLayerForVideo, layer); | 1023 setContentsTo(ContentsLayerForVideo, layer); |
1024 } | 1024 } |
1025 | 1025 |
1026 bool GraphicsLayer::addAnimation(WebAnimation* animation) | 1026 bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation) |
1027 { | 1027 { |
| 1028 OwnPtr<WebAnimation> animation(popAnimation); |
1028 ASSERT(animation); | 1029 ASSERT(animation); |
1029 platformLayer()->setAnimationDelegate(this); | 1030 platformLayer()->setAnimationDelegate(this); |
1030 | 1031 |
1031 // Remove any existing animations with the same animation id and target prop
erty. | 1032 // Remove any existing animations with the same animation id and target prop
erty. |
1032 platformLayer()->removeAnimation(animation->id(), animation->targetProperty(
)); | 1033 platformLayer()->removeAnimation(animation->id(), animation->targetProperty(
)); |
1033 return platformLayer()->addAnimation(animation); | 1034 return platformLayer()->addAnimation(animation.leakPtr()); |
1034 } | 1035 } |
1035 | 1036 |
1036 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) | 1037 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) |
1037 { | 1038 { |
1038 platformLayer()->pauseAnimation(animationId, timeOffset); | 1039 platformLayer()->pauseAnimation(animationId, timeOffset); |
1039 } | 1040 } |
1040 | 1041 |
1041 void GraphicsLayer::removeAnimation(int animationId) | 1042 void GraphicsLayer::removeAnimation(int animationId) |
1042 { | 1043 { |
1043 platformLayer()->removeAnimation(animationId); | 1044 platformLayer()->removeAnimation(animationId); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 #ifndef NDEBUG | 1216 #ifndef NDEBUG |
1216 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) | 1217 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) |
1217 { | 1218 { |
1218 if (!layer) | 1219 if (!layer) |
1219 return; | 1220 return; |
1220 | 1221 |
1221 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); | 1222 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); |
1222 fprintf(stderr, "%s\n", output.utf8().data()); | 1223 fprintf(stderr, "%s\n", output.utf8().data()); |
1223 } | 1224 } |
1224 #endif | 1225 #endif |
OLD | NEW |