| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
|
| index 67b15bf055fd488ca9b9d8fa72270684089c0bf5..4bb23349816b139b054039bd4121597a0ba0d3e2 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
|
| @@ -42,7 +42,8 @@
|
| #include "public/platform/WebLayer.h"
|
| #include "public/platform/WebLayerTreeView.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "wtf/PassOwnPtr.h"
|
| +#include "wtf/PtrUtil.h"
|
| +#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -50,15 +51,15 @@ class GraphicsLayerTest : public testing::Test {
|
| public:
|
| GraphicsLayerTest()
|
| {
|
| - m_clipLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
|
| - m_scrollElasticityLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
|
| - m_graphicsLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
|
| + m_clipLayer = wrapUnique(new FakeGraphicsLayer(&m_client));
|
| + m_scrollElasticityLayer = wrapUnique(new FakeGraphicsLayer(&m_client));
|
| + m_graphicsLayer = wrapUnique(new FakeGraphicsLayer(&m_client));
|
| m_clipLayer->addChild(m_scrollElasticityLayer.get());
|
| m_scrollElasticityLayer->addChild(m_graphicsLayer.get());
|
| m_graphicsLayer->platformLayer()->setScrollClipLayer(
|
| m_clipLayer->platformLayer());
|
| m_platformLayer = m_graphicsLayer->platformLayer();
|
| - m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting);
|
| + m_layerTreeView = wrapUnique(new WebLayerTreeViewImplForTesting);
|
| ASSERT(m_layerTreeView);
|
| m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer());
|
| m_layerTreeView->registerViewportLayers(
|
| @@ -76,12 +77,12 @@ public:
|
|
|
| protected:
|
| WebLayer* m_platformLayer;
|
| - OwnPtr<FakeGraphicsLayer> m_graphicsLayer;
|
| - OwnPtr<FakeGraphicsLayer> m_scrollElasticityLayer;
|
| - OwnPtr<FakeGraphicsLayer> m_clipLayer;
|
| + std::unique_ptr<FakeGraphicsLayer> m_graphicsLayer;
|
| + std::unique_ptr<FakeGraphicsLayer> m_scrollElasticityLayer;
|
| + std::unique_ptr<FakeGraphicsLayer> m_clipLayer;
|
|
|
| private:
|
| - OwnPtr<WebLayerTreeView> m_layerTreeView;
|
| + std::unique_ptr<WebLayerTreeView> m_layerTreeView;
|
| FakeGraphicsLayerClient m_client;
|
| };
|
|
|
| @@ -89,7 +90,7 @@ class AnimationPlayerForTesting : public CompositorAnimationPlayerClient {
|
| public:
|
| AnimationPlayerForTesting()
|
| {
|
| - m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer());
|
| + m_compositorPlayer = wrapUnique(CompositorFactory::current().createAnimationPlayer());
|
| }
|
|
|
| CompositorAnimationPlayer* compositorPlayer() const override
|
| @@ -97,19 +98,19 @@ public:
|
| return m_compositorPlayer.get();
|
| }
|
|
|
| - OwnPtr<CompositorAnimationPlayer> m_compositorPlayer;
|
| + std::unique_ptr<CompositorAnimationPlayer> m_compositorPlayer;
|
| };
|
|
|
| TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
|
| {
|
| ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting());
|
|
|
| - OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::current().createFloatAnimationCurve());
|
| + std::unique_ptr<CompositorFloatAnimationCurve> curve = wrapUnique(CompositorFactory::current().createFloatAnimationCurve());
|
| curve->addCubicBezierKeyframe(CompositorFloatKeyframe(0.0, 0.0), CubicBezierTimingFunction::EaseType::EASE);
|
| - OwnPtr<CompositorAnimation> floatAnimation(adoptPtr(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY)));
|
| + std::unique_ptr<CompositorAnimation> floatAnimation(wrapUnique(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY)));
|
| int animationId = floatAnimation->id();
|
|
|
| - OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline());
|
| + std::unique_ptr<CompositorAnimationTimeline> compositorTimeline = wrapUnique(CompositorFactory::current().createAnimationTimeline());
|
| AnimationPlayerForTesting player;
|
|
|
| layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
|
| @@ -118,7 +119,7 @@ TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
|
| player.compositorPlayer()->attachLayer(m_platformLayer);
|
| ASSERT_TRUE(player.compositorPlayer()->isLayerAttached());
|
|
|
| - player.compositorPlayer()->addAnimation(floatAnimation.leakPtr());
|
| + player.compositorPlayer()->addAnimation(floatAnimation.release());
|
|
|
| ASSERT_TRUE(m_platformLayer->hasActiveAnimationForTesting());
|
|
|
|
|