Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: Source/core/platform/graphics/GraphicsLayer.cpp

Issue 23455058: WIP: WebLayer::addAnimation should transfer the ownership of WebAnimation instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve WebPassOwnPtr so that it is hard to make a mistake. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 void GraphicsLayer::setContentsToCanvas(WebLayer* layer) 1014 void GraphicsLayer::setContentsToCanvas(WebLayer* layer)
1015 { 1015 {
1016 setContentsTo(ContentsLayerForCanvas, layer); 1016 setContentsTo(ContentsLayerForCanvas, layer);
1017 } 1017 }
1018 1018
1019 void GraphicsLayer::setContentsToMedia(WebLayer* layer) 1019 void GraphicsLayer::setContentsToMedia(WebLayer* layer)
1020 { 1020 {
1021 setContentsTo(ContentsLayerForVideo, layer); 1021 setContentsTo(ContentsLayerForVideo, layer);
1022 } 1022 }
1023 1023
1024 bool GraphicsLayer::addAnimation(WebAnimation* animation) 1024 bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation)
1025 { 1025 {
1026 OwnPtr<WebAnimation> animation(popAnimation);
1026 ASSERT(animation); 1027 ASSERT(animation);
1027 platformLayer()->setAnimationDelegate(this); 1028 platformLayer()->setAnimationDelegate(this);
1028 1029
1029 // Remove any existing animations with the same animation id and target prop erty. 1030 // Remove any existing animations with the same animation id and target prop erty.
1030 platformLayer()->removeAnimation(animation->id(), animation->targetProperty( )); 1031 platformLayer()->removeAnimation(animation->id(), animation->targetProperty( ));
1031 return platformLayer()->addAnimation(animation); 1032 return platformLayer()->addAnimation(animation.release());
1032 } 1033 }
1033 1034
1034 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) 1035 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)
1035 { 1036 {
1036 platformLayer()->pauseAnimation(animationId, timeOffset); 1037 platformLayer()->pauseAnimation(animationId, timeOffset);
1037 } 1038 }
1038 1039
1039 void GraphicsLayer::removeAnimation(int animationId) 1040 void GraphicsLayer::removeAnimation(int animationId)
1040 { 1041 {
1041 platformLayer()->removeAnimation(animationId); 1042 platformLayer()->removeAnimation(animationId);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 #ifndef NDEBUG 1219 #ifndef NDEBUG
1219 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1220 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1220 { 1221 {
1221 if (!layer) 1222 if (!layer)
1222 return; 1223 return;
1223 1224
1224 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1225 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1225 fprintf(stderr, "%s\n", output.utf8().data()); 1226 fprintf(stderr, "%s\n", output.utf8().data());
1226 } 1227 }
1227 #endif 1228 #endif
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | Source/core/rendering/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698