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

Side by Side Diff: Source/core/rendering/RenderLayerBacking.cpp

Issue 23834010: Change WebLayer::addAnimation to transfer ownership of WebAnimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change GraphicsLayer and LinkHighlight to clarify ownership transfer 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 { 1707 {
1708 bool hasTransform = renderer()->isBox() && keyframes.containsProperty(CSSPro pertyWebkitTransform); 1708 bool hasTransform = renderer()->isBox() && keyframes.containsProperty(CSSPro pertyWebkitTransform);
1709 IntSize boxSize; 1709 IntSize boxSize;
1710 if (hasTransform) 1710 if (hasTransform)
1711 boxSize = toRenderBox(renderer())->pixelSnappedBorderBoxRect().size(); 1711 boxSize = toRenderBox(renderer())->pixelSnappedBorderBoxRect().size();
1712 WebAnimations animations(m_animationProvider->startAnimation(timeOffset, ani m, keyframes, hasTransform, boxSize)); 1712 WebAnimations animations(m_animationProvider->startAnimation(timeOffset, ani m, keyframes, hasTransform, boxSize));
1713 if (animations.isEmpty()) 1713 if (animations.isEmpty())
1714 return false; 1714 return false;
1715 1715
1716 bool didAnimate = false; 1716 bool didAnimate = false;
1717 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati ons.m_transformAnimation.get())) 1717 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati ons.m_transformAnimation.release()))
Ian Vollick 2013/09/20 15:19:02 This will need to be rebased on top of your previo
dshwang 2013/09/20 15:22:20 Yes, after CL 24198009 is landed, I'll rebase to u
1718 didAnimate = true; 1718 didAnimate = true;
1719 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation s.m_opacityAnimation.get())) 1719 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation s.m_opacityAnimation.release()))
1720 didAnimate = true; 1720 didAnimate = true;
1721 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations .m_filterAnimation.get())) 1721 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations .m_filterAnimation.release()))
1722 didAnimate = true; 1722 didAnimate = true;
1723 1723
1724 return didAnimate; 1724 return didAnimate;
1725 } 1725 }
1726 1726
1727 void RenderLayerBacking::animationPaused(double timeOffset, const String& animat ionName) 1727 void RenderLayerBacking::animationPaused(double timeOffset, const String& animat ionName)
1728 { 1728 {
1729 int animationId = m_animationProvider->getWebAnimationId(animationName); 1729 int animationId = m_animationProvider->getWebAnimationId(animationName);
1730 if (animationId) 1730 if (animationId)
1731 m_graphicsLayer->pauseAnimation(animationId, timeOffset); 1731 m_graphicsLayer->pauseAnimation(animationId, timeOffset);
(...skipping 16 matching lines...) Expand all
1748 } 1748 }
1749 float fromOpacity = 0; 1749 float fromOpacity = 0;
1750 float toOpacity = 0; 1750 float toOpacity = 0;
1751 if (property == CSSPropertyOpacity) { 1751 if (property == CSSPropertyOpacity) {
1752 fromOpacity = compositingOpacity(fromStyle->opacity()); 1752 fromOpacity = compositingOpacity(fromStyle->opacity());
1753 toOpacity = compositingOpacity(toStyle->opacity()); 1753 toOpacity = compositingOpacity(toStyle->opacity());
1754 } 1754 }
1755 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr operty, fromStyle, 1755 WebAnimations animations(m_animationProvider->startTransition(timeOffset, pr operty, fromStyle,
1756 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS ize, fromOpacity, toOpacity)); 1756 toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxS ize, fromOpacity, toOpacity));
1757 bool didAnimate = false; 1757 bool didAnimate = false;
1758 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati ons.m_transformAnimation.get())) { 1758 if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animati ons.m_transformAnimation.release())) {
1759 // To ensure that the correct transform is visible when the animation en ds, also set the final transform. 1759 // To ensure that the correct transform is visible when the animation en ds, also set the final transform.
1760 updateTransform(toStyle); 1760 updateTransform(toStyle);
1761 didAnimate = true; 1761 didAnimate = true;
1762 } 1762 }
1763 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation s.m_opacityAnimation.get())) { 1763 if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animation s.m_opacityAnimation.release())) {
1764 // To ensure that the correct opacity is visible when the animation ends , also set the final opacity. 1764 // To ensure that the correct opacity is visible when the animation ends , also set the final opacity.
1765 updateOpacity(toStyle); 1765 updateOpacity(toStyle);
1766 didAnimate = true; 1766 didAnimate = true;
1767 } 1767 }
1768 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations .m_filterAnimation.get())) { 1768 if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations .m_filterAnimation.release())) {
1769 // To ensure that the correct filter is visible when the animation ends, also set the final filter. 1769 // To ensure that the correct filter is visible when the animation ends, also set the final filter.
1770 updateFilters(toStyle); 1770 updateFilters(toStyle);
1771 didAnimate = true; 1771 didAnimate = true;
1772 } 1772 }
1773 1773
1774 return didAnimate; 1774 return didAnimate;
1775 } 1775 }
1776 1776
1777 void RenderLayerBacking::transitionPaused(double timeOffset, CSSPropertyID prope rty) 1777 void RenderLayerBacking::transitionPaused(double timeOffset, CSSPropertyID prope rty)
1778 { 1778 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 1879 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
1880 name = "Scrolling Contents Layer"; 1880 name = "Scrolling Contents Layer";
1881 } else { 1881 } else {
1882 ASSERT_NOT_REACHED(); 1882 ASSERT_NOT_REACHED();
1883 } 1883 }
1884 1884
1885 return name; 1885 return name;
1886 } 1886 }
1887 1887
1888 } // namespace WebCore 1888 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698