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

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: Created 7 years, 3 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
« no previous file with comments | « no previous file | public/platform/WebLayer.h » ('j') | public/platform/WebPassOwnPtr.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 animationId = m_animationIdMap.get(animationName); 993 animationId = m_animationIdMap.get(animationName);
994 994
995 OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId , timeOffset, boxSize)); 995 OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId , timeOffset, boxSize));
996 996
997 if (toAdd) { 997 if (toAdd) {
998 animationId = toAdd->id(); 998 animationId = toAdd->id();
999 m_animationIdMap.set(animationName, animationId); 999 m_animationIdMap.set(animationName, animationId);
1000 1000
1001 // Remove any existing animations with the same animation id and target property. 1001 // Remove any existing animations with the same animation id and target property.
1002 platformLayer()->removeAnimation(animationId, toAdd->targetProperty()); 1002 platformLayer()->removeAnimation(animationId, toAdd->targetProperty());
1003 return platformLayer()->addAnimation(toAdd.get()); 1003 return platformLayer()->addAnimation(toAdd.release());
1004 } 1004 }
1005 1005
1006 return false; 1006 return false;
1007 } 1007 }
1008 1008
1009 void GraphicsLayer::pauseAnimation(const String& animationName, double timeOffse t) 1009 void GraphicsLayer::pauseAnimation(const String& animationName, double timeOffse t)
1010 { 1010 {
1011 if (m_animationIdMap.contains(animationName)) 1011 if (m_animationIdMap.contains(animationName))
1012 platformLayer()->pauseAnimation(m_animationIdMap.get(animationName), tim eOffset); 1012 platformLayer()->pauseAnimation(m_animationIdMap.get(animationName), tim eOffset);
1013 } 1013 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 #ifndef NDEBUG 1211 #ifndef NDEBUG
1212 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1212 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1213 { 1213 {
1214 if (!layer) 1214 if (!layer)
1215 return; 1215 return;
1216 1216
1217 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1217 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1218 fprintf(stderr, "%s\n", output.utf8().data()); 1218 fprintf(stderr, "%s\n", output.utf8().data());
1219 } 1219 }
1220 #endif 1220 #endif
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebLayer.h » ('j') | public/platform/WebPassOwnPtr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698