diff --git a/cc/layers/delegated_frame_provider.cc b/cc/layers/delegated_frame_provider.cc index 5d07cc4e10f5b0..06b041f627afd7 100644 --- a/cc/layers/delegated_frame_provider.cc +++ b/cc/layers/delegated_frame_provider.cc @@ -18,7 +18,7 @@ DelegatedFrameProvider::DelegatedFrameProvider( RenderPass* root_pass = frame->render_pass_list.back().get(); frame_size_ = root_pass->output_rect.size(); DCHECK(!frame_size_.IsEmpty()); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); } DelegatedFrameProvider::~DelegatedFrameProvider() { @@ -61,7 +61,7 @@ void DelegatedFrameProvider::SetFrameData( resource_collection_->UnrefResources(returned); } - frame_ = frame.Pass(); + frame_ = std::move(frame); resource_collection_->ReceivedResources(frame_->resource_list); resource_collection_->RefResources(frame_->resource_list); diff --git a/cc/layers/delegated_frame_provider_unittest.cc b/cc/layers/delegated_frame_provider_unittest.cc index 4248899641a037..e4115bd348af92 100644 --- a/cc/layers/delegated_frame_provider_unittest.cc +++ b/cc/layers/delegated_frame_provider_unittest.cc @@ -32,8 +32,8 @@ class DelegatedFrameProviderTest root_output_rect, root_damage_rect, gfx::Transform()); - frame->render_pass_list.push_back(root_pass.Pass()); - return frame.Pass(); + frame->render_pass_list.push_back(std::move(root_pass)); + return frame; } void AddTransferableResource(DelegatedFrameData* frame, @@ -84,7 +84,7 @@ class DelegatedFrameProviderTest void SetFrameProvider(scoped_ptr frame_data) { frame_provider_ = - new DelegatedFrameProvider(resource_collection_, frame_data.Pass()); + new DelegatedFrameProvider(resource_collection_, std::move(frame_data)); } scoped_refptr resource_collection_; @@ -99,12 +99,12 @@ TEST_F(DelegatedFrameProviderTest, SameResources) { CreateFrameData(gfx::Rect(1, 1), gfx::Rect(1, 1)); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); frame = CreateFrameData(gfx::Rect(1, 1), gfx::Rect(1, 1)); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); EXPECT_FALSE(ReturnAndResetResourcesAvailable()); EXPECT_EQ(0u, resources_.size()); @@ -121,14 +121,14 @@ TEST_F(DelegatedFrameProviderTest, ReplaceResources) { CreateFrameData(gfx::Rect(1, 1), gfx::Rect(1, 1)); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); EXPECT_FALSE(ReturnAndResetResourcesAvailable()); frame = CreateFrameData(gfx::Rect(1, 1), gfx::Rect(1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); EXPECT_TRUE(ReturnAndResetResourcesAvailable()); EXPECT_EQ(1u, resources_.size()); @@ -152,7 +152,7 @@ TEST_F(DelegatedFrameProviderTest, RefResources) { ReturnedResourceArray returned; TransferableResource::ReturnResources(reffed, &returned); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); scoped_refptr observer1 = DelegatedRendererLayer::Create(layer_settings_, frame_provider_); @@ -179,7 +179,7 @@ TEST_F(DelegatedFrameProviderTest, RefResources) { frame = CreateFrameData(gfx::Rect(5, 5), gfx::Rect(2, 2)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - frame_provider_->SetFrameData(frame.Pass()); + frame_provider_->SetFrameData(std::move(frame)); // The resources from the first frame are still reffed by the observers. EXPECT_FALSE(ReturnAndResetResourcesAvailable()); @@ -210,7 +210,7 @@ TEST_F(DelegatedFrameProviderTest, RefResourcesInFrameProvider) { ReturnedResourceArray returned; TransferableResource::ReturnResources(reffed, &returned); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); scoped_refptr observer1 = DelegatedRendererLayer::Create(layer_settings_, frame_provider_); @@ -235,7 +235,7 @@ TEST_F(DelegatedFrameProviderTest, RefResourcesInFrameProvider) { frame = CreateFrameData(gfx::Rect(5, 5), gfx::Rect(2, 2)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - frame_provider_->SetFrameData(frame.Pass()); + frame_provider_->SetFrameData(std::move(frame)); EXPECT_TRUE(ReturnAndResetResourcesAvailable()); EXPECT_EQ(1u, resources_.size()); @@ -252,7 +252,7 @@ TEST_F(DelegatedFrameProviderTest, RefResourcesInFrameProviderUntilDestroy) { ReturnedResourceArray returned; TransferableResource::ReturnResources(reffed, &returned); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); scoped_refptr observer1 = DelegatedRendererLayer::Create(layer_settings_, frame_provider_); @@ -296,7 +296,7 @@ TEST_F(DelegatedFrameProviderTest, Damage) { ReturnedResourceArray returned; TransferableResource::ReturnResources(reffed, &returned); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); scoped_refptr observer1 = DelegatedRendererLayer::Create(layer_settings_, frame_provider_); @@ -320,7 +320,7 @@ TEST_F(DelegatedFrameProviderTest, Damage) { frame = CreateFrameData(gfx::Rect(5, 5), gfx::Rect(2, 2)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - frame_provider_->SetFrameData(frame.Pass()); + frame_provider_->SetFrameData(std::move(frame)); // Both observers get the damage for the new frame. frame_provider_->GetFrameDataAndRefResources(observer1.get(), &damage); @@ -341,7 +341,7 @@ TEST_F(DelegatedFrameProviderTest, LostNothing) { TransferableResourceArray reffed = frame->resource_list; - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); // There is nothing to lose. EXPECT_FALSE(ReturnAndResetResourcesAvailable()); @@ -356,14 +356,14 @@ TEST_F(DelegatedFrameProviderTest, LostSomething) { AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); // Add a second reference on the resource. frame = CreateFrameData(gfx::Rect(5, 5), gfx::Rect(5, 5)); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); // There is something to lose. EXPECT_FALSE(ReturnAndResetResourcesAvailable()); @@ -380,7 +380,7 @@ TEST_F(DelegatedFrameProviderTest, NothingReturnedAfterLoss) { CreateFrameData(gfx::Rect(1, 1), gfx::Rect(1, 1)); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameProvider(frame.Pass()); + SetFrameProvider(std::move(frame)); EXPECT_FALSE(ReturnAndResetResourcesAvailable()); diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc index 7a5b622c58bb6e..ca735d0b165c4a 100644 --- a/cc/layers/delegated_renderer_layer_impl.cc +++ b/cc/layers/delegated_renderer_layer_impl.cc @@ -175,12 +175,12 @@ void DelegatedRendererLayerImpl::SetRenderPasses( RenderPassList* render_passes_in_draw_order) { ClearRenderPasses(); - for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { - RenderPassList::iterator to_take = - render_passes_in_draw_order->begin() + i; + size_t i = 0; + for (auto& render_pass : *render_passes_in_draw_order) { render_passes_index_by_id_.insert( - RenderPassToIndexMap::value_type((*to_take)->id, i)); - render_passes_in_draw_order_.push_back(to_take->Pass()); + RenderPassToIndexMap::value_type(render_pass->id, i)); + render_passes_in_draw_order_.push_back(std::move(render_pass)); + ++i; } // Give back an empty array instead of nulls. @@ -265,7 +265,7 @@ void DelegatedRendererLayerImpl::AppendContributingRenderPasses( render_passes_in_draw_order_[i]->Copy(output_render_pass_id); copy_pass->transform_to_root_target.ConcatTransform( delegated_frame_to_root_transform); - render_pass_sink->AppendRenderPass(copy_pass.Pass()); + render_pass_sink->AppendRenderPass(std::move(copy_pass)); } } diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc index e14d2a481e377c..2a93a8b70dd52b 100644 --- a/cc/layers/delegated_renderer_layer_impl_unittest.cc +++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc @@ -118,13 +118,13 @@ class DelegatedRendererLayerImplTestSimple // Force the delegated RenderPasses to come before the RenderPass from // layer_after. - layer_after->AddChild(delegated_renderer_layer.Pass()); - root_layer->AddChild(layer_after.Pass()); + layer_after->AddChild(std::move(delegated_renderer_layer)); + root_layer->AddChild(std::move(layer_after)); // Get the RenderPass generated by layer_before to come before the delegated // RenderPasses. - root_layer->AddChild(layer_before.Pass()); - host_impl_->active_tree()->SetRootLayer(root_layer.Pass()); + root_layer->AddChild(std::move(layer_before)); + host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); } protected: @@ -174,9 +174,9 @@ TEST_F(DelegatedRendererLayerImplTest, fake_delegated_renderer_layer_impl = delegated_renderer_layer.get(); - root_layer->AddChild(delegated_renderer_layer.Pass()); + root_layer->AddChild(std::move(delegated_renderer_layer)); - host_impl_->active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); LayerTreeHostImpl::FrameData frame; EXPECT_EQ(DRAW_SUCCESS, PrepareToDrawFrame(&frame)); @@ -253,9 +253,9 @@ TEST_F(DelegatedRendererLayerImplTest, fake_delegated_renderer_layer_impl = delegated_renderer_layer.get(); - root_layer->AddChild(delegated_renderer_layer.Pass()); + root_layer->AddChild(std::move(delegated_renderer_layer)); - host_impl_->pending_tree()->SetRootLayer(root_layer.Pass()); + host_impl_->pending_tree()->SetRootLayer(std::move(root_layer)); host_impl_->ActivateSyncTree(); LayerTreeHostImpl::FrameData frame; @@ -740,8 +740,8 @@ class DelegatedRendererLayerImplTestTransform root_layer_ = root_layer.get(); delegated_renderer_layer_ = delegated_renderer_layer.get(); - root_layer->AddChild(delegated_renderer_layer.Pass()); - host_impl_->active_tree()->SetRootLayer(root_layer.Pass()); + root_layer->AddChild(std::move(delegated_renderer_layer)); + host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); } void VerifyRenderPasses( @@ -1169,14 +1169,14 @@ class DelegatedRendererLayerImplTestClip origin_layer->SetPosition( gfx::PointF(-clip_origin.x(), -clip_origin.y())); - origin_layer->AddChild(delegated_renderer_layer.Pass()); - clip_layer->AddChild(origin_layer.Pass()); - root_layer->AddChild(clip_layer.Pass()); + origin_layer->AddChild(std::move(delegated_renderer_layer)); + clip_layer->AddChild(std::move(origin_layer)); + root_layer->AddChild(std::move(clip_layer)); } else { - root_layer->AddChild(delegated_renderer_layer.Pass()); + root_layer->AddChild(std::move(delegated_renderer_layer)); } - host_impl_->active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); } protected: diff --git a/cc/layers/delegated_renderer_layer_unittest.cc b/cc/layers/delegated_renderer_layer_unittest.cc index 85f0f2e678f628..2e621f419ec4be 100644 --- a/cc/layers/delegated_renderer_layer_unittest.cc +++ b/cc/layers/delegated_renderer_layer_unittest.cc @@ -43,9 +43,9 @@ class DelegatedRendererLayerTestSimple : public DelegatedRendererLayerTest { root_pass->SetNew( RenderPassId(1, 1), gfx::Rect(1, 1), gfx::Rect(1, 1), gfx::Transform()); scoped_ptr frame_data(new DelegatedFrameData); - frame_data->render_pass_list.push_back(root_pass.Pass()); + frame_data->render_pass_list.push_back(std::move(root_pass)); resources_ = new DelegatedFrameResourceCollection; - provider_ = new DelegatedFrameProvider(resources_, frame_data.Pass()); + provider_ = new DelegatedFrameProvider(resources_, std::move(frame_data)); LayerSettings layer_settings; root_layer_ = SolidColorLayer::Create(layer_settings); layer_before_ = SolidColorLayer::Create(layer_settings); diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 964cbf490fae99..b5ba9096472fd5 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -103,7 +103,7 @@ void HeadsUpDisplayLayerImpl::AcquireResource( resource->Allocate(internal_content_bounds_, ResourceProvider::TEXTURE_HINT_IMMUTABLE, resource_provider->best_texture_format()); - resources_.push_back(resource.Pass()); + resources_.push_back(std::move(resource)); } void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources( diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 1c6d8997cceb35..42c128948571b8 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -422,7 +422,7 @@ void Layer::RequestCopyOfOutput( } if (request->IsEmpty()) return; - copy_requests_.push_back(request.Pass()); + copy_requests_.push_back(std::move(request)); if (had_no_copy_requests) { UpdateNumCopyRequestsForSubtree(1); } @@ -1161,7 +1161,7 @@ void Layer::SetPositionConstraint(const LayerPositionConstraint& constraint) { static void RunCopyCallbackOnMainThread(scoped_ptr request, scoped_ptr result) { - request->SendResult(result.Pass()); + request->SendResult(std::move(result)); } static void PostCopyCallbackToMainThread( @@ -1309,7 +1309,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { base::Bind(&PostCopyCallbackToMainThread, main_thread_task_runner, base::Passed(&original_request))); - main_thread_copy_requests.push_back(main_thread_request.Pass()); + main_thread_copy_requests.push_back(std::move(main_thread_request)); } if (!copy_requests_.empty() && layer_tree_host_) layer_tree_host_->property_trees()->needs_rebuild = true; @@ -1659,7 +1659,7 @@ bool Layer::AddAnimation(scoped_ptr animation) { UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", !layer_tree_host_); - layer_animation_controller_->AddAnimation(animation.Pass()); + layer_animation_controller_->AddAnimation(std::move(animation)); SetNeedsCommit(); return true; } diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index e0b7f44738c05d..38cebf6c1bc15e 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -127,7 +127,7 @@ LayerImpl::~LayerImpl() { void LayerImpl::AddChild(scoped_ptr child) { child->SetParent(this); DCHECK_EQ(layer_tree_impl(), child->layer_tree_impl()); - children_.push_back(child.Pass()); + children_.push_back(std::move(child)); layer_tree_impl()->set_needs_update_draw_properties(); } @@ -1023,7 +1023,7 @@ void LayerImpl::SetMaskLayer(scoped_ptr mask_layer) { return; } - mask_layer_ = mask_layer.Pass(); + mask_layer_ = std::move(mask_layer); mask_layer_id_ = new_layer_id; if (mask_layer_) mask_layer_->SetParent(this); @@ -1032,7 +1032,7 @@ void LayerImpl::SetMaskLayer(scoped_ptr mask_layer) { scoped_ptr LayerImpl::TakeMaskLayer() { mask_layer_id_ = -1; - return mask_layer_.Pass(); + return std::move(mask_layer_); } void LayerImpl::SetReplicaLayer(scoped_ptr replica_layer) { @@ -1045,7 +1045,7 @@ void LayerImpl::SetReplicaLayer(scoped_ptr replica_layer) { return; } - replica_layer_ = replica_layer.Pass(); + replica_layer_ = std::move(replica_layer); replica_layer_id_ = new_layer_id; if (replica_layer_) replica_layer_->SetParent(this); @@ -1054,7 +1054,7 @@ void LayerImpl::SetReplicaLayer(scoped_ptr replica_layer) { scoped_ptr LayerImpl::TakeReplicaLayer() { replica_layer_id_ = -1; - return replica_layer_.Pass(); + return std::move(replica_layer_); } ScrollbarLayerImplBase* LayerImpl::ToScrollbarLayer() { diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index 65691b4aa5e18d..c5b62573ff8e73 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -99,7 +99,7 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) { scoped_ptr root_ptr = LayerImpl::Create(host_impl.active_tree(), 2); LayerImpl* root = root_ptr.get(); - root_clip->AddChild(root_ptr.Pass()); + root_clip->AddChild(std::move(root_ptr)); scoped_ptr scroll_parent = LayerImpl::Create(host_impl.active_tree(), 3); LayerImpl* scroll_child = LayerImpl::Create(host_impl.active_tree(), 4).get(); @@ -261,7 +261,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { scoped_ptr layer_ptr = LayerImpl::Create(host_impl.active_tree(), 2); LayerImpl* layer = layer_ptr.get(); - root->AddChild(layer_ptr.Pass()); + root->AddChild(std::move(layer_ptr)); layer->SetScrollClipLayer(root->id()); host_impl.active_tree()->BuildPropertyTreesForTesting(); DCHECK(host_impl.CanDraw()); diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc index 1d71b1243ab899..b7757670babf3e 100644 --- a/cc/layers/layer_iterator_unittest.cc +++ b/cc/layers/layer_iterator_unittest.cc @@ -130,13 +130,13 @@ TEST_F(LayerIteratorTest, SimpleTree) { TestLayerImpl* third_ptr = third.get(); TestLayerImpl* fourth_ptr = fourth.get(); - root_layer->AddChild(first.Pass()); - root_layer->AddChild(second.Pass()); - root_layer->AddChild(third.Pass()); - root_layer->AddChild(fourth.Pass()); + root_layer->AddChild(std::move(first)); + root_layer->AddChild(std::move(second)); + root_layer->AddChild(std::move(third)); + root_layer->AddChild(std::move(fourth)); root_layer->SetHasRenderSurface(true); - host_impl_.active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( @@ -172,17 +172,17 @@ TEST_F(LayerIteratorTest, ComplexTree) { TestLayerImpl* root221_ptr = root221.get(); TestLayerImpl* root231_ptr = root231.get(); - root22->AddChild(root221.Pass()); - root23->AddChild(root231.Pass()); - root2->AddChild(root21.Pass()); - root2->AddChild(root22.Pass()); - root2->AddChild(root23.Pass()); - root_layer->AddChild(root1.Pass()); - root_layer->AddChild(root2.Pass()); - root_layer->AddChild(root3.Pass()); + root22->AddChild(std::move(root221)); + root23->AddChild(std::move(root231)); + root2->AddChild(std::move(root21)); + root2->AddChild(std::move(root22)); + root2->AddChild(std::move(root23)); + root_layer->AddChild(std::move(root1)); + root_layer->AddChild(std::move(root2)); + root_layer->AddChild(std::move(root3)); root_layer->SetHasRenderSurface(true); - host_impl_.active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( @@ -223,20 +223,20 @@ TEST_F(LayerIteratorTest, ComplexTreeMultiSurface) { TestLayerImpl* root231_ptr = root231.get(); root22->SetHasRenderSurface(true); - root22->AddChild(root221.Pass()); + root22->AddChild(std::move(root221)); root23->SetHasRenderSurface(true); - root23->AddChild(root231.Pass()); + root23->AddChild(std::move(root231)); root2->SetDrawsContent(false); root2->SetHasRenderSurface(true); - root2->AddChild(root21.Pass()); - root2->AddChild(root22.Pass()); - root2->AddChild(root23.Pass()); - root_layer->AddChild(root1.Pass()); - root_layer->AddChild(root2.Pass()); - root_layer->AddChild(root3.Pass()); + root2->AddChild(std::move(root21)); + root2->AddChild(std::move(root22)); + root2->AddChild(std::move(root23)); + root_layer->AddChild(std::move(root1)); + root_layer->AddChild(std::move(root2)); + root_layer->AddChild(std::move(root3)); root_layer->SetHasRenderSurface(true); - host_impl_.active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index 8117de8296e134..b3007e34ae08e6 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc @@ -1153,9 +1153,9 @@ static bool AddTestAnimation(Layer* layer) { curve->AddKeyframe( FloatKeyframe::Create(base::TimeDelta::FromSecondsD(1.0), 0.7f, nullptr)); scoped_ptr animation = - Animation::Create(curve.Pass(), 0, 0, Animation::OPACITY); + Animation::Create(std::move(curve), 0, 0, Animation::OPACITY); - return layer->AddAnimation(animation.Pass()); + return layer->AddAnimation(std::move(animation)); } TEST_F(LayerLayerTreeHostTest, ShouldNotAddAnimationWithoutAnimationRegistrar) { @@ -1274,11 +1274,11 @@ TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) { // layer does not abort either one. scoped_ptr request = CopyOutputRequest::CreateRequest( base::Bind(&ReceiveCopyOutputResult, &result_count)); - layer->RequestCopyOfOutput(request.Pass()); + layer->RequestCopyOfOutput(std::move(request)); EXPECT_EQ(0, result_count); request = CopyOutputRequest::CreateRequest( base::Bind(&ReceiveCopyOutputResult, &result_count)); - layer->RequestCopyOfOutput(request.Pass()); + layer->RequestCopyOfOutput(std::move(request)); EXPECT_EQ(0, result_count); // When the layer is destroyed, expect both requests to be aborted. @@ -1295,27 +1295,28 @@ TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) { request = CopyOutputRequest::CreateRequest(base::Bind( &ReceiveCopyOutputResult, &did_receive_first_result_from_this_source)); request->set_source(this); - layer->RequestCopyOfOutput(request.Pass()); + layer->RequestCopyOfOutput(std::move(request)); EXPECT_EQ(0, did_receive_first_result_from_this_source); // Make a request from a different source. int did_receive_result_from_different_source = 0; request = CopyOutputRequest::CreateRequest(base::Bind( &ReceiveCopyOutputResult, &did_receive_result_from_different_source)); request->set_source(reinterpret_cast(0xdeadbee0)); - layer->RequestCopyOfOutput(request.Pass()); + layer->RequestCopyOfOutput(std::move(request)); EXPECT_EQ(0, did_receive_result_from_different_source); // Make a request without specifying the source. int did_receive_result_from_anonymous_source = 0; request = CopyOutputRequest::CreateRequest(base::Bind( &ReceiveCopyOutputResult, &did_receive_result_from_anonymous_source)); - layer->RequestCopyOfOutput(request.Pass()); + layer->RequestCopyOfOutput(std::move(request)); EXPECT_EQ(0, did_receive_result_from_anonymous_source); // Make the second request from |this| source. int did_receive_second_result_from_this_source = 0; request = CopyOutputRequest::CreateRequest(base::Bind( &ReceiveCopyOutputResult, &did_receive_second_result_from_this_source)); request->set_source(this); - layer->RequestCopyOfOutput(request.Pass()); // First request to be aborted. + layer->RequestCopyOfOutput( + std::move(request)); // First request to be aborted. EXPECT_EQ(1, did_receive_first_result_from_this_source); EXPECT_EQ(0, did_receive_result_from_different_source); EXPECT_EQ(0, did_receive_result_from_anonymous_source); diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc index 5459921e5de193..455632d109c11f 100644 --- a/cc/layers/layer_utils_unittest.cc +++ b/cc/layers/layer_utils_unittest.cc @@ -43,7 +43,7 @@ class LayerUtilsGetAnimationBoundsTest : public testing::Test { root->AddChild(LayerImpl::Create(host_impl->active_tree(), 2)); root->children()[0]->AddChild( LayerImpl::Create(host_impl->active_tree(), 3)); - return root.Pass(); + return root; } FakeImplTaskRunnerProvider task_runner_provider_; diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc index 8ee3cb75bd148f..a074850152901b 100644 --- a/cc/layers/painted_scrollbar_layer.cc +++ b/cc/layers/painted_scrollbar_layer.cc @@ -35,15 +35,15 @@ scoped_refptr PaintedScrollbarLayer::Create( const LayerSettings& settings, scoped_ptr scrollbar, int scroll_layer_id) { - return make_scoped_refptr( - new PaintedScrollbarLayer(settings, scrollbar.Pass(), scroll_layer_id)); + return make_scoped_refptr(new PaintedScrollbarLayer( + settings, std::move(scrollbar), scroll_layer_id)); } PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings, scoped_ptr scrollbar, int scroll_layer_id) : Layer(settings), - scrollbar_(scrollbar.Pass()), + scrollbar_(std::move(scrollbar)), scroll_layer_id_(scroll_layer_id), internal_contents_scale_(1.f), thumb_thickness_(scrollbar_->ThumbThickness()), diff --git a/cc/layers/picture_image_layer.cc b/cc/layers/picture_image_layer.cc index f2caeaf199d580..357190b690b70b 100644 --- a/cc/layers/picture_image_layer.cc +++ b/cc/layers/picture_image_layer.cc @@ -44,7 +44,7 @@ void PictureImageLayer::SetImage(skia::RefPtr image) { if (image_.get() == image.get()) return; - image_ = image.Pass(); + image_ = std::move(image); UpdateDrawsContent(HasDrawableContent()); SetNeedsDisplay(); } @@ -80,7 +80,7 @@ scoped_refptr PictureImageLayer::PaintContentsToDisplayList( skia::RefPtr picture = skia::AdoptRef(recorder.endRecordingAsPicture()); auto* item = display_list->CreateAndAppendItem(); - item->SetNew(picture.Pass()); + item->SetNew(std::move(picture)); display_list->Finalize(); return display_list; diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc index 58d7004377985d..b886e29b09dd2b 100644 --- a/cc/layers/picture_image_layer_impl_unittest.cc +++ b/cc/layers/picture_image_layer_impl_unittest.cc @@ -133,7 +133,7 @@ TEST_F(PictureImageLayerImplTest, IgnoreIdealContentScale) { EXPECT_EQ(1.f, pending_layer->tilings()->tiling_at(0)->contents_scale()); // Push to active layer. - host_impl_.pending_tree()->SetRootLayer(pending_layer.Pass()); + host_impl_.pending_tree()->SetRootLayer(std::move(pending_layer)); host_impl_.ActivateSyncTree(); TestablePictureImageLayerImpl* active_layer = diff --git a/cc/layers/picture_image_layer_unittest.cc b/cc/layers/picture_image_layer_unittest.cc index f9379c6e3f9cd8..8ae97b218863f4 100644 --- a/cc/layers/picture_image_layer_unittest.cc +++ b/cc/layers/picture_image_layer_unittest.cc @@ -35,7 +35,7 @@ TEST(PictureImageLayerTest, PaintContentsToDisplayList) { skia::RefPtr image = skia::AdoptRef(image_surface->newImageSnapshot()); - layer->SetImage(image.Pass()); + layer->SetImage(std::move(image)); layer->SetBounds(gfx::Size(layer_rect.width(), layer_rect.height())); scoped_refptr display_list = diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index 0b92ff4a9d8a43..52559de2456488 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc @@ -34,7 +34,7 @@ PictureLayer::PictureLayer(const LayerSettings& settings, ContentLayerClient* client, scoped_ptr source) : PictureLayer(settings, client) { - recording_source_ = source.Pass(); + recording_source_ = std::move(source); } PictureLayer::~PictureLayer() { diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index 92f6282f2d7176..9820c21cef86e0 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -67,7 +67,7 @@ class PictureLayerImplPerfTest : public testing::Test { raster_source); pending_layer->SetDrawsContent(true); pending_layer->SetHasRenderSurface(true); - pending_tree->SetRootLayer(pending_layer.Pass()); + pending_tree->SetRootLayer(std::move(pending_layer)); pending_layer_ = static_cast( host_impl_.pending_tree()->LayerById(7)); diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index fc81bb9906b8bf..7c17b083e6d369 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -258,8 +258,8 @@ class PictureLayerImplTest : public testing::Test { pending_layer->SetBounds(raster_source->GetSize()); pending_layer->SetRasterSourceOnPending(raster_source, invalidation); - pending_root->AddChild(pending_layer.Pass()); - pending_tree->SetRootLayer(pending_root.Pass()); + pending_root->AddChild(std::move(pending_layer)); + pending_tree->SetRootLayer(std::move(pending_root)); pending_layer_ = static_cast( host_impl_.pending_tree()->LayerById(id_)); @@ -1363,7 +1363,7 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) { host_impl_.pending_tree(), 3, valid_raster_source); mask_ptr->SetBounds(layer_bounds); mask_ptr->SetDrawsContent(true); - pending_layer_->SetMaskLayer(mask_ptr.Pass()); + pending_layer_->SetMaskLayer(std::move(mask_ptr)); pending_layer_->SetHasRenderSurface(true); RebuildPropertyTreesOnPendingTree(); @@ -1492,7 +1492,7 @@ TEST_F(PictureLayerImplTest, ScaledMaskLayer) { host_impl_.pending_tree(), 3, valid_raster_source); mask_ptr->SetBounds(layer_bounds); mask_ptr->SetDrawsContent(true); - pending_layer_->SetMaskLayer(mask_ptr.Pass()); + pending_layer_->SetMaskLayer(std::move(mask_ptr)); pending_layer_->SetHasRenderSurface(true); RebuildPropertyTreesOnPendingTree(); @@ -1580,10 +1580,10 @@ TEST_F(PictureLayerImplTest, ClampTilesToMaxTileSize) { context->set_max_texture_size(140); host_impl_.DidLoseOutputSurface(); scoped_ptr new_output_surface = - FakeOutputSurface::Create3d(context.Pass()); + FakeOutputSurface::Create3d(std::move(context)); host_impl_.SetVisible(true); host_impl_.InitializeRenderer(new_output_surface.get()); - output_surface_ = new_output_surface.Pass(); + output_surface_ = std::move(new_output_surface); SetupDrawPropertiesAndUpdateTiles(pending_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, false); @@ -1620,10 +1620,10 @@ TEST_F(PictureLayerImplTest, ClampSingleTileToToMaxTileSize) { context->set_max_texture_size(140); host_impl_.DidLoseOutputSurface(); scoped_ptr new_output_surface = - FakeOutputSurface::Create3d(context.Pass()); + FakeOutputSurface::Create3d(std::move(context)); host_impl_.SetVisible(true); host_impl_.InitializeRenderer(new_output_surface.get()); - output_surface_ = new_output_surface.Pass(); + output_surface_ = std::move(new_output_surface); SetupDrawPropertiesAndUpdateTiles(active_layer_, 1.f, 1.f, 1.f, 1.f, 0.f, false); @@ -2287,7 +2287,7 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) { FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pending_raster_source); pending_layer->SetDrawsContent(true); - pending_tree->SetRootLayer(pending_layer.Pass()); + pending_tree->SetRootLayer(std::move(pending_layer)); pending_layer_ = static_cast( host_impl_.pending_tree()->LayerById(id_)); diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index 70855b4f1171d5..7e3a1fc0d01207 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -82,7 +82,7 @@ TEST(PictureLayerTest, SuitableForGpuRasterization) { MockContentLayerClient client; scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource( - LayerSettings(), &client, recording_source_owned.Pass()); + LayerSettings(), &client, std::move(recording_source_owned)); FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); TestTaskGraphRunner task_graph_runner; diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc index 4e88bda56a0500..d9eeb84211b440 100644 --- a/cc/layers/render_surface_impl.cc +++ b/cc/layers/render_surface_impl.cc @@ -190,7 +190,7 @@ void RenderSurfaceImpl::AppendRenderPasses(RenderPassSink* pass_sink) { gfx::IntersectRects(content_rect_, damage_tracker_->current_damage_rect()), screen_space_transform_); - pass_sink->AppendRenderPass(pass.Pass()); + pass_sink->AppendRenderPass(std::move(pass)); } void RenderSurfaceImpl::AppendQuads(RenderPass* render_pass, diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc index b4990b1247c965..a237bcb3ada917 100644 --- a/cc/layers/render_surface_unittest.cc +++ b/cc/layers/render_surface_unittest.cc @@ -101,7 +101,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { owning_layer->SetBlendMode(blend_mode); RenderSurfaceImpl* render_surface = owning_layer->render_surface(); - root_layer->AddChild(owning_layer.Pass()); + root_layer->AddChild(std::move(owning_layer)); gfx::Rect content_rect(0, 0, 50, 50); gfx::Rect clip_rect(5, 5, 40, 40); @@ -138,7 +138,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { class TestRenderPassSink : public RenderPassSink { public: void AppendRenderPass(scoped_ptr render_pass) override { - render_passes_.push_back(render_pass.Pass()); + render_passes_.push_back(std::move(render_pass)); } const RenderPassList& RenderPasses() const { @@ -165,7 +165,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectRenderPass) { owning_layer->draw_properties().render_target = owning_layer.get(); RenderSurfaceImpl* render_surface = owning_layer->render_surface(); - root_layer->AddChild(owning_layer.Pass()); + root_layer->AddChild(std::move(owning_layer)); gfx::Rect content_rect(0, 0, 50, 50); gfx::Transform origin; diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 3ebf090438613f..ce30ba0479728e 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -50,8 +50,8 @@ LayerImpl* LayerImplForScrollAreaAndScrollbar(const LayerSettings& settings, settings, scrollbar->Orientation(), thumb_thickness, track_start, kIsLeftSideVerticalScrollbar, child1->id()); } else { - child2 = - PaintedScrollbarLayer::Create(settings, scrollbar.Pass(), child1->id()); + child2 = PaintedScrollbarLayer::Create(settings, std::move(scrollbar), + child1->id()); } layer_tree_root->AddChild(child1); layer_tree_root->InsertChild(child2, reverse_order ? 0 : 1); @@ -149,8 +149,8 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { // Create and attach a non-overlay scrollbar. scoped_ptr scrollbar(new FakeScrollbar); LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( - layer_settings(), layer_tree_host_.get(), scrollbar.Pass(), false, false, - 0, 0); + layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false, + false, 0, 0); PaintedScrollbarLayerImpl* scrollbar_layer_impl = static_cast( layer_impl_tree_root->children()[1].get()); @@ -166,8 +166,8 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { scrollbar.reset(new FakeScrollbar(false, false, true)); layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( - layer_settings(), layer_tree_host_.get(), scrollbar.Pass(), false, false, - 0, 0); + layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false, + false, 0, 0); scrollbar_layer_impl = static_cast( layer_impl_tree_root->children()[1].get()); @@ -184,7 +184,7 @@ TEST_F(ScrollbarLayerTest, ScrollOffsetSynchronization) { scoped_refptr scroll_layer = Layer::Create(layer_settings()); scoped_refptr content_layer = Layer::Create(layer_settings()); scoped_refptr scrollbar_layer = PaintedScrollbarLayer::Create( - layer_settings(), scrollbar.Pass(), layer_tree_root->id()); + layer_settings(), std::move(scrollbar), layer_tree_root->id()); // Choose bounds to give max_scroll_offset = (30, 50). layer_tree_root->SetBounds(gfx::Size(70, 150)); @@ -371,8 +371,8 @@ TEST_F(ScrollbarLayerTest, SolidColorDrawQuads) { scoped_ptr scrollbar(new FakeScrollbar(false, true, true)); LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( - layer_settings(), layer_tree_host_.get(), scrollbar.Pass(), false, true, - kThumbThickness, kTrackStart); + layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false, + true, kThumbThickness, kTrackStart); ScrollbarLayerImplBase* scrollbar_layer_impl = static_cast( layer_impl_tree_root->children()[1].get()); @@ -593,7 +593,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { scoped_ptr scrollbar(new FakeScrollbar); scrollbar_layer_ = PaintedScrollbarLayer::Create( - layer_settings(), scrollbar.Pass(), scroll_layer_->id()); + layer_settings(), std::move(scrollbar), scroll_layer_->id()); scrollbar_layer_->SetScrollLayer(scroll_layer_->id()); scrollbar_layer_->SetLayerTreeHost(layer_tree_host()); scrollbar_layer_->SetBounds(bounds_); @@ -664,7 +664,7 @@ class ScrollbarLayerTestResourceCreationAndRelease : public ScrollbarLayerTest { kTrackStart, kIsLeftSideVerticalScrollbar, layer_tree_root->id()); } else { scrollbar_layer = PaintedScrollbarLayer::Create( - layer_settings(), scrollbar.Pass(), layer_tree_root->id()); + layer_settings(), std::move(scrollbar), layer_tree_root->id()); } layer_tree_root->AddChild(content_layer); layer_tree_root->AddChild(scrollbar_layer); diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc index e1862303caac1e..8d461881753996 100644 --- a/cc/layers/surface_layer.cc +++ b/cc/layers/surface_layer.cc @@ -112,7 +112,7 @@ void SurfaceLayer::SatisfyDestroySequence() { DCHECK(!destroy_sequence_.is_null()); scoped_ptr satisfy( new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); - layer_tree_host()->QueueSwapPromise(satisfy.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(satisfy)); destroy_sequence_ = SurfaceSequence(); } diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc index 5ddc8b66551da9..952078d5e25ca3 100644 --- a/cc/layers/texture_layer.cc +++ b/cc/layers/texture_layer.cc @@ -128,7 +128,7 @@ void TextureLayer::SetTextureMailboxInternal( // If we never commited the mailbox, we need to release it here. if (mailbox.IsValid()) { holder_ref_ = - TextureMailboxHolder::Create(mailbox, release_callback.Pass()); + TextureMailboxHolder::Create(mailbox, std::move(release_callback)); } else { holder_ref_ = nullptr; } @@ -150,8 +150,8 @@ void TextureLayer::SetTextureMailbox( scoped_ptr release_callback) { bool requires_commit = true; bool allow_mailbox_reuse = false; - SetTextureMailboxInternal( - mailbox, release_callback.Pass(), requires_commit, allow_mailbox_reuse); + SetTextureMailboxInternal(mailbox, std::move(release_callback), + requires_commit, allow_mailbox_reuse); } static void IgnoreReleaseCallback(const gpu::SyncToken& sync_token, bool lost) { @@ -170,8 +170,8 @@ void TextureLayer::SetTextureMailboxWithoutReleaseCallback( bool allow_mailbox_reuse = true; if (mailbox.IsValid()) release = SingleReleaseCallback::Create(base::Bind(&IgnoreReleaseCallback)); - SetTextureMailboxInternal( - mailbox, release.Pass(), requires_commit, allow_mailbox_reuse); + SetTextureMailboxInternal(mailbox, std::move(release), requires_commit, + allow_mailbox_reuse); } void TextureLayer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) { @@ -212,10 +212,8 @@ bool TextureLayer::Update() { // Already within a commit, no need to do another one immediately. bool requires_commit = false; bool allow_mailbox_reuse = false; - SetTextureMailboxInternal(mailbox, - release_callback.Pass(), - requires_commit, - allow_mailbox_reuse); + SetTextureMailboxInternal(mailbox, std::move(release_callback), + requires_commit, allow_mailbox_reuse); updated = true; } } @@ -246,7 +244,7 @@ void TextureLayer::PushPropertiesTo(LayerImpl* layer) { release_callback_impl = holder->GetCallbackForImplThread(); } texture_layer->SetTextureMailbox(texture_mailbox, - release_callback_impl.Pass()); + std::move(release_callback_impl)); needs_set_mailbox_ = false; } } @@ -267,7 +265,7 @@ TextureLayer::TextureMailboxHolder::TextureMailboxHolder( scoped_ptr release_callback) : internal_references_(0), mailbox_(mailbox), - release_callback_(release_callback.Pass()), + release_callback_(std::move(release_callback)), sync_token_(mailbox.sync_token()), is_lost_(false) {} @@ -280,7 +278,7 @@ TextureLayer::TextureMailboxHolder::Create( const TextureMailbox& mailbox, scoped_ptr release_callback) { return make_scoped_ptr(new MainThreadReference( - new TextureMailboxHolder(mailbox, release_callback.Pass()))); + new TextureMailboxHolder(mailbox, std::move(release_callback)))); } void TextureLayer::TextureMailboxHolder::Return( diff --git a/cc/layers/texture_layer_impl.cc b/cc/layers/texture_layer_impl.cc index 8433df24e796ec..295faf416addfa 100644 --- a/cc/layers/texture_layer_impl.cc +++ b/cc/layers/texture_layer_impl.cc @@ -42,7 +42,7 @@ void TextureLayerImpl::SetTextureMailbox( DCHECK_EQ(mailbox.IsValid(), !!release_callback); FreeTextureMailbox(); texture_mailbox_ = mailbox; - release_callback_ = release_callback.Pass(); + release_callback_ = std::move(release_callback); own_mailbox_ = true; valid_texture_copy_ = false; SetNeedsPushProperties(); @@ -66,7 +66,7 @@ void TextureLayerImpl::PushPropertiesTo(LayerImpl* layer) { texture_layer->SetNearestNeighbor(nearest_neighbor_); if (own_mailbox_) { texture_layer->SetTextureMailbox(texture_mailbox_, - release_callback_.Pass()); + std::move(release_callback_)); own_mailbox_ = false; } } @@ -83,7 +83,7 @@ bool TextureLayerImpl::WillDraw(DrawMode draw_mode, texture_mailbox_.IsSharedMemory())) { external_texture_resource_ = resource_provider->CreateResourceFromTextureMailbox( - texture_mailbox_, release_callback_.Pass()); + texture_mailbox_, std::move(release_callback_)); DCHECK(external_texture_resource_); texture_copy_ = nullptr; valid_texture_copy_ = false; diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index a04ff66ab19021..84ee9d2a1e824e 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc @@ -92,7 +92,7 @@ class FakeTextureLayerClient : public TextureLayerClient { return false; *mailbox = mailbox_; - *release_callback = release_callback_.Pass(); + *release_callback = std::move(release_callback_); mailbox_changed_ = false; return true; } @@ -100,7 +100,7 @@ class FakeTextureLayerClient : public TextureLayerClient { void set_mailbox(const TextureMailbox& mailbox, scoped_ptr release_callback) { mailbox_ = mailbox; - release_callback_ = release_callback.Pass(); + release_callback_ = std::move(release_callback); mailbox_changed_ = true; } @@ -648,7 +648,7 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { base::Unretained(this))); layer_->SetTextureMailbox(TextureMailbox(MailboxFromChar(mailbox_char), gpu::SyncToken(), GL_TEXTURE_2D), - callback.Pass()); + std::move(callback)); } void BeginTest() override { @@ -764,7 +764,7 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { &TextureLayerMailboxIsActivatedDuringCommit::ReleaseCallback)); layer_->SetTextureMailbox(TextureMailbox(MailboxFromChar(mailbox_char), gpu::SyncToken(), GL_TEXTURE_2D), - callback.Pass()); + std::move(callback)); } void BeginTest() override { @@ -1352,7 +1352,7 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { base::Unretained(this))); layer_->SetTextureMailbox(TextureMailbox(MailboxFromChar(mailbox_char), gpu::SyncToken(), GL_TEXTURE_2D), - callback.Pass()); + std::move(callback)); } void SetupTree() override { @@ -1421,7 +1421,7 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { base::Unretained(this))); layer_->SetTextureMailbox(TextureMailbox(MailboxFromChar(mailbox_char), gpu::SyncToken(), GL_TEXTURE_2D), - callback.Pass()); + std::move(callback)); } void SetupTree() override { diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc index ee351e36df5ad9..c1f9a2efaf362b 100644 --- a/cc/layers/ui_resource_layer_impl_unittest.cc +++ b/cc/layers/ui_resource_layer_impl_unittest.cc @@ -41,7 +41,7 @@ scoped_ptr GenerateUIResourceLayer( host_impl->CreateUIResource(uid, bitmap); layer->SetUIResourceId(uid); - return layer.Pass(); + return layer; } void QuadSizeTest(scoped_ptr layer, @@ -77,7 +77,7 @@ TEST(UIResourceLayerImplTest, VerifyDrawQuads) { layer_size, opaque, uid); - QuadSizeTest(layer.Pass(), expected_quad_size); + QuadSizeTest(std::move(layer), expected_quad_size); // Make sure we're not appending quads when there are invalid values. expected_quad_size = 0; @@ -87,7 +87,7 @@ TEST(UIResourceLayerImplTest, VerifyDrawQuads) { layer_size, opaque, uid); - QuadSizeTest(layer.Pass(), expected_quad_size); + QuadSizeTest(std::move(layer), expected_quad_size); } void OpaqueBoundsTest(scoped_ptr layer, @@ -124,7 +124,7 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { opaque, uid); gfx::Rect expected_opaque_bounds; - OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); + OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); opaque = true; layer = GenerateUIResourceLayer(&host_impl, @@ -133,7 +133,7 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { opaque, uid); expected_opaque_bounds = gfx::Rect(layer->bounds()); - OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); + OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); } TEST(UIResourceLayerImplTest, VerifySetOpaqueOnLayer) { @@ -154,13 +154,13 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnLayer) { &host_impl, bitmap_size, layer_size, skbitmap_opaque, uid); layer->SetContentsOpaque(false); gfx::Rect expected_opaque_bounds; - OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); + OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); layer = GenerateUIResourceLayer( &host_impl, bitmap_size, layer_size, skbitmap_opaque, uid); layer->SetContentsOpaque(true); expected_opaque_bounds = gfx::Rect(layer->bounds()); - OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); + OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); } TEST(UIResourceLayerImplTest, Occlusion) { diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc index cae00aacf1d02f..49d6490d7d1db7 100644 --- a/cc/layers/video_layer.cc +++ b/cc/layers/video_layer.cc @@ -25,9 +25,7 @@ VideoLayer::VideoLayer(const LayerSettings& settings, VideoLayer::~VideoLayer() {} scoped_ptr VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { - scoped_ptr impl = - VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_); - return impl.Pass(); + return VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_); } bool VideoLayer::Update() { diff --git a/cc/layers/video_layer_impl_unittest.cc b/cc/layers/video_layer_impl_unittest.cc index 6efe46defdf9b0..f8458d9b54f99a 100644 --- a/cc/layers/video_layer_impl_unittest.cc +++ b/cc/layers/video_layer_impl_unittest.cc @@ -105,8 +105,8 @@ TEST(VideoLayerImplTest, OccludesOtherLayers) { video_layer_impl->SetDrawsContent(true); video_layer_impl->SetContentsOpaque(true); - layer_impl->AddChild(video_layer_impl.Pass()); - active_tree->SetRootLayer(layer_impl.Pass()); + layer_impl->AddChild(std::move(video_layer_impl)); + active_tree->SetRootLayer(std::move(layer_impl)); active_tree->BuildPropertyTreesForTesting(); diff --git a/cc/output/bsp_tree.cc b/cc/output/bsp_tree.cc index f24e99bb3b35e5..6f0b99ea204b23 100644 --- a/cc/output/bsp_tree.cc +++ b/cc/output/bsp_tree.cc @@ -13,8 +13,7 @@ namespace cc { -BspNode::BspNode(scoped_ptr data) : node_data(data.Pass()) { -} +BspNode::BspNode(scoped_ptr data) : node_data(std::move(data)) {} BspNode::~BspNode() { } @@ -69,8 +68,8 @@ void BspTree::BuildTree(BspNode* node, if (!split_result) { break; } - front_list.push_back(new_front.Pass()); - back_list.push_back(new_back.Pass()); + front_list.push_back(std::move(new_front)); + back_list.push_back(std::move(new_back)); break; } case BSP_COPLANAR_FRONT: diff --git a/cc/output/bsp_tree_unittest.cc b/cc/output/bsp_tree_unittest.cc index 1e34ea14bee424..f55577be8f581d 100644 --- a/cc/output/bsp_tree_unittest.cc +++ b/cc/output/bsp_tree_unittest.cc @@ -114,9 +114,9 @@ TEST(BspTreeTest, NoSplit) { CREATE_DRAW_POLYGON(vertices_c, gfx::Vector3dF(0.0f, 0.0f, 1.0f), 2)); std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); - polygon_list.push_back(polygon_c.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); + polygon_list.push_back(std::move(polygon_c)); int compare_ids[] = {1, 0, 2}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -142,8 +142,8 @@ TEST(BspTreeTest, BasicSplit) { CREATE_DRAW_POLYGON(vertices_b, gfx::Vector3dF(-1.0f, 0.0f, 0.0f), 1)); std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); int compare_ids[] = {1, 0, 1}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -171,8 +171,8 @@ TEST(BspTreeTest, QuadOffset) { CREATE_DRAW_POLYGON(vertices_b, gfx::Vector3dF(-1.0f, 0.0f, 0.0f), 1)); std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); int compare_ids[] = {1, 0}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -200,8 +200,8 @@ TEST(BspTreeTest, QuadOffsetSplit) { CREATE_DRAW_POLYGON(vertices_b, gfx::Vector3dF(-1.0f, 0.0f, 0.0f), 1)); std::deque> polygon_list; - polygon_list.push_back(polygon_b.Pass()); - polygon_list.push_back(polygon_a.Pass()); + polygon_list.push_back(std::move(polygon_b)); + polygon_list.push_back(std::move(polygon_a)); int compare_ids[] = {0, 1, 0}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -236,9 +236,9 @@ TEST(BspTreeTest, ThreeWaySplit) { CREATE_DRAW_POLYGON(vertices_c, gfx::Vector3dF(0.0f, 1.0f, 0.0f), 2)); std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); - polygon_list.push_back(polygon_c.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); + polygon_list.push_back(std::move(polygon_c)); int compare_ids[] = {2, 1, 2, 0, 2, 1, 2}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -277,9 +277,9 @@ TEST(BspTreeTest, Coplanar) { { std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); - polygon_list.push_back(polygon_c.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); + polygon_list.push_back(std::move(polygon_c)); int compare_ids[] = {0, 1, 2}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -289,9 +289,9 @@ TEST(BspTreeTest, Coplanar) { // Now check a different order and ensure we get that back as well { std::deque> polygon_list; - polygon_list.push_back(polygon_f.Pass()); - polygon_list.push_back(polygon_d.Pass()); - polygon_list.push_back(polygon_e.Pass()); + polygon_list.push_back(std::move(polygon_f)); + polygon_list.push_back(std::move(polygon_d)); + polygon_list.push_back(std::move(polygon_e)); int compare_ids[] = {0, 1, 2}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); @@ -334,10 +334,10 @@ TEST(BspTreeTest, CoplanarSplit) { CREATE_DRAW_POLYGON(vertices_d, gfx::Vector3dF(-1.0f, 0.0f, 0.0f), 3)); std::deque> polygon_list; - polygon_list.push_back(polygon_a.Pass()); - polygon_list.push_back(polygon_b.Pass()); - polygon_list.push_back(polygon_c.Pass()); - polygon_list.push_back(polygon_d.Pass()); + polygon_list.push_back(std::move(polygon_a)); + polygon_list.push_back(std::move(polygon_b)); + polygon_list.push_back(std::move(polygon_c)); + polygon_list.push_back(std::move(polygon_d)); int compare_ids[] = {3, 0, 1, 2, 3}; std::vector compare_list = INT_VECTOR_FROM_ARRAY(compare_ids); diff --git a/cc/output/compositor_frame.cc b/cc/output/compositor_frame.cc index e612b28cfad3e3..f096a387b5cc82 100644 --- a/cc/output/compositor_frame.cc +++ b/cc/output/compositor_frame.cc @@ -11,8 +11,8 @@ CompositorFrame::CompositorFrame() {} CompositorFrame::~CompositorFrame() {} void CompositorFrame::AssignTo(CompositorFrame* target) { - target->delegated_frame_data = delegated_frame_data.Pass(); - target->gl_frame_data = gl_frame_data.Pass(); + target->delegated_frame_data = std::move(delegated_frame_data); + target->gl_frame_data = std::move(gl_frame_data); target->metadata = metadata; } diff --git a/cc/output/copy_output_request.cc b/cc/output/copy_output_request.cc index fce92a322162b0..7077457b4fd081 100644 --- a/cc/output/copy_output_request.cc +++ b/cc/output/copy_output_request.cc @@ -24,7 +24,7 @@ scoped_ptr CopyOutputRequest::CreateRelayRequest( relay->area_ = original_request.area_; relay->has_texture_mailbox_ = original_request.has_texture_mailbox_; relay->texture_mailbox_ = original_request.texture_mailbox_; - return relay.Pass(); + return relay; } CopyOutputRequest::CopyOutputRequest() @@ -52,7 +52,7 @@ CopyOutputRequest::~CopyOutputRequest() { void CopyOutputRequest::SendResult(scoped_ptr result) { bool success = !result->IsEmpty(); - base::ResetAndReturn(&result_callback_).Run(result.Pass()); + base::ResetAndReturn(&result_callback_).Run(std::move(result)); TRACE_EVENT_ASYNC_END1("cc", "CopyOutputRequest", this, "success", success); } @@ -61,7 +61,7 @@ void CopyOutputRequest::SendEmptyResult() { } void CopyOutputRequest::SendBitmapResult(scoped_ptr bitmap) { - SendResult(CopyOutputResult::CreateBitmapResult(bitmap.Pass()).Pass()); + SendResult(CopyOutputResult::CreateBitmapResult(std::move(bitmap)).Pass()); } void CopyOutputRequest::SendTextureResult( @@ -70,7 +70,7 @@ void CopyOutputRequest::SendTextureResult( scoped_ptr release_callback) { DCHECK(texture_mailbox.IsTexture()); SendResult(CopyOutputResult::CreateTextureResult( - size, texture_mailbox, release_callback.Pass())); + size, texture_mailbox, std::move(release_callback))); } void CopyOutputRequest::SetTextureMailbox( diff --git a/cc/output/copy_output_result.cc b/cc/output/copy_output_result.cc index 704aa9ab5e33b9..84e9ef834208a6 100644 --- a/cc/output/copy_output_result.cc +++ b/cc/output/copy_output_result.cc @@ -13,8 +13,7 @@ namespace cc { CopyOutputResult::CopyOutputResult() {} CopyOutputResult::CopyOutputResult(scoped_ptr bitmap) - : size_(bitmap->width(), bitmap->height()), - bitmap_(bitmap.Pass()) { + : size_(bitmap->width(), bitmap->height()), bitmap_(std::move(bitmap)) { DCHECK(bitmap_); } @@ -24,7 +23,7 @@ CopyOutputResult::CopyOutputResult( scoped_ptr release_callback) : size_(size), texture_mailbox_(texture_mailbox), - release_callback_(release_callback.Pass()) { + release_callback_(std::move(release_callback)) { DCHECK(texture_mailbox_.IsTexture()); } @@ -34,14 +33,14 @@ CopyOutputResult::~CopyOutputResult() { } scoped_ptr CopyOutputResult::TakeBitmap() { - return bitmap_.Pass(); + return std::move(bitmap_); } void CopyOutputResult::TakeTexture( TextureMailbox* texture_mailbox, scoped_ptr* release_callback) { *texture_mailbox = texture_mailbox_; - *release_callback = release_callback_.Pass(); + *release_callback = std::move(release_callback_); texture_mailbox_ = TextureMailbox(); } diff --git a/cc/output/copy_output_result.h b/cc/output/copy_output_result.h index 3662818ef4118a..57f0cca66effcf 100644 --- a/cc/output/copy_output_result.h +++ b/cc/output/copy_output_result.h @@ -23,14 +23,14 @@ class CC_EXPORT CopyOutputResult { } static scoped_ptr CreateBitmapResult( scoped_ptr bitmap) { - return make_scoped_ptr(new CopyOutputResult(bitmap.Pass())); + return make_scoped_ptr(new CopyOutputResult(std::move(bitmap))); } static scoped_ptr CreateTextureResult( const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr release_callback) { - return make_scoped_ptr( - new CopyOutputResult(size, texture_mailbox, release_callback.Pass())); + return make_scoped_ptr(new CopyOutputResult(size, texture_mailbox, + std::move(release_callback))); } ~CopyOutputResult(); diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc index a8fbbb70cde70c..0a7d91cd5d7a59 100644 --- a/cc/output/delegating_renderer.cc +++ b/cc/output/delegating_renderer.cc @@ -96,7 +96,7 @@ void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); CompositorFrame compositor_frame; compositor_frame.metadata = metadata; - compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); + compositor_frame.delegated_frame_data = std::move(delegated_frame_data_); output_surface_->SwapBuffers(&compositor_frame); } diff --git a/cc/output/delegating_renderer_unittest.cc b/cc/output/delegating_renderer_unittest.cc index ee817ef6c0dbe4..df06696079a013 100644 --- a/cc/output/delegating_renderer_unittest.cc +++ b/cc/output/delegating_renderer_unittest.cc @@ -20,7 +20,7 @@ class DelegatingRendererTest : public LayerTreeTest { scoped_ptr output_surface = FakeOutputSurface::CreateDelegating3d(); output_surface_ = output_surface.get(); - return output_surface.Pass(); + return std::move(output_surface); } protected: diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index 9ec397f434f74a..534b97e15b24f5 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc @@ -183,7 +183,7 @@ void DirectRenderer::DecideRenderPassAllocationsForFrame( scoped_ptr texture = ScopedResource::Create(resource_provider_); render_pass_textures_.set(render_passes_in_draw_order[i]->id, - texture.Pass()); + std::move(texture)); } } } @@ -512,7 +512,7 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame, *it, gfx::RectF(quad.visible_rect), quad.shared_quad_state->quad_to_target_transform, next_polygon_id++)); if (new_polygon->points().size() > 2u) { - poly_list.push_back(new_polygon.Pass()); + poly_list.push_back(std::move(new_polygon)); } continue; } diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 2b1b1f28725c55..280b5544b80e87 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -847,7 +847,7 @@ scoped_ptr GLRenderer::GetBackdropTexture( device_background_texture->id()); GetFramebufferTexture(lock.texture_id(), RGBA_8888, bounding_rect); } - return device_background_texture.Pass(); + return device_background_texture; } skia::RefPtr GLRenderer::ApplyBackgroundFilters( @@ -2444,7 +2444,7 @@ void GLRenderer::FinishDrawingFrame(DrawingFrame* frame) { if (use_sync_query_) { DCHECK(current_sync_query_); current_sync_query_->End(); - pending_sync_queries_.push_back(current_sync_query_.Pass()); + pending_sync_queries_.push_back(std::move(current_sync_query_)); } current_framebuffer_lock_ = nullptr; @@ -2497,7 +2497,7 @@ void GLRenderer::CopyCurrentRenderPassToBitmap( gfx::Rect copy_rect = frame->current_render_pass->output_rect; if (request->has_area()) copy_rect.Intersect(request->area()); - GetFramebufferPixelsAsync(frame, copy_rect, request.Pass()); + GetFramebufferPixelsAsync(frame, copy_rect, std::move(request)); } void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { @@ -2726,17 +2726,17 @@ void GLRenderer::GetFramebufferPixelsAsync( gl_->DeleteTextures(1, &texture_id); } - request->SendTextureResult( - window_rect.size(), texture_mailbox, release_callback.Pass()); + request->SendTextureResult(window_rect.size(), texture_mailbox, + std::move(release_callback)); return; } DCHECK(request->force_bitmap_result()); scoped_ptr pending_read(new PendingAsyncReadPixels); - pending_read->copy_request = request.Pass(); + pending_read->copy_request = std::move(request); pending_async_read_pixels_.insert(pending_async_read_pixels_.begin(), - pending_read.Pass()); + std::move(pending_read)); bool do_workaround = NeedsIOSurfaceReadbackWorkaround(); @@ -2876,7 +2876,7 @@ void GLRenderer::FinishedReadback(unsigned source_buffer, } if (bitmap) - current_read->copy_request->SendBitmapResult(bitmap.Pass()); + current_read->copy_request->SendBitmapResult(std::move(bitmap)); // Conversion from reverse iterator to iterator: // Iterator |iter.base() - 1| points to the same element with reverse iterator diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index 2140f54f9477bd..10095e95cd87fd 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -733,7 +733,7 @@ TEST_F(GLRendererTest, OpaqueBackground) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -778,7 +778,7 @@ TEST_F(GLRendererTest, TransparentBackground) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -816,7 +816,7 @@ TEST_F(GLRendererTest, OffscreenOutputSurface) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::CreateOffscreen(context_owned.Pass())); + FakeOutputSurface::CreateOffscreen(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -887,7 +887,7 @@ TEST_F(GLRendererTest, VisibilityChangeIsLastCall) { VisibilityChangeIsLastCallTrackingContext* context = context_owned.get(); scoped_refptr provider = - TestContextProvider::Create(context_owned.Pass()); + TestContextProvider::Create(std::move(context_owned)); provider->support()->SetSurfaceVisibleCallback(base::Bind( &VisibilityChangeIsLastCallTrackingContext::set_last_call_was_visibility, @@ -960,7 +960,7 @@ TEST_F(GLRendererTest, ActiveTextureState) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -1046,7 +1046,7 @@ TEST_F(GLRendererTest, ShouldClearRootRenderPass) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(mock_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(mock_context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -1137,7 +1137,7 @@ TEST_F(GLRendererTest, ScissorTestWhenClearing) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -1210,7 +1210,7 @@ class NonReshapableOutputSurface : public FakeOutputSurface { public: explicit NonReshapableOutputSurface( scoped_ptr context3d) - : FakeOutputSurface(TestContextProvider::Create(context3d.Pass()), + : FakeOutputSurface(TestContextProvider::Create(std::move(context3d)), false) { surface_size_ = gfx::Size(500, 500); } @@ -1224,7 +1224,7 @@ TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - new NonReshapableOutputSurface(context_owned.Pass())); + new NonReshapableOutputSurface(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); output_surface->set_fixed_size(gfx::Size(100, 100)); @@ -1384,7 +1384,7 @@ TEST_F(GLRendererTest, ScissorAndViewportWithinNonreshapableSurface) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - new NonReshapableOutputSurface(context_owned.Pass())); + new NonReshapableOutputSurface(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -2069,7 +2069,7 @@ TEST_F(GLRendererTest, DontOverlayWithCopyRequests) { scoped_ptr context_owned(new DiscardCheckingContext); FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( @@ -2106,7 +2106,7 @@ TEST_F(GLRendererTest, DontOverlayWithCopyRequests) { scoped_ptr release_callback = SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); ResourceId resource_id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, release_callback.Pass()); + mailbox, std::move(release_callback)); bool premultiplied_alpha = false; bool flipped = false; bool nearest_neighbor = false; @@ -2222,7 +2222,7 @@ TEST_F(GLRendererTest, OverlaySyncTokensAreProcessed) { MockOverlayScheduler overlay_scheduler; scoped_refptr context_provider = - TestContextProvider::Create(context_owned.Pass()); + TestContextProvider::Create(std::move(context_owned)); context_provider->support()->SetScheduleOverlayPlaneCallback(base::Bind( &MockOverlayScheduler::Schedule, base::Unretained(&overlay_scheduler))); @@ -2261,7 +2261,7 @@ TEST_F(GLRendererTest, OverlaySyncTokensAreProcessed) { scoped_ptr release_callback = SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); ResourceId resource_id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, release_callback.Pass()); + mailbox, std::move(release_callback)); bool premultiplied_alpha = false; bool flipped = false; bool nearest_neighbor = false; diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index d41c1958bd53cf..3430d18112814b 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -122,7 +122,7 @@ OutputSurface::OutputSurface( : client_(NULL), context_provider_(context_provider), worker_context_provider_(worker_context_provider), - software_device_(software_device.Pass()), + software_device_(std::move(software_device)), device_scale_factor_(-1), external_stencil_test_enabled_(false), weak_ptr_factory_(this) { @@ -141,14 +141,12 @@ OutputSurface::OutputSurface( } OutputSurface::OutputSurface(scoped_ptr software_device) - : OutputSurface(nullptr, nullptr, software_device.Pass()) { -} + : OutputSurface(nullptr, nullptr, std::move(software_device)) {} OutputSurface::OutputSurface( const scoped_refptr& context_provider, scoped_ptr software_device) - : OutputSurface(context_provider, nullptr, software_device.Pass()) { -} + : OutputSurface(context_provider, nullptr, std::move(software_device)) {} void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval) { diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc index b09ead46493f9e..36848522ea5bba 100644 --- a/cc/output/output_surface_unittest.cc +++ b/cc/output/output_surface_unittest.cc @@ -29,11 +29,11 @@ class TestOutputSurface : public OutputSurface { : OutputSurface(worker_context_provider) {} explicit TestOutputSurface(scoped_ptr software_device) - : OutputSurface(software_device.Pass()) {} + : OutputSurface(std::move(software_device)) {} TestOutputSurface(scoped_refptr context_provider, scoped_ptr software_device) - : OutputSurface(context_provider, software_device.Pass()) {} + : OutputSurface(context_provider, std::move(software_device)) {} void SwapBuffers(CompositorFrame* frame) override { client_->DidSwapBuffers(); diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc index 444aecffc680d5..a170cf93754652 100644 --- a/cc/output/overlay_unittest.cc +++ b/cc/output/overlay_unittest.cc @@ -194,7 +194,7 @@ scoped_ptr CreateRenderPass() { SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); shared_state->opacity = 1.f; - return pass.Pass(); + return pass; } ResourceId CreateResource(ResourceProvider* resource_provider, @@ -207,7 +207,7 @@ ResourceId CreateResource(ResourceProvider* resource_provider, SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); return resource_provider->CreateResourceFromTextureMailbox( - mailbox, release_callback.Pass()); + mailbox, std::move(release_callback)); } SolidColorDrawQuad* CreateSolidColorQuadAt( @@ -408,7 +408,7 @@ TEST_F(SandwichTest, SuccessfulSingleOverlay) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -450,7 +450,7 @@ TEST_F(SandwichTest, CroppedSingleOverlay) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -481,7 +481,7 @@ TEST_F(SandwichTest, SuccessfulTwoOverlays) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -515,7 +515,7 @@ TEST_F(SandwichTest, OverlappingOverlays) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -548,7 +548,7 @@ TEST_F(SandwichTest, SuccessfulSandwichOverlay) { gfx::Rect(kDisplaySize)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -601,7 +601,7 @@ TEST_F(SandwichTest, MultiQuadOverlay) { gfx::Rect(kDisplaySize)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Run the overlay strategy on that input. RenderPass* main_pass = pass_list.back().get(); @@ -655,7 +655,7 @@ TEST_F(SandwichTest, DamageRect) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -688,7 +688,7 @@ TEST_F(SingleOverlayOnTopTest, SuccessfullOverlay) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -726,7 +726,7 @@ TEST_F(SingleOverlayOnTopTest, DamageRect) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -752,7 +752,7 @@ TEST_F(SingleOverlayOnTopTest, NoCandidates) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -777,7 +777,7 @@ TEST_F(SingleOverlayOnTopTest, OccludedCandidates) { pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -806,7 +806,7 @@ TEST_F(SingleOverlayOnTopTest, MultipleRenderPasses) { CreateFullscreenOpaqueQuad(resource_provider_.get(), pass->shared_quad_state_list.back(), pass.get()); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -830,7 +830,7 @@ TEST_F(SingleOverlayOnTopTest, RejectPremultipliedAlpha) { quad->premultiplied_alpha = true; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -847,7 +847,7 @@ TEST_F(SingleOverlayOnTopTest, RejectBlending) { quad->needs_blending = true; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -864,7 +864,7 @@ TEST_F(SingleOverlayOnTopTest, RejectBackgroundColor) { quad->background_color = SK_ColorBLACK; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -880,7 +880,7 @@ TEST_F(SingleOverlayOnTopTest, RejectBlendMode) { pass->shared_quad_state_list.back()->blend_mode = SkXfermode::kScreen_Mode; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -896,7 +896,7 @@ TEST_F(SingleOverlayOnTopTest, RejectOpacity) { pass->shared_quad_state_list.back()->opacity = 0.5f; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -913,7 +913,7 @@ TEST_F(SingleOverlayOnTopTest, RejectNonAxisAlignedTransform) { ->quad_to_target_transform.RotateAboutXAxis(45.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -930,7 +930,7 @@ TEST_F(SingleOverlayOnTopTest, AllowClipped) { pass->shared_quad_state_list.back()->clip_rect = kOverlayClipRect; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -949,7 +949,7 @@ TEST_F(SingleOverlayOnTopTest, AllowVerticalFlip) { -1.0f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -970,7 +970,7 @@ TEST_F(SingleOverlayOnTopTest, AllowHorizontalFlip) { 2.0f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -990,7 +990,7 @@ TEST_F(SingleOverlayOnTopTest, AllowPositiveScaleTransform) { 1.0f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1008,7 +1008,7 @@ TEST_F(SingleOverlayOnTopTest, Allow90DegreeRotation) { ->quad_to_target_transform.RotateAboutZAxis(90.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1027,7 +1027,7 @@ TEST_F(SingleOverlayOnTopTest, Allow180DegreeRotation) { ->quad_to_target_transform.RotateAboutZAxis(180.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1046,7 +1046,7 @@ TEST_F(SingleOverlayOnTopTest, Allow270DegreeRotation) { ->quad_to_target_transform.RotateAboutZAxis(270.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1066,7 +1066,7 @@ TEST_F(SingleOverlayOnTopTest, AllowNotTopIfNotOccluded) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -1090,7 +1090,7 @@ TEST_F(SingleOverlayOnTopTest, AllowTransparentOnTop) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -1112,7 +1112,7 @@ TEST_F(SingleOverlayOnTopTest, AllowTransparentColorOnTop) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -1136,7 +1136,7 @@ TEST_F(SingleOverlayOnTopTest, RejectOpaqueColorOnTop) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -1158,7 +1158,7 @@ TEST_F(SingleOverlayOnTopTest, RejectTransparentColorOnTopWithoutBlending) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); RenderPassList original_pass_list; RenderPass::CopyAll(pass_list, &original_pass_list); @@ -1177,7 +1177,7 @@ TEST_F(SingleOverlayOnTopTest, RejectVideoSwapTransform) { pass.get(), kSwapTransform); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1192,7 +1192,7 @@ TEST_F(SingleOverlayOnTopTest, AllowVideoXMirrorTransform) { pass.get(), kXMirrorTransform); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1207,7 +1207,7 @@ TEST_F(SingleOverlayOnTopTest, AllowVideoBothMirrorTransform) { pass.get(), kBothMirrorTransform); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1222,7 +1222,7 @@ TEST_F(SingleOverlayOnTopTest, AllowVideoNormalTransform) { pass.get(), kNormalTransform); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1237,7 +1237,7 @@ TEST_F(SingleOverlayOnTopTest, AllowVideoYMirrorTransform) { pass.get(), kYMirrorTransform); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, &candidate_list, &damage_rect_); @@ -1254,7 +1254,7 @@ TEST_F(UnderlayTest, OverlayLayerUnderMainLayer) { kOverlayBottomRightRect); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, @@ -1277,7 +1277,7 @@ TEST_F(UnderlayTest, AllowOnTop) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); OverlayCandidateList candidate_list; overlay_processor_->ProcessForOverlays(resource_provider_.get(), &pass_list, @@ -1304,7 +1304,7 @@ TEST_F(UnderlayTest, DamageRect) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Check for potential candidates. OverlayCandidateList candidate_list; @@ -1343,7 +1343,7 @@ TEST_F(CALayerOverlayTest, AllowNonAxisAlignedTransform) { ->quad_to_target_transform.RotateAboutZAxis(45.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1364,7 +1364,7 @@ TEST_F(CALayerOverlayTest, Disallow3DTransform) { ->quad_to_target_transform.RotateAboutXAxis(45.f); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1385,7 +1385,7 @@ TEST_F(CALayerOverlayTest, AllowContainingClip) { pass->shared_quad_state_list.back()->clip_rect = kOverlayRect; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1407,7 +1407,7 @@ TEST_F(CALayerOverlayTest, SkipDisjointClip) { gfx::Rect(128, 128, 128, 128); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1428,7 +1428,7 @@ TEST_F(CALayerOverlayTest, DisallowNontrivialClip) { pass->shared_quad_state_list.back()->clip_rect = gfx::Rect(64, 64, 128, 128); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1449,7 +1449,7 @@ TEST_F(CALayerOverlayTest, SkipTransparent) { pass->shared_quad_state_list.back()->opacity = 0; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); CALayerOverlayList ca_layer_list; OverlayCandidateList overlay_list( BackbufferOverlayList(pass_list.back().get())); @@ -1571,7 +1571,7 @@ TEST_F(GLRendererWithOverlaysTest, OverlayQuadNotDrawn) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Candidate pass was taken out and extra skipped pass added, // so only draw 2 quads. @@ -1610,7 +1610,7 @@ TEST_F(GLRendererWithOverlaysTest, OccludedQuadInUnderlay) { pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Candidate quad should fail to be overlaid on top because of occlusion. // Expect to be replaced with transparent hole quad and placed in underlay. @@ -1649,7 +1649,7 @@ TEST_F(GLRendererWithOverlaysTest, NoValidatorNoOverlay) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Should not see the primary surface's overlay. output_surface_->set_is_displayed_as_overlay_plane(false); @@ -1679,7 +1679,7 @@ TEST_F(GLRendererWithOverlaysTest, OccludedQuadNotDrawn) { pass->shared_quad_state_list.back(), pass.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); output_surface_->set_is_displayed_as_overlay_plane(true); EXPECT_CALL(*renderer_, DoDrawQuad(_, _, _)).Times(0); @@ -1704,7 +1704,7 @@ TEST_F(GLRendererWithOverlaysTest, ResourcesExportedAndReturnedWithDelay) { scoped_ptr pass = CreateRenderPass(); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); DirectRenderer::DrawingFrame frame1; frame1.render_passes_in_draw_order = &pass_list; diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc index 6f337c3d4badfc..110f9fe286f365 100644 --- a/cc/output/renderer_pixeltest.cc +++ b/cc/output/renderer_pixeltest.cc @@ -34,7 +34,7 @@ scoped_ptr CreateTestRootRenderPass(RenderPassId id, const gfx::Rect damage_rect = rect; const gfx::Transform transform_to_root_target; pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); - return pass.Pass(); + return pass; } scoped_ptr CreateTestRenderPass( @@ -45,7 +45,7 @@ scoped_ptr CreateTestRenderPass( const gfx::Rect output_rect = rect; const gfx::Rect damage_rect = rect; pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); - return pass.Pass(); + return pass; } SharedQuadState* CreateTestSharedQuadState( @@ -478,7 +478,7 @@ TYPED_TEST(RendererPixelTest, SimpleGreenRect) { color_quad->SetNew(shared_state, rect, rect, SK_ColorGREEN, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -514,8 +514,8 @@ TYPED_TEST(RendererPixelTest, SimpleGreenRect_NonRootRenderPass) { RenderPass* child_pass_ptr = child_pass.get(); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); EXPECT_TRUE(this->RunPixelTestWithReadbackTarget( &pass_list, @@ -546,7 +546,7 @@ TYPED_TEST(RendererPixelTest, PremultipliedTextureWithoutBackground) { color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -579,7 +579,7 @@ TYPED_TEST(RendererPixelTest, PremultipliedTextureWithBackground) { color_quad->SetNew(color_quad_state, rect, rect, SK_ColorWHITE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -647,7 +647,7 @@ class IntersectingQuadPixelTest : public RendererPixelTest { render_pass_->CreateAndAppendDrawQuad(); background_quad->SetNew(background_quad_state, viewport_rect_, viewport_rect_, SK_ColorWHITE, false); - pass_list_.push_back(render_pass_.Pass()); + pass_list_.push_back(std::move(render_pass_)); const base::FilePath::CharType* fileName = IntersectingQuadImage(); EXPECT_TRUE( this->RunPixelTest(&pass_list_, base::FilePath(fileName), comparator)); @@ -830,8 +830,8 @@ TYPED_TEST(IntersectingQuadPixelTest, RenderPassQuads) { CreateTestRenderPassDrawQuad(this->back_quad_state_, this->quad_rect_, child_pass_id2, this->render_pass_.get()); - this->pass_list_.push_back(child_pass1.Pass()); - this->pass_list_.push_back(child_pass2.Pass()); + this->pass_list_.push_back(std::move(child_pass1)); + this->pass_list_.push_back(std::move(child_pass2)); SCOPED_TRACE("IntersectingRenderQuadsPass"); this->template AppendBackgroundAndRunTest( FuzzyPixelComparator(false, 2.f, 0.f, 256.f, 256, 0.f)); @@ -887,7 +887,7 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithoutBackground) { color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -921,7 +921,7 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBackground) { color_quad->SetNew(color_quad_state, rect, rect, SK_ColorWHITE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -965,7 +965,7 @@ class VideoGLRendererPixelTest : public GLRendererPixelTest { background_size, gfx::Rect(background_size), 128, 128, 128, green_rect, 149, 43, 21, pass.get(), video_resource_updater_.get(), resource_provider_.get()); - pass_list->push_back(pass.Pass()); + pass_list->push_back(std::move(pass)); } void SetUp() override { @@ -992,7 +992,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) { rect, rect, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE( this->RunPixelTest(&pass_list, @@ -1017,7 +1017,7 @@ TEST_F(VideoGLRendererPixelTest, ClippedYUVRect) { draw_rect, viewport, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, base::FilePath(FILE_PATH_LITERAL("yuv_stripes_clipped.png")), @@ -1040,7 +1040,7 @@ TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) { video_resource_updater_.get(), rect, rect, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1064,7 +1064,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) { video_resource_updater_.get(), rect, rect, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // If we didn't get black out of the YUV values above, then we probably have a // color range issue. @@ -1089,7 +1089,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) { video_resource_updater_.get(), rect, rect, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest(&pass_list, base::FilePath(FILE_PATH_LITERAL("green.png")), @@ -1132,7 +1132,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) { video_resource_updater_.get(), rect, rect, resource_provider_.get()); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE( this->RunPixelTest(&pass_list, @@ -1159,7 +1159,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) { color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1186,7 +1186,7 @@ TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) { color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1275,8 +1275,8 @@ TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { FilterOperations()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // This test has alpha=254 for the software renderer vs. alpha=255 for the gl // renderer so use a fuzzy comparator. @@ -1347,8 +1347,8 @@ TYPED_TEST(RendererPixelTest, FastPassSaturateFilter) { FilterOperations()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // This test blends slightly differently with the software renderer vs. the gl // renderer so use a fuzzy comparator. @@ -1419,8 +1419,8 @@ TYPED_TEST(RendererPixelTest, FastPassFilterChain) { FilterOperations()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // This test blends slightly differently with the software renderer vs. the gl // renderer so use a fuzzy comparator. @@ -1515,8 +1515,8 @@ TYPED_TEST(RendererPixelTest, FastPassColorFilterAlphaTranslation) { RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // This test has alpha=254 for the software renderer vs. alpha=255 for the gl // renderer so use a fuzzy comparator. @@ -1564,8 +1564,8 @@ TYPED_TEST(RendererPixelTest, EnlargedRenderPassTexture) { pass_shared_state, pass_rect, child_pass_id, root_pass.get()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); this->renderer_->SetEnlargePassTextureAmountForTesting(gfx::Vector2d(50, 75)); @@ -1626,8 +1626,8 @@ TYPED_TEST(RendererPixelTest, EnlargedRenderPassTextureWithAntiAliasing) { false); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); this->renderer_->SetEnlargePassTextureAmountForTesting(gfx::Vector2d(50, 75)); @@ -1723,8 +1723,8 @@ TYPED_TEST(RendererPixelTest, RenderPassAndMaskWithPartialQuad) { false); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1824,8 +1824,8 @@ class RendererPixelTestWithBackgroundFilter SK_ColorWHITE, false); - pass_list_.push_back(filter_pass.Pass()); - pass_list_.push_back(root_pass.Pass()); + pass_list_.push_back(std::move(filter_pass)); + pass_list_.push_back(std::move(root_pass)); } RenderPassList pass_list_; @@ -1906,7 +1906,7 @@ TEST_F(ExternalStencilPixelTest, StencilTestEnabled) { blue->SetNew(blue_shared_state, rect, rect, SK_ColorBLUE, false); pass->has_transparent_background = false; RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1928,7 +1928,7 @@ TEST_F(ExternalStencilPixelTest, StencilTestDisabled) { pass->CreateAndAppendDrawQuad(); green->SetNew(green_shared_state, rect, rect, SK_ColorGREEN, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1972,8 +1972,8 @@ TEST_F(ExternalStencilPixelTest, RenderSurfacesIgnoreStencil) { CreateTestRenderPassDrawQuad( pass_shared_state, pass_rect, child_pass_id, root_pass.get()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -1997,7 +1997,7 @@ TEST_F(ExternalStencilPixelTest, DeviceClip) { pass->CreateAndAppendDrawQuad(); blue->SetNew(blue_shared_state, rect, rect, SK_ColorBLUE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2038,7 +2038,7 @@ TEST_F(GLRendererPixelTest, AntiAliasing) { blue->SetNew(blue_shared_state, rect, rect, SK_ColorBLUE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2085,7 +2085,7 @@ TEST_F(GLRendererPixelTest, AxisAligned) { blue->SetNew(blue_shared_state, rect, rect, SK_ColorBLUE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2124,7 +2124,7 @@ TEST_F(GLRendererPixelTest, ForceAntiAliasingOff) { green->SetNew(green_shared_state, rect, rect, SK_ColorGREEN, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2162,7 +2162,7 @@ TEST_F(GLRendererPixelTest, AntiAliasingPerspective) { blue->SetNew(blue_shared_state, rect, rect, SK_ColorBLUE, false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2216,7 +2216,7 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadIdentityScale) { viewport, // Intentionally bigger than clip. gfx::Rect(), viewport, gfx::RectF(viewport), viewport.size(), nearest_neighbor, texture_format, viewport, - 1.f, blue_raster_source.Pass()); + 1.f, std::move(blue_raster_source)); // One viewport-filling green quad. scoped_ptr green_recording = @@ -2239,10 +2239,10 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadIdentityScale) { green_quad->SetNew(green_shared_state, viewport, gfx::Rect(), viewport, gfx::RectF(0.f, 0.f, 1.f, 1.f), viewport.size(), nearest_neighbor, texture_format, viewport, 1.f, - green_raster_source.Pass()); + std::move(green_raster_source)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2304,10 +2304,11 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadOpacity) { pass->CreateAndAppendDrawQuad(); white_quad->SetNew(white_shared_state, viewport, gfx::Rect(), viewport, gfx::RectF(0, 0, 1, 1), viewport.size(), nearest_neighbor, - texture_format, viewport, 1.f, white_raster_source.Pass()); + texture_format, viewport, 1.f, + std::move(white_raster_source)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2374,10 +2375,10 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadDisableImageFiltering) { PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad(); quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, - texture_format, viewport, 1.f, raster_source.Pass()); + texture_format, viewport, 1.f, std::move(raster_source)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); this->disable_picture_quad_image_filtering_ = true; @@ -2426,10 +2427,10 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadNearestNeighbor) { PictureDrawQuad* quad = pass->CreateAndAppendDrawQuad(); quad->SetNew(shared_state, viewport, gfx::Rect(), viewport, gfx::RectF(0, 0, 2, 2), viewport.size(), nearest_neighbor, - texture_format, viewport, 1.f, raster_source.Pass()); + texture_format, viewport, 1.f, std::move(raster_source)); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2479,7 +2480,7 @@ TYPED_TEST(RendererPixelTest, TileDrawQuadNearestNeighbor) { nearest_neighbor); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2530,7 +2531,7 @@ TYPED_TEST(SoftwareRendererPixelTest, TextureDrawQuadNearestNeighbor) { vertex_opacity, false, nearest_neighbor); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2581,7 +2582,7 @@ TYPED_TEST(SoftwareRendererPixelTest, TextureDrawQuadLinear) { vertex_opacity, false, nearest_neighbor); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Allow for a small amount of error as the blending alogrithm used by Skia is // affected by the offset in the expanded rect. @@ -2643,7 +2644,7 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadNonIdentityScale) { gfx::Rect(), green_rect2, gfx::RectF(gfx::SizeF(green_rect2.size())), green_rect2.size(), nearest_neighbor, texture_format, - green_rect2, 1.f, green_raster_source.Pass()); + green_rect2, 1.f, std::move(green_raster_source)); // Add a green clipped checkerboard in the bottom right to help test // interleaving picture quad content and solid color content. @@ -2714,7 +2715,8 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadNonIdentityScale) { blue_quad->SetNew(blue_shared_state, quad_content_rect, gfx::Rect(), quad_content_rect, gfx::RectF(quad_content_rect), content_union_rect.size(), nearest_neighbor, texture_format, - content_union_rect, contents_scale, raster_source.Pass()); + content_union_rect, contents_scale, + std::move(raster_source)); // Fill left half of viewport with green. gfx::Transform half_green_quad_to_target_transform; @@ -2730,7 +2732,7 @@ TYPED_TEST(SoftwareRendererPixelTest, PictureDrawQuadNonIdentityScale) { false); RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2780,8 +2782,8 @@ TEST_F(GLRendererPixelTestWithFlippedOutputSurface, ExplicitFlipTest) { pass_shared_state, pass_rect, child_pass_id, root_pass.get()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, @@ -2828,8 +2830,8 @@ TEST_F(GLRendererPixelTestWithFlippedOutputSurface, CheckChildPassUnflipped) { pass_shared_state, pass_rect, child_pass_id, root_pass.get()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // Check that the child pass remains unflipped. EXPECT_TRUE(this->RunPixelTestWithReadbackTarget( @@ -2877,8 +2879,8 @@ TEST_F(GLRendererPixelTest, CheckReadbackSubset) { pass_shared_state, pass_rect, child_pass_id, root_pass.get()); RenderPassList pass_list; - pass_list.push_back(child_pass.Pass()); - pass_list.push_back(root_pass.Pass()); + pass_list.push_back(std::move(child_pass)); + pass_list.push_back(std::move(root_pass)); // Check that the child pass remains unflipped. gfx::Rect capture_rect(this->device_viewport_size_.width() / 2, @@ -2965,7 +2967,7 @@ TEST_F(GLRendererPixelTest, TextureQuadBatching) { } RenderPassList pass_list; - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); EXPECT_TRUE(this->RunPixelTest( &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), diff --git a/cc/output/renderer_unittest.cc b/cc/output/renderer_unittest.cc index 48545587759588..3c8b0b8cff4787 100644 --- a/cc/output/renderer_unittest.cc +++ b/cc/output/renderer_unittest.cc @@ -42,7 +42,7 @@ void TestOutputSurface::SwapBuffers(CompositorFrame* frame) { class MockContextProvider : public TestContextProvider { public: explicit MockContextProvider(scoped_ptr context) - : TestContextProvider(context.Pass()) {} + : TestContextProvider(std::move(context)) {} MOCK_METHOD0(DeleteCachedResources, void()); protected: diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc index 8e92e8d1eae453..b333b7980f4006 100644 --- a/cc/output/software_renderer.cc +++ b/cc/output/software_renderer.cc @@ -586,7 +586,7 @@ void SoftwareRenderer::CopyCurrentRenderPassToBitmap( current_canvas_->readPixels( bitmap.get(), window_copy_rect.x(), window_copy_rect.y()); - request->SendBitmapResult(bitmap.Pass()); + request->SendBitmapResult(std::move(bitmap)); } void SoftwareRenderer::DiscardBackbuffer() { diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc index 4658b512a0fa73..12976623da7243 100644 --- a/cc/output/software_renderer_unittest.cc +++ b/cc/output/software_renderer_unittest.cc @@ -31,8 +31,8 @@ class SoftwareRendererTest : public testing::Test, public RendererClient { public: void InitializeRenderer( scoped_ptr software_output_device) { - output_surface_ = FakeOutputSurface::CreateSoftware( - software_output_device.Pass()); + output_surface_ = + FakeOutputSurface::CreateSoftware(std::move(software_output_device)); CHECK(output_surface_->BindToClient(&output_surface_client_)); shared_bitmap_manager_.reset(new TestSharedBitmapManager()); @@ -69,7 +69,7 @@ class SoftwareRendererTest : public testing::Test, public RendererClient { device_viewport_rect, false); loop.Run(); - return bitmap_result.Pass(); + return bitmap_result; } static void SaveBitmapResult(scoped_ptr* bitmap_result, @@ -123,7 +123,7 @@ TEST_F(SoftwareRendererTest, SolidColorQuad) { shared_quad_state, outer_rect, outer_rect, SK_ColorYELLOW, false); RenderPassList list; - list.push_back(root_render_pass.Pass()); + list.push_back(std::move(root_render_pass)); float device_scale_factor = 1.f; gfx::Rect device_viewport_rect(outer_size); @@ -195,7 +195,7 @@ TEST_F(SoftwareRendererTest, TileQuad) { outer_size, false, false); RenderPassList list; - list.push_back(root_render_pass.Pass()); + list.push_back(std::move(root_render_pass)); float device_scale_factor = 1.f; gfx::Rect device_viewport_rect(outer_size); @@ -257,7 +257,7 @@ TEST_F(SoftwareRendererTest, TileQuadVisibleRect) { quad->visible_rect = visible_rect; RenderPassList list; - list.push_back(root_render_pass.Pass()); + list.push_back(std::move(root_render_pass)); float device_scale_factor = 1.f; gfx::Rect device_viewport_rect(tile_size); diff --git a/cc/output/texture_mailbox_deleter.cc b/cc/output/texture_mailbox_deleter.cc index 27154c7394e047..8585938064c693 100644 --- a/cc/output/texture_mailbox_deleter.cc +++ b/cc/output/texture_mailbox_deleter.cc @@ -57,7 +57,7 @@ scoped_ptr TextureMailboxDeleter::GetReleaseCallback( context_provider, texture_id)); - impl_callbacks_.push_back(impl_callback.Pass()); + impl_callbacks_.push_back(std::move(impl_callback)); // The raw pointer to the impl-side callback is valid as long as this // class is alive. So we guard it with a WeakPtr. @@ -75,7 +75,7 @@ scoped_ptr TextureMailboxDeleter::GetReleaseCallback( main_callback = SingleReleaseCallback::Create(run_impl_callback); } - return main_callback.Pass(); + return main_callback; } void TextureMailboxDeleter::RunDeleteTextureOnImplThread( diff --git a/cc/quads/draw_polygon.cc b/cc/quads/draw_polygon.cc index fc9876e02d2d9b..b4f132a8f85ee6 100644 --- a/cc/quads/draw_polygon.cc +++ b/cc/quads/draw_polygon.cc @@ -85,7 +85,7 @@ scoped_ptr DrawPolygon::CreateCopy() { new_polygon->normal_.set_x(normal_.x()); new_polygon->normal_.set_y(normal_.y()); new_polygon->normal_.set_z(normal_.z()); - return new_polygon.Pass(); + return new_polygon; } float DrawPolygon::SignedPointDistance(const gfx::Point3F& point) const { @@ -294,11 +294,11 @@ bool DrawPolygon::Split(const DrawPolygon& splitter, DCHECK_GE(poly2->points().size(), 3u); if (SideCompare(*poly1, splitter) == BSP_FRONT) { - *front = poly1.Pass(); - *back = poly2.Pass(); + *front = std::move(poly1); + *back = std::move(poly2); } else { - *front = poly2.Pass(); - *back = poly1.Pass(); + *front = std::move(poly2); + *back = std::move(poly1); } return true; } diff --git a/cc/quads/render_pass.cc b/cc/quads/render_pass.cc index 3737f3c04ccd33..ba5806f1a1279b 100644 --- a/cc/quads/render_pass.cc +++ b/cc/quads/render_pass.cc @@ -88,7 +88,7 @@ scoped_ptr RenderPass::Copy(RenderPassId new_id) const { damage_rect, transform_to_root_target, has_transparent_background); - return copy_pass.Pass(); + return copy_pass; } // static @@ -134,7 +134,7 @@ void RenderPass::CopyAll(const std::vector>& in, copy_pass->CopyFromAndAppendDrawQuad(quad, copy_shared_quad_state); } } - out->push_back(copy_pass.Pass()); + out->push_back(std::move(copy_pass)); } } diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc index d4c0bc76b86dd3..f00c006e7e9069 100644 --- a/cc/quads/render_pass_unittest.cc +++ b/cc/quads/render_pass_unittest.cc @@ -220,8 +220,8 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) { gfx::Vector2dF(), FilterOperations()); - pass_list.push_back(pass.Pass()); - pass_list.push_back(contrib.Pass()); + pass_list.push_back(std::move(pass)); + pass_list.push_back(std::move(contrib)); // Make a copy with CopyAll(). RenderPassList copy_list; @@ -303,7 +303,7 @@ TEST(RenderPassTest, CopyAllWithCulledQuads) { gfx::Rect(3, 3, 3, 3), gfx::Rect(3, 3, 3, 3), SkColor(), false); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); // Make a copy with CopyAll(). RenderPassList copy_list; diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index 9897b133442887..ddf71cf15cc2e1 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc @@ -130,7 +130,7 @@ Resource* ResourcePool::AcquireResource(const gfx::Size& size, ++total_resource_count_; Resource* resource = pool_resource.get(); - in_use_resources_.set(resource->id(), pool_resource.Pass()); + in_use_resources_.set(resource->id(), std::move(pool_resource)); in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes( resource->size(), resource->format()); return resource; @@ -234,7 +234,7 @@ void ResourcePool::CheckBusyResources() { } void ResourcePool::DidFinishUsingResource(scoped_ptr resource) { - unused_resources_.push_front(resource.Pass()); + unused_resources_.push_front(std::move(resource)); } void ResourcePool::ScheduleEvictExpiredResourcesIn( diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 97d9344eceda1d..506d1d97954cd1 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc @@ -515,8 +515,8 @@ ResourceId ResourceProvider::CreateResourceFromTextureMailbox( ResourceId ResourceProvider::CreateResourceFromTextureMailbox( const TextureMailbox& mailbox, scoped_ptr release_callback_impl) { - return CreateResourceFromTextureMailbox(mailbox, release_callback_impl.Pass(), - false); + return CreateResourceFromTextureMailbox( + mailbox, std::move(release_callback_impl), false); } void ResourceProvider::DeleteResource(ResourceId id) { diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index 77d0ed2028ae7d..90ec427aae6590 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc @@ -93,7 +93,7 @@ static scoped_ptr CreateAndFillSharedBitmap( uint32_t* pixels = reinterpret_cast(shared_bitmap->pixels()); CHECK(pixels); std::fill_n(pixels, size.GetArea(), value); - return shared_bitmap.Pass(); + return shared_bitmap; } class TextureStateTrackingContext : public TestWebGraphicsContext3D { @@ -283,7 +283,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); base::AutoLock lock_for_texture_access(namespace_->lock); pending->texture = UnboundTexture(texture); - pending_produce_textures_.push_back(pending.Pass()); + pending_produce_textures_.push_back(std::move(pending)); } GLuint createAndConsumeTextureCHROMIUM(GLenum target, @@ -404,7 +404,7 @@ class ResourceProviderTest context3d_ = context3d.get(); scoped_refptr context_provider = - TestContextProvider::Create(context3d.Pass()); + TestContextProvider::Create(std::move(context3d)); output_surface_ = FakeOutputSurface::Create3d(context_provider); @@ -413,10 +413,10 @@ class ResourceProviderTest child_context_ = child_context_owned.get(); if (child_needs_sync_token) { child_output_surface_ = - FakeOutputSurface::Create3d(child_context_owned.Pass()); + FakeOutputSurface::Create3d(std::move(child_context_owned)); } else { child_output_surface_ = FakeOutputSurface::CreateNoRequireSyncPoint( - child_context_owned.Pass()); + std::move(child_context_owned)); } break; } @@ -484,7 +484,7 @@ class ResourceProviderTest release_called, release_sync_token, lost_resource)); return child_resource_provider_->CreateResourceFromTextureMailbox( TextureMailbox(gpu_mailbox, *sync_token, GL_TEXTURE_2D), - callback.Pass()); + std::move(callback)); } else { gfx::Size size(64, 64); scoped_ptr shared_bitmap( @@ -496,7 +496,7 @@ class ResourceProviderTest ReleaseSharedBitmapCallback, base::Passed(&shared_bitmap), release_called, release_sync_token, lost_resource)); return child_resource_provider_->CreateResourceFromTextureMailbox( - TextureMailbox(shared_bitmap_ptr, size), callback.Pass()); + TextureMailbox(shared_bitmap_ptr, size), std::move(callback)); } } @@ -1393,7 +1393,7 @@ TEST_P(ResourceProviderTest, TransferGLToSoftware) { FakeOutputSurfaceClient child_output_surface_client; scoped_ptr child_output_surface( - FakeOutputSurface::Create3d(child_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(child_context_owned))); CHECK(child_output_surface->BindToClient(&child_output_surface_client)); scoped_ptr child_resource_provider(ResourceProvider::Create( @@ -1875,7 +1875,7 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest { FakeOutputSurfaceClient child_output_surface_client; scoped_ptr child_output_surface( - FakeOutputSurface::Create3d(child_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(child_context_owned))); CHECK(child_output_surface->BindToClient(&child_output_surface_client)); scoped_ptr shared_bitmap_manager( new TestSharedBitmapManager()); @@ -1892,7 +1892,7 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest { FakeOutputSurfaceClient parent_output_surface_client; scoped_ptr parent_output_surface( - FakeOutputSurface::Create3d(parent_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(parent_context_owned))); CHECK(parent_output_surface->BindToClient(&parent_output_surface_client)); scoped_ptr parent_resource_provider( @@ -2499,7 +2499,7 @@ TEST_P(ResourceProviderTest, LostContext) { base::Bind(ReleaseCallback, &release_sync_token, &lost_resource, &main_thread_task_runner)); resource_provider_->CreateResourceFromTextureMailbox( - TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D), callback.Pass()); + TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D), std::move(callback)); EXPECT_FALSE(release_sync_token.HasData()); EXPECT_FALSE(lost_resource); @@ -2524,7 +2524,7 @@ TEST_P(ResourceProviderTest, ScopedSampler) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2603,7 +2603,7 @@ TEST_P(ResourceProviderTest, ManagedResource) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2646,7 +2646,7 @@ TEST_P(ResourceProviderTest, TextureWrapMode) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2690,7 +2690,7 @@ TEST_P(ResourceProviderTest, TextureHint) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2767,7 +2767,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_SharedMemory) { TextureMailbox mailbox(shared_bitmap.get(), size); ResourceId id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, callback.Pass()); + mailbox, std::move(callback)); EXPECT_NE(0u, id); { @@ -2798,7 +2798,7 @@ class ResourceProviderTestTextureMailboxGLFilters FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2830,7 +2830,7 @@ class ResourceProviderTestTextureMailboxGLFilters mailbox.set_nearest_neighbor(mailbox_nearest_neighbor); ResourceId id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, callback.Pass()); + mailbox, std::move(callback)); EXPECT_NE(0u, id); Mock::VerifyAndClearExpectations(context); @@ -2941,7 +2941,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTextureExternalOES) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -2966,7 +2966,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTextureExternalOES) { TextureMailbox mailbox(gpu_mailbox, sync_token, target); ResourceId id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, callback.Pass()); + mailbox, std::move(callback)); EXPECT_NE(0u, id); Mock::VerifyAndClearExpectations(context); @@ -3011,7 +3011,7 @@ TEST_P(ResourceProviderTest, FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -3036,7 +3036,7 @@ TEST_P(ResourceProviderTest, TextureMailbox mailbox(gpu_mailbox, sync_token, target); ResourceId id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, callback.Pass()); + mailbox, std::move(callback)); EXPECT_NE(0u, id); Mock::VerifyAndClearExpectations(context); @@ -3065,7 +3065,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_WaitSyncTokenIfNeeded_NoSyncToken) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -3090,7 +3090,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_WaitSyncTokenIfNeeded_NoSyncToken) { TextureMailbox mailbox(gpu_mailbox, sync_token, target); ResourceId id = resource_provider->CreateResourceFromTextureMailbox( - mailbox, callback.Pass()); + mailbox, std::move(callback)); EXPECT_NE(0u, id); Mock::VerifyAndClearExpectations(context); @@ -3186,7 +3186,7 @@ TEST_P(ResourceProviderTest, TextureAllocation) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -3242,7 +3242,7 @@ TEST_P(ResourceProviderTest, TextureAllocationHint) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -3298,7 +3298,7 @@ TEST_P(ResourceProviderTest, TextureAllocationHint_BGRA) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr resource_provider(ResourceProvider::Create( @@ -3349,7 +3349,7 @@ TEST_P(ResourceProviderTest, Image_GLTexture) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); const int kWidth = 2; @@ -3434,7 +3434,7 @@ TEST_P(ResourceProviderTest, CompressedTextureETC1Allocate) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); gfx::Size size(4, 4); @@ -3466,7 +3466,7 @@ TEST_P(ResourceProviderTest, CompressedTextureETC1Upload) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); gfx::Size size(4, 4); @@ -3517,7 +3517,7 @@ TEST(ResourceProviderTest, TextureAllocationChunkSize) { FakeOutputSurfaceClient output_surface_client; scoped_ptr output_surface( - FakeOutputSurface::Create3d(context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(context_owned))); CHECK(output_surface->BindToClient(&output_surface_client)); scoped_ptr shared_bitmap_manager( new TestSharedBitmapManager()); diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc index 10e81f6d86830b..689de6817943dc 100644 --- a/cc/resources/video_resource_updater_unittest.cc +++ b/cc/resources/video_resource_updater_unittest.cc @@ -62,8 +62,7 @@ class VideoResourceUpdaterTest : public testing::Test { context3d_ = context3d.get(); - output_surface3d_ = - FakeOutputSurface::Create3d(context3d.Pass()); + output_surface3d_ = FakeOutputSurface::Create3d(std::move(context3d)); CHECK(output_surface3d_->BindToClient(&client_)); output_surface_software_ = FakeOutputSurface::CreateSoftware( diff --git a/cc/scheduler/begin_frame_source.cc b/cc/scheduler/begin_frame_source.cc index d9cadc83e726f7..1ee862bf89ba7d 100644 --- a/cc/scheduler/begin_frame_source.cc +++ b/cc/scheduler/begin_frame_source.cc @@ -210,12 +210,12 @@ scoped_ptr SyntheticBeginFrameSource::Create( base::TimeDelta initial_vsync_interval) { scoped_ptr time_source = DelayBasedTimeSource::Create(initial_vsync_interval, task_runner); - return make_scoped_ptr(new SyntheticBeginFrameSource(time_source.Pass())); + return make_scoped_ptr(new SyntheticBeginFrameSource(std::move(time_source))); } SyntheticBeginFrameSource::SyntheticBeginFrameSource( scoped_ptr time_source) - : BeginFrameSourceBase(), time_source_(time_source.Pass()) { + : BeginFrameSourceBase(), time_source_(std::move(time_source)) { time_source_->SetActive(false); time_source_->SetClient(this); } diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index eb2c3e14decfdf..b113ff1b341040 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -42,8 +42,8 @@ scoped_ptr Scheduler::Create( BackToBackBeginFrameSource::Create(task_runner); return make_scoped_ptr(new Scheduler( client, settings, layer_tree_host_id, task_runner, external_frame_source, - synthetic_frame_source.Pass(), unthrottled_frame_source.Pass(), - compositor_timing_history.Pass())); + std::move(synthetic_frame_source), std::move(unthrottled_frame_source), + std::move(compositor_timing_history))); } Scheduler::Scheduler( @@ -60,11 +60,11 @@ Scheduler::Scheduler( layer_tree_host_id_(layer_tree_host_id), task_runner_(task_runner), external_frame_source_(external_frame_source), - synthetic_frame_source_(synthetic_frame_source.Pass()), - unthrottled_frame_source_(unthrottled_frame_source.Pass()), + synthetic_frame_source_(std::move(synthetic_frame_source)), + unthrottled_frame_source_(std::move(unthrottled_frame_source)), frame_source_(BeginFrameSourceMultiplexer::Create()), throttle_frame_production_(false), - compositor_timing_history_(compositor_timing_history.Pass()), + compositor_timing_history_(std::move(compositor_timing_history)), begin_impl_frame_deadline_mode_( SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE), begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc index 362946fbc7dcae..03bb8b0da5c094 100644 --- a/cc/scheduler/scheduler_unittest.cc +++ b/cc/scheduler/scheduler_unittest.cc @@ -271,7 +271,7 @@ class SchedulerTest : public testing::Test { scheduler_ = TestScheduler::Create( now_src_.get(), client_.get(), scheduler_settings_, 0, task_runner_.get(), fake_external_begin_frame_source_.get(), - fake_compositor_timing_history.Pass()); + std::move(fake_compositor_timing_history)); DCHECK(scheduler_); client_->set_scheduler(scheduler_.get()); @@ -293,7 +293,7 @@ class SchedulerTest : public testing::Test { void SetUpScheduler(scoped_ptr client, bool initSurface) { - client_ = client.Pass(); + client_ = std::move(client); if (initSurface) CreateSchedulerAndInitSurface(); else @@ -1228,7 +1228,7 @@ TEST_F(SchedulerTest, PrepareTilesFunnelResetOnVisibilityChange) { scoped_ptr client = make_scoped_ptr(new SchedulerClientNeedsPrepareTilesInDraw); scheduler_settings_.use_external_begin_frame_source = true; - SetUpScheduler(client.Pass(), true); + SetUpScheduler(std::move(client), true); // Simulate a few visibility changes and associated PrepareTiles. for (int i = 0; i < 10; i++) { @@ -3331,7 +3331,7 @@ TEST_F(SchedulerTest, SynchronousCompositorPrepareTilesOnDraw) { scoped_ptr client = make_scoped_ptr(new SchedulerClientSetNeedsPrepareTilesOnDraw); - SetUpScheduler(client.Pass(), true); + SetUpScheduler(std::move(client), true); scheduler_->SetNeedsRedraw(); EXPECT_SINGLE_ACTION("SetNeedsBeginFrames(true)", client_); diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc index ef9802c30dd697..2cdcfcd1937e84 100644 --- a/cc/surfaces/display.cc +++ b/cc/surfaces/display.cc @@ -54,7 +54,7 @@ Display::~Display() { bool Display::Initialize(scoped_ptr output_surface, DisplayScheduler* scheduler) { - output_surface_ = output_surface.Pass(); + output_surface_ = std::move(output_surface); scheduler_ = scheduler; return output_surface_->BindToClient(this); } @@ -118,16 +118,16 @@ void Display::InitializeRenderer() { texture_mailbox_deleter_.get(), settings_.highp_threshold_min); if (!renderer) return; - renderer_ = renderer.Pass(); + renderer_ = std::move(renderer); } else { scoped_ptr renderer = SoftwareRenderer::Create( this, &settings_, output_surface_.get(), resource_provider.get()); if (!renderer) return; - renderer_ = renderer.Pass(); + renderer_ = std::move(renderer); } - resource_provider_ = resource_provider.Pass(); + resource_provider_ = std::move(resource_provider); // TODO(jbauman): Outputting an incomplete quad list doesn't work when using // overlays. bool output_partial_list = renderer_->Capabilities().using_partial_swap && diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc index 7b82d961312394..a92496c75214ae 100644 --- a/cc/surfaces/display_unittest.cc +++ b/cc/surfaces/display_unittest.cc @@ -62,12 +62,13 @@ class DisplayTest : public testing::Test { void SetUpContext(scoped_ptr context) { if (context) { output_surface_ = FakeOutputSurface::Create3d( - TestContextProvider::Create(context.Pass())); + TestContextProvider::Create(std::move(context))); } else { scoped_ptr output_device( new TestSoftwareOutputDevice); software_output_device_ = output_device.get(); - output_surface_ = FakeOutputSurface::CreateSoftware(output_device.Pass()); + output_surface_ = + FakeOutputSurface::CreateSoftware(std::move(output_device)); } shared_bitmap_manager_.reset(new TestSharedBitmapManager); output_surface_ptr_ = output_surface_.get(); @@ -78,9 +79,9 @@ class DisplayTest : public testing::Test { pass_list->swap(frame_data->render_pass_list); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); - factory_.SubmitCompositorFrame(surface_id, frame.Pass(), + factory_.SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); } @@ -160,7 +161,7 @@ TEST_F(DisplayTest, DisplayAsSurfaceAggregatorClient) { TestDisplayScheduler scheduler(&display, &fake_begin_frame_source_, task_runner_.get()); - display.Initialize(output_surface_.Pass(), &scheduler); + display.Initialize(std::move(output_surface_), &scheduler); SurfaceId surface_id(6); factory_.Create(surface_id); @@ -185,7 +186,7 @@ TEST_F(DisplayTest, DisplayDamaged) { TestDisplayScheduler scheduler(&display, &fake_begin_frame_source_, task_runner_.get()); - display.Initialize(output_surface_.Pass(), &scheduler); + display.Initialize(std::move(output_surface_), &scheduler); SurfaceId surface_id(7u); EXPECT_FALSE(scheduler.damaged); @@ -209,7 +210,7 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->output_rect = gfx::Rect(0, 0, 100, 100); pass->damage_rect = gfx::Rect(10, 10, 1, 1); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); @@ -233,7 +234,7 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 1, 1); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); EXPECT_TRUE(scheduler.damaged); @@ -256,7 +257,7 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 0, 0); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); EXPECT_TRUE(scheduler.damaged); @@ -276,7 +277,7 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 10, 10); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); EXPECT_TRUE(scheduler.damaged); @@ -296,7 +297,7 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 0, 0); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); EXPECT_TRUE(scheduler.damaged); @@ -321,7 +322,7 @@ TEST_F(DisplayTest, DisplayDamaged) { base::Bind(&CopyCallback, ©_called))); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); SubmitCompositorFrame(&pass_list, surface_id); EXPECT_TRUE(scheduler.damaged); @@ -342,16 +343,16 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 0, 0); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); scoped_ptr frame_data(new DelegatedFrameData); pass_list.swap(frame_data->render_pass_list); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); frame->metadata.latency_info.push_back(ui::LatencyInfo()); - factory_.SubmitCompositorFrame(surface_id, frame.Pass(), + factory_.SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); EXPECT_TRUE(scheduler.damaged); EXPECT_FALSE(scheduler.display_resized_); @@ -375,15 +376,15 @@ TEST_F(DisplayTest, DisplayDamaged) { pass->damage_rect = gfx::Rect(10, 10, 10, 10); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); scheduler.ResetDamageForTest(); scoped_ptr frame_data(new DelegatedFrameData); pass_list.swap(frame_data->render_pass_list); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); - factory_.SubmitCompositorFrame(surface_id, frame.Pass(), + factory_.SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); EXPECT_TRUE(scheduler.damaged); EXPECT_FALSE(scheduler.display_resized_); @@ -406,7 +407,7 @@ class MockedContext : public TestWebGraphicsContext3D { TEST_F(DisplayTest, Finish) { scoped_ptr context(new MockedContext()); MockedContext* context_ptr = context.get(); - SetUpContext(context.Pass()); + SetUpContext(std::move(context)); EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()).Times(0); TestDisplayClient client; @@ -418,7 +419,7 @@ TEST_F(DisplayTest, Finish) { TestDisplayScheduler scheduler(&display, &fake_begin_frame_source_, task_runner_.get()); - display.Initialize(output_surface_.Pass(), &scheduler); + display.Initialize(std::move(output_surface_), &scheduler); SurfaceId surface_id(7u); display.SetSurfaceId(surface_id, 1.f); @@ -432,7 +433,7 @@ TEST_F(DisplayTest, Finish) { pass->output_rect = gfx::Rect(0, 0, 100, 100); pass->damage_rect = gfx::Rect(10, 10, 1, 1); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); SubmitCompositorFrame(&pass_list, surface_id); } @@ -458,7 +459,7 @@ TEST_F(DisplayTest, Finish) { pass->output_rect = gfx::Rect(0, 0, 200, 200); pass->damage_rect = gfx::Rect(10, 10, 1, 1); pass->id = RenderPassId(1, 1); - pass_list.push_back(pass.Pass()); + pass_list.push_back(std::move(pass)); SubmitCompositorFrame(&pass_list, surface_id); } diff --git a/cc/surfaces/onscreen_display_client.cc b/cc/surfaces/onscreen_display_client.cc index 06828b05321f62..50b64a78fc5d6f 100644 --- a/cc/surfaces/onscreen_display_client.cc +++ b/cc/surfaces/onscreen_display_client.cc @@ -21,7 +21,7 @@ OnscreenDisplayClient::OnscreenDisplayClient( gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const RendererSettings& settings, scoped_refptr task_runner) - : output_surface_(output_surface.Pass()), + : output_surface_(std::move(output_surface)), task_runner_(task_runner), display_(new Display(this, manager, @@ -52,7 +52,7 @@ bool OnscreenDisplayClient::Initialize() { new DisplayScheduler(display_.get(), frame_source, task_runner_.get(), output_surface_->capabilities().max_frames_pending)); - return display_->Initialize(output_surface_.Pass(), scheduler_.get()); + return display_->Initialize(std::move(output_surface_), scheduler_.get()); } void OnscreenDisplayClient::CommitVSyncParameters(base::TimeTicks timebase, diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc index 351b679ca4c53b..f5649b1824432b 100644 --- a/cc/surfaces/surface.cc +++ b/cc/surfaces/surface.cc @@ -50,8 +50,8 @@ void Surface::QueueFrame(scoped_ptr frame, TakeLatencyInfo(&frame->metadata.latency_info); } - scoped_ptr previous_frame = current_frame_.Pass(); - current_frame_ = frame.Pass(); + scoped_ptr previous_frame = std::move(current_frame_); + current_frame_ = std::move(frame); if (current_frame_) { factory_->ReceiveFromChild( @@ -104,7 +104,7 @@ void Surface::RequestCopyOfOutput(scoped_ptr copy_request) { if (current_frame_ && !current_frame_->delegated_frame_data->render_pass_list.empty()) current_frame_->delegated_frame_data->render_pass_list.back() - ->copy_requests.push_back(copy_request.Pass()); + ->copy_requests.push_back(std::move(copy_request)); else copy_request->SendEmptyResult(); } diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc index 43c57bcf670bfc..75df292316cd5e 100644 --- a/cc/surfaces/surface_aggregator.cc +++ b/cc/surfaces/surface_aggregator.cc @@ -231,7 +231,7 @@ void SurfaceAggregator::HandleSurfaceQuad( child_to_parent_map, gfx::Transform(), ClipData(), copy_pass.get(), surface_id); - dest_pass_list_->push_back(copy_pass.Pass()); + dest_pass_list_->push_back(std::move(copy_pass)); } gfx::Transform surface_transform = @@ -457,7 +457,7 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data, child_to_parent_map, gfx::Transform(), ClipData(), copy_pass.get(), surface->surface_id()); - dest_pass_list_->push_back(copy_pass.Pass()); + dest_pass_list_->push_back(std::move(copy_pass)); } } @@ -641,7 +641,7 @@ scoped_ptr SurfaceAggregator::Aggregate(SurfaceId surface_id) { // TODO(jamesr): Aggregate all resource references into the returned frame's // resource list. - return frame.Pass(); + return frame; } void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) { diff --git a/cc/surfaces/surface_aggregator_perftest.cc b/cc/surfaces/surface_aggregator_perftest.cc index 95085c3b634c85..c6e4234f79e372 100644 --- a/cc/surfaces/surface_aggregator_perftest.cc +++ b/cc/surfaces/surface_aggregator_perftest.cc @@ -96,10 +96,10 @@ class SurfaceAggregatorPerfTest : public testing::Test { SurfaceId(i - 1)); } - frame_data->render_pass_list.push_back(pass.Pass()); + frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory_.SubmitCompositorFrame(SurfaceId(i), frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory_.SubmitCompositorFrame(SurfaceId(i), std::move(frame), SurfaceFactory::DrawCallback()); } @@ -120,10 +120,11 @@ class SurfaceAggregatorPerfTest : public testing::Test { else pass->damage_rect = gfx::Rect(0, 0, 1, 1); - frame_data->render_pass_list.push_back(pass.Pass()); + frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory_.SubmitCompositorFrame(SurfaceId(num_surfaces + 1), frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory_.SubmitCompositorFrame(SurfaceId(num_surfaces + 1), + std::move(frame), SurfaceFactory::DrawCallback()); scoped_ptr aggregated = diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc index 848912e66deb76..53b01e046b67c2 100644 --- a/cc/surfaces/surface_aggregator_unittest.cc +++ b/cc/surfaces/surface_aggregator_unittest.cc @@ -157,9 +157,9 @@ class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest { pass_list->swap(frame_data->render_pass_list); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); - factory_.SubmitCompositorFrame(surface_id, frame.Pass(), + factory_.SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); } @@ -173,12 +173,12 @@ class SurfaceAggregatorValidSurfaceTest : public SurfaceAggregatorTest { void QueuePassAsFrame(scoped_ptr pass, SurfaceId surface_id) { scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = delegated_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(surface_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); } @@ -329,7 +329,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, CopyRequest) { scoped_ptr copy_request( CopyOutputRequest::CreateEmptyRequest()); CopyOutputRequest* copy_request_ptr = copy_request.get(); - factory_.RequestCopyOfSurface(embedded_surface_id, copy_request.Pass()); + factory_.RequestCopyOfSurface(embedded_surface_id, std::move(copy_request)); test::Quad root_quads[] = {test::Quad::SolidColorQuad(SK_ColorWHITE), test::Quad::SurfaceQuad(embedded_surface_id, 1.f), @@ -412,16 +412,16 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, RootCopyRequest) { gfx::Rect(SurfaceSize()), root_passes, arraysize(root_passes)); - pass_list[0]->copy_requests.push_back(copy_request.Pass()); - pass_list[1]->copy_requests.push_back(copy_request2.Pass()); + pass_list[0]->copy_requests.push_back(std::move(copy_request)); + pass_list[1]->copy_requests.push_back(std::move(copy_request2)); scoped_ptr frame_data(new DelegatedFrameData); pass_list.swap(frame_data->render_pass_list); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); - factory_.SubmitCompositorFrame(root_surface_id_, frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id_, std::move(frame), SurfaceFactory::DrawCallback()); } @@ -887,7 +887,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { pass_id, output_rect, damage_rect, transform_to_root_target); AddSolidColorQuadWithBlendMode( SurfaceSize(), grandchild_pass.get(), blend_modes[2]); - QueuePassAsFrame(grandchild_pass.Pass(), grandchild_surface_id); + QueuePassAsFrame(std::move(grandchild_pass), grandchild_surface_id); SurfaceId child_one_surface_id = allocator_.GenerateId(); factory_.Create(child_one_surface_id); @@ -907,7 +907,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { grandchild_surface_id); AddSolidColorQuadWithBlendMode( SurfaceSize(), child_one_pass.get(), blend_modes[3]); - QueuePassAsFrame(child_one_pass.Pass(), child_one_surface_id); + QueuePassAsFrame(std::move(child_one_pass), child_one_surface_id); SurfaceId child_two_surface_id = allocator_.GenerateId(); factory_.Create(child_two_surface_id); @@ -919,7 +919,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { pass_id, output_rect, damage_rect, transform_to_root_target); AddSolidColorQuadWithBlendMode( SurfaceSize(), child_two_pass.get(), blend_modes[5]); - QueuePassAsFrame(child_two_pass.Pass(), child_two_surface_id); + QueuePassAsFrame(std::move(child_two_pass), child_two_surface_id); scoped_ptr root_pass = RenderPass::Create(); root_pass->SetNew( @@ -944,7 +944,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { AddSolidColorQuadWithBlendMode( SurfaceSize(), root_pass.get(), blend_modes[6]); - QueuePassAsFrame(root_pass.Pass(), root_surface_id_); + QueuePassAsFrame(std::move(root_pass), root_surface_id_); EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); EXPECT_FALSE(surface_aggregator_client_.HasSurface(grandchild_surface)); @@ -1039,9 +1039,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { child_pass_list.swap(child_frame_data->render_pass_list); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = child_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(child_frame_data); - factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); } @@ -1072,9 +1072,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { middle_pass_list.swap(middle_frame_data->render_pass_list); scoped_ptr middle_frame(new CompositorFrame); - middle_frame->delegated_frame_data = middle_frame_data.Pass(); + middle_frame->delegated_frame_data = std::move(middle_frame_data); - factory_.SubmitCompositorFrame(middle_surface_id, middle_frame.Pass(), + factory_.SubmitCompositorFrame(middle_surface_id, std::move(middle_frame), SurfaceFactory::DrawCallback()); } @@ -1108,9 +1108,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { root_pass_list.swap(root_frame_data->render_pass_list); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = root_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(root_frame_data); - factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), SurfaceFactory::DrawCallback()); EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); @@ -1223,12 +1223,12 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { child_pass_list.swap(child_frame_data->render_pass_list); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = child_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(child_frame_data); SurfaceId child_surface_id = allocator_.GenerateId(); factory_.Create(child_surface_id); Surface* child_surface = manager_.GetSurfaceForId(child_surface_id); - factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); test::Quad parent_surface_quads[] = { @@ -1250,12 +1250,14 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { parent_surface_pass_list.swap(parent_surface_frame_data->render_pass_list); scoped_ptr parent_surface_frame(new CompositorFrame); - parent_surface_frame->delegated_frame_data = parent_surface_frame_data.Pass(); + parent_surface_frame->delegated_frame_data = + std::move(parent_surface_frame_data); SurfaceId parent_surface_id = allocator_.GenerateId(); factory_.Create(parent_surface_id); Surface* parent_surface = manager_.GetSurfaceForId(parent_surface_id); - factory_.SubmitCompositorFrame(parent_surface_id, parent_surface_frame.Pass(), + factory_.SubmitCompositorFrame(parent_surface_id, + std::move(parent_surface_frame), SurfaceFactory::DrawCallback()); test::Quad root_surface_quads[] = { @@ -1285,9 +1287,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { root_pass_list.swap(root_frame_data->render_pass_list); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = root_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(root_frame_data); - factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), SurfaceFactory::DrawCallback()); EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); @@ -1330,9 +1332,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { child_pass_list.swap(child_frame_data->render_pass_list); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = child_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(child_frame_data); - factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); @@ -1378,9 +1380,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { root_pass_list.swap(root_frame_data->render_pass_list); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = root_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(root_frame_data); - factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), SurfaceFactory::DrawCallback()); } @@ -1400,9 +1402,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) { root_pass_list.swap(root_frame_data->render_pass_list); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = root_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(root_frame_data); - factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), SurfaceFactory::DrawCallback()); EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); @@ -1794,10 +1796,10 @@ void SubmitCompositorFrameWithResources(ResourceId* resource_ids, uv_bottom_right, background_color, vertex_opacity, flipped, nearest_neighbor); } - frame_data->render_pass_list.push_back(pass.Pass()); + frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory->SubmitCompositorFrame(surface_id, frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory->SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); } @@ -1856,10 +1858,10 @@ TEST_F(SurfaceAggregatorWithResourcesTest, TakeInvalidResources) { // ignored. resource.is_software = false; frame_data->resource_list.push_back(resource); - frame_data->render_pass_list.push_back(pass.Pass()); + frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory.SubmitCompositorFrame(surface_id, frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory.SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); EXPECT_FALSE(surface_aggregator_client_.HasSurface(surface)); diff --git a/cc/surfaces/surface_display_output_surface.cc b/cc/surfaces/surface_display_output_surface.cc index c887ca45f85381..53d781fb102335 100644 --- a/cc/surfaces/surface_display_output_surface.cc +++ b/cc/surfaces/surface_display_output_surface.cc @@ -64,7 +64,7 @@ void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame* frame) { scoped_ptr frame_copy(new CompositorFrame()); frame->AssignTo(frame_copy.get()); factory_.SubmitCompositorFrame( - surface_id_, frame_copy.Pass(), + surface_id_, std::move(frame_copy), base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete, base::Unretained(this))); } diff --git a/cc/surfaces/surface_display_output_surface_unittest.cc b/cc/surfaces/surface_display_output_surface_unittest.cc index 2fedf5a34b957b..327010b93e7f33 100644 --- a/cc/surfaces/surface_display_output_surface_unittest.cc +++ b/cc/surfaces/surface_display_output_surface_unittest.cc @@ -83,10 +83,10 @@ class SurfaceDisplayOutputSurfaceTest : public testing::Test { gfx::Transform()); scoped_ptr frame_data(new DelegatedFrameData); - frame_data->render_pass_list.push_back(render_pass.Pass()); + frame_data->render_pass_list.push_back(std::move(render_pass)); CompositorFrame frame; - frame.delegated_frame_data = frame_data.Pass(); + frame.delegated_frame_data = std::move(frame_data); surface_display_output_surface_.SwapBuffers(&frame); } diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc index b35380efb1784b..322d722637e5d8 100644 --- a/cc/surfaces/surface_factory.cc +++ b/cc/surfaces/surface_factory.cc @@ -40,7 +40,7 @@ void SurfaceFactory::Create(SurfaceId surface_id) { scoped_ptr surface(new Surface(surface_id, this)); manager_->RegisterSurface(surface.get()); DCHECK(!surface_map_.count(surface_id)); - surface_map_.add(surface_id, surface.Pass()); + surface_map_.add(surface_id, std::move(surface)); } void SurfaceFactory::Destroy(SurfaceId surface_id) { @@ -62,7 +62,7 @@ void SurfaceFactory::SubmitCompositorFrame(SurfaceId surface_id, OwningSurfaceMap::iterator it = surface_map_.find(surface_id); DCHECK(it != surface_map_.end()); DCHECK(it->second->factory().get() == this); - it->second->QueueFrame(frame.Pass(), callback); + it->second->QueueFrame(std::move(frame), callback); if (!manager_->SurfaceModified(surface_id)) { TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); it->second->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); @@ -78,7 +78,7 @@ void SurfaceFactory::RequestCopyOfSurface( return; } DCHECK(it->second->factory().get() == this); - it->second->RequestCopyOfOutput(copy_request.Pass()); + it->second->RequestCopyOfOutput(std::move(copy_request)); manager_->SurfaceModified(surface_id); } diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc index 9e7bc153d36af0..fa05c2e93782bc 100644 --- a/cc/surfaces/surface_factory_unittest.cc +++ b/cc/surfaces/surface_factory_unittest.cc @@ -69,8 +69,8 @@ class SurfaceFactoryTest : public testing::Test { frame_data->resource_list.push_back(resource); } scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory_->SubmitCompositorFrame(surface_id_, frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory_->SubmitCompositorFrame(surface_id_, std::move(frame), SurfaceFactory::DrawCallback()); } @@ -389,7 +389,7 @@ TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) { scoped_ptr frame(new CompositorFrame); frame->delegated_frame_data.reset(new DelegatedFrameData); - factory_->SubmitCompositorFrame(surface_id, frame.Pass(), + factory_->SubmitCompositorFrame(surface_id, std::move(frame), SurfaceFactory::DrawCallback()); EXPECT_EQ(2, surface->frame_index()); factory_->Destroy(surface_id); @@ -413,12 +413,12 @@ TEST_F(SurfaceFactoryTest, DestroyAll) { resource.mailbox_holder.texture_target = GL_TEXTURE_2D; frame_data->resource_list.push_back(resource); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); uint32 execute_count = 0; SurfaceDrawStatus drawn = SurfaceDrawStatus::DRAW_SKIPPED; factory_->SubmitCompositorFrame( - id, frame.Pass(), base::Bind(&DrawCallback, &execute_count, &drawn)); + id, std::move(frame), base::Bind(&DrawCallback, &execute_count, &drawn)); surface_id_ = SurfaceId(); factory_->DestroyAll(); @@ -441,9 +441,9 @@ TEST_F(SurfaceFactoryTest, DestroySequence) { scoped_ptr frame(new CompositorFrame); frame->metadata.satisfies_sequences.push_back(6); frame->metadata.satisfies_sequences.push_back(4); - frame->delegated_frame_data = frame_data.Pass(); + frame->delegated_frame_data = std::move(frame_data); DCHECK(manager_.GetSurfaceForId(id2)); - factory_->SubmitCompositorFrame(surface_id_, frame.Pass(), + factory_->SubmitCompositorFrame(surface_id_, std::move(frame), SurfaceFactory::DrawCallback()); DCHECK(!manager_.GetSurfaceForId(id2)); @@ -492,10 +492,10 @@ TEST_F(SurfaceFactoryTest, DestroyCycle) { scoped_ptr render_pass(RenderPass::Create()); render_pass->referenced_surfaces.push_back(surface_id_); scoped_ptr frame_data(new DelegatedFrameData); - frame_data->render_pass_list.push_back(render_pass.Pass()); + frame_data->render_pass_list.push_back(std::move(render_pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory_->SubmitCompositorFrame(id2, frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory_->SubmitCompositorFrame(id2, std::move(frame), SurfaceFactory::DrawCallback()); } factory_->Destroy(id2); @@ -505,10 +505,10 @@ TEST_F(SurfaceFactoryTest, DestroyCycle) { scoped_ptr render_pass(RenderPass::Create()); render_pass->referenced_surfaces.push_back(id2); scoped_ptr frame_data(new DelegatedFrameData); - frame_data->render_pass_list.push_back(render_pass.Pass()); + frame_data->render_pass_list.push_back(std::move(render_pass)); scoped_ptr frame(new CompositorFrame); - frame->delegated_frame_data = frame_data.Pass(); - factory_->SubmitCompositorFrame(surface_id_, frame.Pass(), + frame->delegated_frame_data = std::move(frame_data); + factory_->SubmitCompositorFrame(surface_id_, std::move(frame), SurfaceFactory::DrawCallback()); } factory_->Destroy(surface_id_); diff --git a/cc/surfaces/surface_hittest_unittest.cc b/cc/surfaces/surface_hittest_unittest.cc index fde62f3c2b4eb3..2b59f0a7391b9b 100644 --- a/cc/surfaces/surface_hittest_unittest.cc +++ b/cc/surfaces/surface_hittest_unittest.cc @@ -79,7 +79,7 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) { SurfaceIdAllocator root_allocator(2); SurfaceId root_surface_id = root_allocator.GenerateId(); factory.Create(root_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); { @@ -109,7 +109,7 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface) { SurfaceIdAllocator root_allocator(2); SurfaceId root_surface_id = root_allocator.GenerateId(); factory.Create(root_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); TestCase tests[] = { { @@ -153,7 +153,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) { SurfaceIdAllocator root_allocator(2); SurfaceId root_surface_id = root_allocator.GenerateId(); factory.Create(root_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); // Creates a child surface. @@ -173,7 +173,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) { // Submit the frame. factory.Create(child_surface_id); - factory.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); TestCase tests[] = { @@ -227,7 +227,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) { root_rect, child_rect, child_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); // Verify that point (100, 100) no longer falls on the child surface. @@ -293,7 +293,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) { SurfaceIdAllocator root_allocator(2); SurfaceId root_surface_id = root_allocator.GenerateId(); factory.Create(root_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); // Creates a child surface. @@ -313,7 +313,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) { // Submit the frame. factory.Create(child_surface_id); - factory.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); TestCase tests[] = { @@ -412,7 +412,7 @@ TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) { SurfaceIdAllocator root_allocator(1); SurfaceId root_surface_id = root_allocator.GenerateId(); factory.Create(root_surface_id); - factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); TestCase tests[] = { diff --git a/cc/surfaces/surfaces_pixeltest.cc b/cc/surfaces/surfaces_pixeltest.cc index f0903f2afdcfe4..053a5636ae63bd 100644 --- a/cc/surfaces/surfaces_pixeltest.cc +++ b/cc/surfaces/surfaces_pixeltest.cc @@ -81,14 +81,14 @@ TEST_F(SurfacesPixelTest, DrawSimpleFrame) { force_anti_aliasing_off); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = delegated_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(delegated_frame_data); SurfaceId root_surface_id = allocator_.GenerateId(); factory_.Create(root_surface_id); - factory_.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); EmptySurfaceAggregatorClient surface_aggregator_client; @@ -140,12 +140,12 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { force_anti_aliasing_off); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = delegated_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); } @@ -168,12 +168,12 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { force_anti_aliasing_off); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = delegated_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), SurfaceFactory::DrawCallback()); } @@ -241,12 +241,12 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { right_child_id); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr root_frame(new CompositorFrame); - root_frame->delegated_frame_data = delegated_frame_data.Pass(); + root_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(root_surface_id, root_frame.Pass(), + factory_.SubmitCompositorFrame(root_surface_id, std::move(root_frame), SurfaceFactory::DrawCallback()); } @@ -277,12 +277,12 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { force_anti_aliasing_off); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = delegated_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(left_child_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(left_child_id, std::move(child_frame), SurfaceFactory::DrawCallback()); } @@ -313,12 +313,12 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { force_anti_aliasing_off); scoped_ptr delegated_frame_data(new DelegatedFrameData); - delegated_frame_data->render_pass_list.push_back(pass.Pass()); + delegated_frame_data->render_pass_list.push_back(std::move(pass)); scoped_ptr child_frame(new CompositorFrame); - child_frame->delegated_frame_data = delegated_frame_data.Pass(); + child_frame->delegated_frame_data = std::move(delegated_frame_data); - factory_.SubmitCompositorFrame(right_child_id, child_frame.Pass(), + factory_.SubmitCompositorFrame(right_child_id, std::move(child_frame), SurfaceFactory::DrawCallback()); } diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc index 70e5eb6af22e78..525592d517c2b1 100644 --- a/cc/trees/damage_tracker_unittest.cc +++ b/cc/trees/damage_tracker_unittest.cc @@ -98,9 +98,9 @@ class DamageTrackerTest : public testing::Test { child->SetPosition(gfx::PointF(100.f, 100.f)); child->SetBounds(gfx::Size(30, 30)); child->SetDrawsContent(true); - root->AddChild(child.Pass()); + root->AddChild(std::move(child)); - return root.Pass(); + return root; } scoped_ptr CreateTestTreeWithTwoSurfaces() { @@ -145,12 +145,12 @@ class DamageTrackerTest : public testing::Test { grand_child2->SetBounds(gfx::Size(6, 8)); grand_child2->SetDrawsContent(true); - child1->AddChild(grand_child1.Pass()); - child1->AddChild(grand_child2.Pass()); - root->AddChild(child1.Pass()); - root->AddChild(child2.Pass()); + child1->AddChild(std::move(grand_child1)); + child1->AddChild(std::move(grand_child2)); + root->AddChild(std::move(child1)); + root->AddChild(std::move(child2)); - return root.Pass(); + return root; } scoped_ptr CreateAndSetUpTestTreeWithOneSurface() { @@ -160,7 +160,7 @@ class DamageTrackerTest : public testing::Test { // everything, so that we can actually perform specific tests. EmulateDrawingOneFrame(root.get()); - return root.Pass(); + return root; } scoped_ptr CreateAndSetUpTestTreeWithTwoSurfaces() { @@ -170,7 +170,7 @@ class DamageTrackerTest : public testing::Test { // everything, so that we can actually perform specific tests. EmulateDrawingOneFrame(root.get()); - return root.Pass(); + return root; } protected: @@ -718,7 +718,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingLayer) { child2->SetPosition(gfx::PointF(400.f, 380.f)); child2->SetBounds(gfx::Size(6, 8)); child2->SetDrawsContent(true); - root->AddChild(child2.Pass()); + root->AddChild(std::move(child2)); } EmulateDrawingOneFrame(root.get()); @@ -772,7 +772,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) { // scenario. ASSERT_FALSE(child2->LayerPropertyChanged()); ASSERT_TRUE(child2->update_rect().IsEmpty()); - root->AddChild(child2.Pass()); + root->AddChild(std::move(child2)); } EmulateDrawingOneFrame(root.get()); @@ -798,7 +798,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) { child2->SetPosition(gfx::PointF(400.f, 380.f)); child2->SetBounds(gfx::Size(6, 8)); child2->SetDrawsContent(true); - root->AddChild(child2.Pass()); + root->AddChild(std::move(child2)); } LayerImpl* child2 = root->children()[1].get(); EmulateDrawingOneFrame(root.get()); @@ -1047,7 +1047,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) { grand_child3->SetPosition(gfx::PointF(240.f, 240.f)); grand_child3->SetBounds(gfx::Size(10, 10)); grand_child3->SetDrawsContent(true); - child1->AddChild(grand_child3.Pass()); + child1->AddChild(std::move(grand_child3)); } child1->SetOpacity(0.5f); EmulateDrawingOneFrame(root.get()); @@ -1062,7 +1062,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplica) { gfx::Transform reflection; reflection.Scale3d(-1.0, 1.0, 1.0); grand_child1_replica->SetTransform(reflection); - grand_child1->SetReplicaLayer(grand_child1_replica.Pass()); + grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); grand_child1->SetHasRenderSurface(true); } EmulateDrawingOneFrame(root.get()); @@ -1147,7 +1147,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) { LayerImpl::Create(host_impl_.active_tree(), 3); mask_layer->SetPosition(child->position()); mask_layer->SetBounds(child->bounds()); - child->SetMaskLayer(mask_layer.Pass()); + child->SetMaskLayer(std::move(mask_layer)); child->SetHasRenderSurface(true); } LayerImpl* mask_layer = child->mask_layer(); @@ -1160,7 +1160,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForMask) { grand_child->SetPosition(gfx::PointF(2.f, 2.f)); grand_child->SetBounds(gfx::Size(2, 2)); grand_child->SetDrawsContent(true); - child->AddChild(grand_child.Pass()); + child->AddChild(std::move(grand_child)); } EmulateDrawingOneFrame(root.get()); @@ -1236,7 +1236,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) { gfx::Transform reflection; reflection.Scale3d(-1.0, 1.0, 1.0); grand_child1_replica->SetTransform(reflection); - grand_child1->SetReplicaLayer(grand_child1_replica.Pass()); + grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); grand_child1->SetHasRenderSurface(true); } LayerImpl* grand_child1_replica = grand_child1->replica_layer(); @@ -1247,7 +1247,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMask) { LayerImpl::Create(host_impl_.active_tree(), 7); replica_mask_layer->SetPosition(gfx::PointF()); replica_mask_layer->SetBounds(grand_child1->bounds()); - grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass()); + grand_child1_replica->SetMaskLayer(std::move(replica_mask_layer)); } LayerImpl* replica_mask_layer = grand_child1_replica->mask_layer(); @@ -1313,7 +1313,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) { gfx::Transform reflection; reflection.Scale3d(-1.0, 1.0, 1.0); grand_child1_replica->SetTransform(reflection); - grand_child1->SetReplicaLayer(grand_child1_replica.Pass()); + grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); grand_child1->SetHasRenderSurface(true); } LayerImpl* grand_child1_replica = grand_child1->replica_layer(); @@ -1325,7 +1325,7 @@ TEST_F(DamageTrackerTest, VerifyDamageForReplicaMaskWithTransformOrigin) { replica_mask_layer->SetPosition(gfx::PointF()); // Note: this is not the transform origin being tested. replica_mask_layer->SetBounds(grand_child1->bounds()); - grand_child1_replica->SetMaskLayer(replica_mask_layer.Pass()); + grand_child1_replica->SetMaskLayer(std::move(replica_mask_layer)); } LayerImpl* replica_mask_layer = grand_child1_replica->mask_layer(); diff --git a/cc/trees/latency_info_swap_promise_monitor.cc b/cc/trees/latency_info_swap_promise_monitor.cc index a57ae4c8c41c71..9f2bc82fe1d654 100644 --- a/cc/trees/latency_info_swap_promise_monitor.cc +++ b/cc/trees/latency_info_swap_promise_monitor.cc @@ -52,7 +52,7 @@ LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() { void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { if (AddRenderingScheduledComponent(latency_, true /* on_main */)) { scoped_ptr swap_promise(new LatencyInfoSwapPromise(*latency_)); - layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); + layer_tree_host_->QueueSwapPromise(std::move(swap_promise)); } } @@ -64,7 +64,7 @@ void LatencyInfoSwapPromiseMonitor::OnSetNeedsRedrawOnImpl() { // promise is pinned so that it is not interrupted by new incoming // activations (which would otherwise break the swap promise). layer_tree_host_impl_->active_tree()->QueuePinnedSwapPromise( - swap_promise.Pass()); + std::move(swap_promise)); } } @@ -96,7 +96,7 @@ void LatencyInfoSwapPromiseMonitor::OnForwardScrollUpdateToMainThreadOnImpl() { scoped_ptr swap_promise( new LatencyInfoSwapPromise(new_latency)); layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( - swap_promise.Pass()); + std::move(swap_promise)); } } diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 13e66807a3cf86..23a2879bb24734 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -68,8 +68,8 @@ scoped_ptr LayerTreeHost::CreateThreaded( scoped_ptr layer_tree_host(new LayerTreeHost(params)); layer_tree_host->InitializeThreaded( params->main_task_runner, impl_task_runner, - params->external_begin_frame_source.Pass()); - return layer_tree_host.Pass(); + std::move(params->external_begin_frame_source)); + return layer_tree_host; } scoped_ptr LayerTreeHost::CreateSingleThreaded( @@ -79,8 +79,8 @@ scoped_ptr LayerTreeHost::CreateSingleThreaded( scoped_ptr layer_tree_host(new LayerTreeHost(params)); layer_tree_host->InitializeSingleThreaded( single_thread_client, params->main_task_runner, - params->external_begin_frame_source.Pass()); - return layer_tree_host.Pass(); + std::move(params->external_begin_frame_source)); + return layer_tree_host; } LayerTreeHost::LayerTreeHost(InitParams* params) @@ -140,7 +140,7 @@ void LayerTreeHost::InitializeThreaded( task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, impl_task_runner); InitializeProxy(ThreadProxy::Create(this, task_runner_provider_.get(), - external_begin_frame_source.Pass())); + std::move(external_begin_frame_source))); } void LayerTreeHost::InitializeSingleThreaded( @@ -150,20 +150,20 @@ void LayerTreeHost::InitializeSingleThreaded( task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); InitializeProxy(SingleThreadProxy::Create( this, single_thread_client, task_runner_provider_.get(), - external_begin_frame_source.Pass())); + std::move(external_begin_frame_source))); } void LayerTreeHost::InitializeForTesting( scoped_ptr task_runner_provider, scoped_ptr proxy_for_testing) { - task_runner_provider_ = task_runner_provider.Pass(); - InitializeProxy(proxy_for_testing.Pass()); + task_runner_provider_ = std::move(task_runner_provider); + InitializeProxy(std::move(proxy_for_testing)); } void LayerTreeHost::InitializeProxy(scoped_ptr proxy) { TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); - proxy_ = proxy.Pass(); + proxy_ = std::move(proxy); proxy_->Start(); if (settings_.accelerated_animation_enabled) { if (animation_host_) @@ -321,7 +321,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { host_impl->SetDebugState(debug_state_); if (pending_page_scale_animation_) { sync_tree->SetPendingPageScaleAnimation( - pending_page_scale_animation_.Pass()); + std::move(pending_page_scale_animation_)); } if (!ui_resource_request_queue_.empty()) { @@ -387,7 +387,7 @@ void LayerTreeHost::SetOutputSurface(scoped_ptr surface) { DCHECK(surface); DCHECK(!new_output_surface_); - new_output_surface_ = surface.Pass(); + new_output_surface_ = std::move(surface); proxy_->SetOutputSurface(new_output_surface_.get()); } @@ -397,7 +397,7 @@ scoped_ptr LayerTreeHost::ReleaseOutputSurface() { DidLoseOutputSurface(); proxy_->ReleaseOutputSurface(); - return current_output_surface_.Pass(); + return std::move(current_output_surface_); } void LayerTreeHost::RequestNewOutputSurface() { @@ -407,7 +407,7 @@ void LayerTreeHost::RequestNewOutputSurface() { void LayerTreeHost::DidInitializeOutputSurface() { DCHECK(new_output_surface_); output_surface_lost_ = false; - current_output_surface_ = new_output_surface_.Pass(); + current_output_surface_ = std::move(new_output_surface_); client_->DidInitializeOutputSurface(); } @@ -436,7 +436,7 @@ scoped_ptr LayerTreeHost::CreateLayerTreeHostImpl( gpu_memory_buffer_manager_ = NULL; task_graph_runner_ = NULL; input_handler_weak_ptr_ = host_impl->AsWeakPtr(); - return host_impl.Pass(); + return host_impl; } void LayerTreeHost::DidLoseOutputSurface() { @@ -537,9 +537,9 @@ void LayerTreeHost::SetAnimationEvents( scoped_ptr events) { DCHECK(task_runner_provider_->IsMainThread()); if (animation_host_) - animation_host_->SetAnimationEvents(events.Pass()); + animation_host_->SetAnimationEvents(std::move(events)); else - animation_registrar_->SetAnimationEvents(events.Pass()); + animation_registrar_->SetAnimationEvents(std::move(events)); } void LayerTreeHost::SetRootLayer(scoped_refptr root_layer) { @@ -820,7 +820,7 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { TRACE_ID_DONT_MANGLE(swap_promise->TraceId()), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step", "Main thread scroll update"); - QueueSwapPromise(swap_promise.Pass()); + QueueSwapPromise(std::move(swap_promise)); } gfx::Vector2dF inner_viewport_scroll_delta; @@ -999,13 +999,13 @@ int LayerTreeHost::ScheduleMicroBenchmark( const std::string& benchmark_name, scoped_ptr value, const MicroBenchmark::DoneCallback& callback) { - return micro_benchmark_controller_.ScheduleRun( - benchmark_name, value.Pass(), callback); + return micro_benchmark_controller_.ScheduleRun(benchmark_name, + std::move(value), callback); } bool LayerTreeHost::SendMessageToMicroBenchmark(int id, scoped_ptr value) { - return micro_benchmark_controller_.SendMessage(id, value.Pass()); + return micro_benchmark_controller_.SendMessage(id, std::move(value)); } void LayerTreeHost::InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) { @@ -1024,7 +1024,7 @@ void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() { void LayerTreeHost::QueueSwapPromise(scoped_ptr swap_promise) { DCHECK(swap_promise); - swap_promise_list_.push_back(swap_promise.Pass()); + swap_promise_list_.push_back(std::move(swap_promise)); } void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { @@ -1064,8 +1064,8 @@ void LayerTreeHost::SetAuthoritativeVSyncInterval( void LayerTreeHost::RecordFrameTimingEvents( scoped_ptr composite_events, scoped_ptr main_frame_events) { - client_->RecordFrameTimingEvents(composite_events.Pass(), - main_frame_events.Pass()); + client_->RecordFrameTimingEvents(std::move(composite_events), + std::move(main_frame_events)); } Layer* LayerTreeHost::LayerById(int id) const { diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 926b9b0990761c..1392bf6b716387 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -312,16 +312,16 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) { scroll_layer->SetScrollClipLayer(clip_layer->id()); scroll_layer->SetScrollDelta(kScrollDelta); gfx::Transform impl_transform; - scroll_layer->AddChild(sublayer_scoped_ptr.Pass()); + scroll_layer->AddChild(std::move(sublayer_scoped_ptr)); LayerImpl* scroll_layer_raw_ptr = scroll_layer_scoped_ptr.get(); - clip_layer->AddChild(scroll_layer_scoped_ptr.Pass()); + clip_layer->AddChild(std::move(scroll_layer_scoped_ptr)); scroll_layer_raw_ptr->PushScrollOffsetFromMainThread(kScrollOffset); scoped_ptr root(LayerImpl::Create(host_impl.active_tree(), 3)); SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(3, 4), true, false, false); - root->AddChild(clip_layer_scoped_ptr.Pass()); + root->AddChild(std::move(clip_layer_scoped_ptr)); root->SetHasRenderSurface(true); ExecuteCalculateDrawProperties( @@ -635,7 +635,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsForReplica) { SetLayerPropertiesForTesting(child_replica.get(), replica_layer_transform, gfx::Point3F(), gfx::PointF(), gfx::Size(), true, false, false); - child->SetReplicaLayer(child_replica.Pass()); + child->SetReplicaLayer(std::move(child_replica)); ExecuteCalculateDrawProperties(root); @@ -775,8 +775,8 @@ TEST_F(LayerTreeHostCommonTest, TransformsForRenderSurfaceHierarchy) { gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(), gfx::Size(), true, false, false); - render_surface1->SetReplicaLayer(replica_of_rs1.Pass()); - render_surface2->SetReplicaLayer(replica_of_rs2.Pass()); + render_surface1->SetReplicaLayer(std::move(replica_of_rs1)); + render_surface2->SetReplicaLayer(std::move(replica_of_rs2)); ExecuteCalculateDrawProperties(root); // Only layers that are associated with render surfaces should have an actual @@ -2410,7 +2410,7 @@ TEST_F(LayerTreeHostCommonTest, Animation::TRANSFORM); animation->set_fill_mode(Animation::FILL_MODE_NONE); animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000)); - grand_child->layer_animation_controller()->AddAnimation(animation.Pass()); + grand_child->layer_animation_controller()->AddAnimation(std::move(animation)); ExecuteCalculateDrawProperties(parent); @@ -3279,10 +3279,10 @@ TEST_F(LayerTreeHostCommonTest, host_impl.SetViewportSize(root->bounds()); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); - root->AddChild(occluding_child.Pass()); - host_impl.active_tree()->SetRootLayer(root.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); + root->AddChild(std::move(occluding_child)); + host_impl.active_tree()->SetRootLayer(std::move(root)); host_impl.SetVisible(true); host_impl.InitializeRenderer(output_surface.get()); host_impl.active_tree()->BuildPropertyTreesForTesting(); @@ -4720,7 +4720,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) { SetLayerPropertiesForTesting(replica.get(), replica_transform, gfx::Point3F(), gfx::PointF(2.f, 2.f), gfx::Size(10, 10), false, true, false); - child->SetReplicaLayer(replica.Pass()); + child->SetReplicaLayer(std::move(replica)); // This layer should end up in the same surface as child, with the same draw // and screen space transforms. @@ -4831,7 +4831,7 @@ TEST_F(LayerTreeHostCommonTest, SetLayerPropertiesForTesting(replica.get(), replica_transform, gfx::Point3F(), gfx::PointF(), gfx::Size(13, 11), false, true, false); - child->SetReplicaLayer(replica.Pass()); + child->SetReplicaLayer(std::move(replica)); float device_scale_factor = 1.7f; ExecuteCalculateDrawProperties(parent, device_scale_factor); @@ -4959,7 +4959,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) { AddOpacityTransitionToController( child->layer_animation_controller(), 10.0, 0.0f, 1.0f, false); - root->AddChild(child.Pass()); + root->AddChild(std::move(child)); root->SetHasRenderSurface(true); LayerImplList render_surface_layer_list; @@ -5004,9 +5004,9 @@ class LCDTextTest : public LayerTreeHostCommonTestBase, child_ = child_ptr.get(); grand_child_ = grand_child_ptr.get(); - child_->AddChild(grand_child_ptr.Pass()); - root_->AddChild(child_ptr.Pass()); - host_impl_.active_tree()->SetRootLayer(root_ptr.Pass()); + child_->AddChild(std::move(grand_child_ptr)); + root_->AddChild(std::move(child_ptr)); + host_impl_.active_tree()->SetRootLayer(std::move(root_ptr)); root_->SetContentsOpaque(true); child_->SetContentsOpaque(true); @@ -5229,8 +5229,8 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) { grand_child->SetDrawsContent(true); grand_child->SetHideLayerAndSubtree(true); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); root->SetHasRenderSurface(true); LayerImplList render_surface_layer_list; @@ -5276,8 +5276,8 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) { true, false, false); grand_child->SetDrawsContent(true); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( @@ -5359,12 +5359,12 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) { LayerImpl* copy_grand_parent_sibling_after_layer = copy_grand_parent_sibling_after.get(); - copy_request->AddChild(copy_child.Pass()); - copy_parent->AddChild(copy_request.Pass()); - copy_grand_parent->AddChild(copy_parent.Pass()); - root->AddChild(copy_grand_parent_sibling_before.Pass()); - root->AddChild(copy_grand_parent.Pass()); - root->AddChild(copy_grand_parent_sibling_after.Pass()); + copy_request->AddChild(std::move(copy_child)); + copy_parent->AddChild(std::move(copy_request)); + copy_grand_parent->AddChild(std::move(copy_parent)); + root->AddChild(std::move(copy_grand_parent_sibling_before)); + root->AddChild(std::move(copy_grand_parent)); + root->AddChild(std::move(copy_grand_parent_sibling_after)); // Hide the copy_grand_parent and its subtree. But make a copy request in that // hidden subtree on copy_layer. @@ -5470,9 +5470,9 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) { copy_layer->PassCopyRequests(©_requests); EXPECT_TRUE(copy_layer->HasCopyRequest()); - copy_layer->AddChild(copy_child.Pass()); - copy_parent->AddChild(copy_layer.Pass()); - root->AddChild(copy_parent.Pass()); + copy_layer->AddChild(std::move(copy_child)); + copy_parent->AddChild(std::move(copy_layer)); + root->AddChild(std::move(copy_parent)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( @@ -5969,9 +5969,9 @@ TEST_F(LayerTreeHostCommonTest, make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); Layer* child3 = child_3.get(); - parent->AddChild(child_1.Pass()); - child1->AddChild(child_2.Pass()); - child2->AddChild(child_3.Pass()); + parent->AddChild(std::move(child_1)); + child1->AddChild(std::move(child_2)); + child2->AddChild(std::move(child_3)); host()->SetRootLayer(root); @@ -6039,9 +6039,9 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) { child2->Set3dSortingContextId(1); child3->Set3dSortingContextId(1); - child2->AddChild(child3.Pass()); - child1->AddChild(child2.Pass()); - root->AddChild(child1.Pass()); + child2->AddChild(std::move(child3)); + child1->AddChild(std::move(child2)); + root->AddChild(std::move(child1)); { LayerImplList render_surface_layer_list; @@ -6651,9 +6651,9 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) { container->SetDrawsContent(true); scroller->SetDrawsContent(true); fixed->SetDrawsContent(true); - scroller->AddChild(fixed.Pass()); - container->AddChild(scroller.Pass()); - root->AddChild(container.Pass()); + scroller->AddChild(std::move(fixed)); + container->AddChild(std::move(scroller)); + root->AddChild(std::move(container)); // Rounded to integers already. { @@ -6792,9 +6792,9 @@ TEST_F(LayerTreeHostCommonTest, scroll_layer->SetScrollDelta(scroll_delta); scroll_layer->SetScrollCompensationAdjustment(main_scroll_fractional_part); - scroller->AddChild(fixed.Pass()); - container->AddChild(scroller.Pass()); - root->AddChild(container.Pass()); + scroller->AddChild(std::move(fixed)); + container->AddChild(std::move(scroller)); + root->AddChild(std::move(container)); LayerImplList render_surface_layer_list; LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( @@ -6915,9 +6915,9 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) { AnimationScaleFactorTrackingLayerImpl* child_raw = child.get(); AnimationScaleFactorTrackingLayerImpl* grand_child_raw = grand_child.get(); - child->AddChild(grand_child.Pass()); - parent->AddChild(child.Pass()); - grand_parent->AddChild(parent.Pass()); + child->AddChild(std::move(grand_child)); + parent->AddChild(std::move(child)); + grand_parent->AddChild(std::move(parent)); SetLayerPropertiesForTesting(grand_parent.get(), identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(1, 2), @@ -7244,10 +7244,10 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) { LayerImpl* grand_child1_raw = grand_child1.get(); LayerImpl* grand_child2_raw = grand_child2.get(); - child->AddChild(grand_child1.Pass()); - child->AddChild(grand_child2.Pass()); - parent->AddChild(child.Pass()); - grand_parent->AddChild(parent.Pass()); + child->AddChild(std::move(grand_child1)); + child->AddChild(std::move(grand_child2)); + parent->AddChild(std::move(child)); + grand_parent->AddChild(std::move(parent)); SetLayerPropertiesForTesting(grand_parent_raw, identity_matrix, gfx::Point3F(), gfx::PointF(), gfx::Size(1, 2), @@ -7376,7 +7376,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) { scoped_ptr replica_layer = LayerImpl::Create(host_impl.active_tree(), 20); replica_layer->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 21)); - child_raw->SetReplicaLayer(replica_layer.Pass()); + child_raw->SetReplicaLayer(std::move(replica_layer)); child_raw->layer_tree_impl()->property_trees()->needs_rebuild = true; ExecuteCalculateDrawProperties(grand_parent_raw); @@ -7487,8 +7487,8 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) { scoped_ptr child2 = LayerImpl::Create(host_impl.active_tree(), 3); LayerImpl* child2_layer = child2.get(); - root->AddChild(child1.Pass()); - root->AddChild(child2.Pass()); + root->AddChild(std::move(child1)); + root->AddChild(std::move(child2)); root->SetHasRenderSurface(true); root->SetDrawsContent(true); @@ -7512,7 +7512,7 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) { LayerImpl::Create(host_impl.active_tree(), 5); replica_layer->SetHasRenderSurface(true); replica_layer->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 6)); - child1_layer->SetReplicaLayer(replica_layer.Pass()); + child1_layer->SetReplicaLayer(std::move(replica_layer)); child1_layer->SetHasRenderSurface(true); ExecuteCalculateDrawProperties(root_layer); @@ -7974,10 +7974,10 @@ TEST_F(LayerTreeHostCommonTest, DelayedFilterAnimationCreatesRenderSurface) { curve->AddKeyframe(FilterKeyframe::Create( base::TimeDelta::FromMilliseconds(100), end_filters, nullptr)); scoped_ptr animation = - Animation::Create(curve.Pass(), 0, 1, Animation::FILTER); + Animation::Create(std::move(curve), 0, 1, Animation::FILTER); animation->set_fill_mode(Animation::FILL_MODE_NONE); animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000)); - child->layer_animation_controller()->AddAnimation(animation.Pass()); + child->layer_animation_controller()->AddAnimation(std::move(animation)); ExecuteCalculateDrawProperties(root.get()); @@ -8418,7 +8418,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) { animation_id, 1, Animation::TRANSFORM); animation->set_fill_mode(Animation::FILL_MODE_NONE); animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000)); - child->AddAnimation(animation.Pass()); + child->AddAnimation(std::move(animation)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_rect_from_property_trees()); grandchild->set_visible_rect_from_property_trees(gfx::Rect()); @@ -8445,7 +8445,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) { animation_id, 1, Animation::OPACITY); animation->set_fill_mode(Animation::FILL_MODE_NONE); animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000)); - child->AddAnimation(animation.Pass()); + child->AddAnimation(std::move(animation)); ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_rect_from_property_trees()); } @@ -8487,9 +8487,9 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeImpl) { LayerImpl* grandchild_ptr = grandchild.get(); LayerImpl* greatgrandchild_ptr = greatgrandchild.get(); - grandchild->AddChild(greatgrandchild.Pass()); - child->AddChild(grandchild.Pass()); - root->AddChild(child.Pass()); + grandchild->AddChild(std::move(greatgrandchild)); + child->AddChild(std::move(grandchild)); + root->AddChild(std::move(child)); // Check the non-skipped case. ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get()); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 47ed7875383350..4034179e8574ed 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -478,7 +478,7 @@ void LayerTreeHostImpl::StartPageScaleAnimation( page_scale_animation_ = PageScaleAnimation::Create( ScrollOffsetToVector2dF(scroll_total), active_tree_->current_page_scale_factor(), viewport_size, - scaled_scrollable_size, timing_function.Pass()); + scaled_scrollable_size, std::move(timing_function)); if (anchor_point) { gfx::Vector2dF anchor(target_offset); @@ -611,7 +611,8 @@ ScrollElasticityHelper* LayerTreeHostImpl::CreateScrollElasticityHelper() { void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate( scoped_ptr swap_promise) { - swap_promises_for_main_thread_scroll_update_.push_back(swap_promise.Pass()); + swap_promises_for_main_thread_scroll_update_.push_back( + std::move(swap_promise)); } void LayerTreeHostImpl::TrackDamageForAllSurfaces( @@ -659,7 +660,7 @@ void LayerTreeHostImpl::FrameData::AsValueInto( void LayerTreeHostImpl::FrameData::AppendRenderPass( scoped_ptr render_pass) { - render_passes.push_back(render_pass.Pass()); + render_passes.push_back(std::move(render_pass)); } DrawMode LayerTreeHostImpl::GetDrawMode() const { @@ -2224,8 +2225,8 @@ void LayerTreeHostImpl::RecordMainFrameTiming( void LayerTreeHostImpl::PostFrameTimingEvents( scoped_ptr composite_events, scoped_ptr main_frame_events) { - client_->PostFrameTimingEventsOnImplThread(composite_events.Pass(), - main_frame_events.Pass()); + client_->PostFrameTimingEventsOnImplThread(std::move(composite_events), + std::move(main_frame_events)); } void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() { @@ -3028,7 +3029,7 @@ scoped_ptr LayerTreeHostImpl::ProcessScrollDeltas() { active_tree_->elastic_overscroll()->PullDeltaForMainThread(); scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_); - return scroll_info.Pass(); + return scroll_info; } void LayerTreeHostImpl::SetFullRootLayerDamage() { @@ -3155,7 +3156,7 @@ void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { } if (!events->empty()) - client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass()); + client_->PostAnimationEventsToMainThreadOnImplThread(std::move(events)); if (has_active_animations) SetNeedsAnimate(); @@ -3450,7 +3451,7 @@ void LayerTreeHostImpl::MarkUIResourceNotEvicted(UIResourceId uid) { void LayerTreeHostImpl::ScheduleMicroBenchmark( scoped_ptr benchmark) { - micro_benchmark_controller_.ScheduleRun(benchmark.Pass()); + micro_benchmark_controller_.ScheduleRun(std::move(benchmark)); } void LayerTreeHostImpl::InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) { @@ -3498,11 +3499,11 @@ void LayerTreeHostImpl::ScrollAnimationCreate( curve->SetInitialValue(current_offset); scoped_ptr animation = Animation::Create( - curve.Pass(), AnimationIdProvider::NextAnimationId(), + std::move(curve), AnimationIdProvider::NextAnimationId(), AnimationIdProvider::NextGroupId(), Animation::SCROLL_OFFSET); animation->set_is_impl_only(true); - layer_impl->layer_animation_controller()->AddAnimation(animation.Pass()); + layer_impl->layer_animation_controller()->AddAnimation(std::move(animation)); } bool LayerTreeHostImpl::ScrollAnimationUpdateTarget( diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 80cd9672dbd27d..431a54660fc525 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -166,7 +166,7 @@ class LayerTreeHostImplTest : public testing::Test, settings, this, &task_runner_provider_, &stats_instrumentation_, &shared_bitmap_manager_, &gpu_memory_buffer_manager_, &task_graph_runner_, 0); - output_surface_ = output_surface.Pass(); + output_surface_ = std::move(output_surface); host_impl_->SetVisible(true); bool init = host_impl_->InitializeRenderer(output_surface_.get()); host_impl_->SetViewportSize(gfx::Size(10, 10)); @@ -185,7 +185,7 @@ class LayerTreeHostImplTest : public testing::Test, root->SetDrawsContent(true); root->draw_properties().visible_layer_rect = gfx::Rect(0, 0, 10, 10); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); } static void ExpectClearedScrollDeltasRecursive(LayerImpl* layer) { @@ -282,14 +282,14 @@ class LayerTreeHostImplTest : public testing::Test, contents->SetBounds(content_size); contents->SetPosition(gfx::PointF()); - outer_scroll->AddChild(contents.Pass()); - outer_clip->AddChild(outer_scroll.Pass()); - inner_scroll->AddChild(outer_clip.Pass()); - page_scale->AddChild(inner_scroll.Pass()); - inner_clip->AddChild(page_scale.Pass()); - root->AddChild(inner_clip.Pass()); + outer_scroll->AddChild(std::move(contents)); + outer_clip->AddChild(std::move(outer_scroll)); + inner_scroll->AddChild(std::move(outer_clip)); + page_scale->AddChild(std::move(inner_scroll)); + inner_clip->AddChild(std::move(page_scale)); + root->AddChild(std::move(inner_clip)); - layer_tree_impl->SetRootLayer(root.Pass()); + layer_tree_impl->SetRootLayer(std::move(root)); layer_tree_impl->SetViewportLayersFromIds( Layer::INVALID_ID, kPageScaleLayerId, kInnerViewportScrollLayerId, kOuterViewportScrollLayerId); @@ -345,7 +345,7 @@ class LayerTreeHostImplTest : public testing::Test, layer->SetDrawsContent(true); layer->SetBounds(size); clip_layer->SetBounds(gfx::Size(size.width() / 2, size.height() / 2)); - return layer.Pass(); + return layer; } void DrawFrame() { @@ -497,7 +497,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDeltaTreeButNoChanges) { LayerImpl::Create(host_impl_->active_tree(), 5)); root->children()[1]->children()[0]->AddChild( LayerImpl::Create(host_impl_->active_tree(), 6)); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); } LayerImpl* root = host_impl_->active_tree()->root_layer(); @@ -524,12 +524,12 @@ TEST_F(LayerTreeHostImplTest, ScrollDeltaRepeatedScrolls) { LayerImpl::Create(host_impl_->active_tree(), 1); root_clip->SetBounds(gfx::Size(10, 10)); LayerImpl* root_layer = root.get(); - root_clip->AddChild(root.Pass()); + root_clip->AddChild(std::move(root)); root_layer->SetBounds(gfx::Size(110, 110)); root_layer->SetScrollClipLayer(root_clip->id()); root_layer->PushScrollOffsetFromMainThread(scroll_offset); root_layer->ScrollBy(scroll_delta); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); } LayerImpl* root = host_impl_->active_tree()->root_layer()->children()[0].get(); @@ -598,8 +598,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) { context_owned->set_context_lost(true); // Initialization will fail. - EXPECT_FALSE(CreateHostImpl( - DefaultSettings(), FakeOutputSurface::Create3d(context_owned.Pass()))); + EXPECT_FALSE( + CreateHostImpl(DefaultSettings(), + FakeOutputSurface::Create3d(std::move(context_owned)))); SetupScrollAndContentsLayers(gfx::Size(100, 100)); @@ -677,7 +678,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnTouchEventHandlers) { child_layer->SetDrawsContent(true); child_layer->SetPosition(gfx::PointF(0, 20)); child_layer->SetBounds(gfx::Size(50, 50)); - scroll->AddChild(child_layer.Pass()); + scroll->AddChild(std::move(child_layer)); RebuildPropertyTrees(); } @@ -759,8 +760,8 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnLayerTopology) { scrollable_child_1->SetPosition(gfx::PointF(5.f, 5.f)); scrollable_child_1->SetHaveWheelEventHandlers(true); scrollable_child_1->SetHaveScrollEventHandlers(true); - scrollable_child_clip_1->AddChild(scrollable_child_1.Pass()); - root_child->AddChild(scrollable_child_clip_1.Pass()); + scrollable_child_clip_1->AddChild(std::move(scrollable_child_1)); + root_child->AddChild(std::move(scrollable_child_clip_1)); RebuildPropertyTrees(); } @@ -774,8 +775,8 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnLayerTopology) { scrollable_child_2->SetPosition(gfx::PointF(5.f, 20.f)); scrollable_child_2->SetHaveWheelEventHandlers(true); scrollable_child_2->SetHaveScrollEventHandlers(true); - scrollable_child_clip_2->AddChild(scrollable_child_2.Pass()); - root_child->AddChild(scrollable_child_clip_2.Pass()); + scrollable_child_clip_2->AddChild(std::move(scrollable_child_2)); + root_child->AddChild(std::move(scrollable_child_clip_2)); RebuildPropertyTrees(); } @@ -1571,7 +1572,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithSwapPromises) { EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE)); host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10)); - host_impl_->QueueSwapPromiseForMainThreadScrollUpdate(swap_promise.Pass()); + host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( + std::move(swap_promise)); host_impl_->ScrollEnd(); scoped_ptr scroll_info = host_impl_->ProcessScrollDeltas(); @@ -1597,9 +1599,9 @@ TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) { scoped_ptr scroll_parent = CreateScrollableLayer( 7, gfx::Size(10, 10), scroll_parent_clip.get()); parent = scroll_parent.get(); - scroll_parent_clip->AddChild(scroll_parent.Pass()); + scroll_parent_clip->AddChild(std::move(scroll_parent)); - viewport_scroll->AddChild(scroll_parent_clip.Pass()); + viewport_scroll->AddChild(std::move(scroll_parent_clip)); scoped_ptr scroll_child_clip = LayerImpl::Create(host_impl_->active_tree(), 8); @@ -1607,10 +1609,10 @@ TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) { 9, gfx::Size(10, 10), scroll_child_clip.get()); child = scroll_child.get(); scroll_child->SetPosition(gfx::PointF(20.f, 20.f)); - scroll_child_clip->AddChild(scroll_child.Pass()); + scroll_child_clip->AddChild(std::move(scroll_child)); child_clip = scroll_child_clip.get(); - viewport_scroll->AddChild(scroll_child_clip.Pass()); + viewport_scroll->AddChild(std::move(scroll_child_clip)); child_clip->SetScrollParent(parent); scoped_ptr> scroll_children(new std::set); @@ -2212,7 +2214,7 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { LayerImpl* scroll = host_impl_->active_tree()->OuterViewportScrollLayer(); LayerImpl* root = host_impl_->active_tree()->InnerViewportContainerLayer(); scrollbar->SetScrollLayerId(scroll->id()); - root->AddChild(scrollbar.Pass()); + root->AddChild(std::move(scrollbar)); host_impl_->active_tree()->DidBecomeActive(); DrawFrame(); @@ -2348,7 +2350,7 @@ class LayerTreeHostImplTestScrollbarOpacity : public LayerTreeHostImplTest { LayerImpl* scroll = host_impl_->pending_tree()->OuterViewportScrollLayer(); LayerImpl* root = host_impl_->pending_tree()->InnerViewportContainerLayer(); scrollbar->SetScrollLayerId(scroll->id()); - root->AddChild(scrollbar.Pass()); + root->AddChild(std::move(scrollbar)); host_impl_->pending_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f); host_impl_->pending_tree()->BuildPropertyTreesForTesting(); host_impl_->ActivateSyncTree(); @@ -2495,8 +2497,8 @@ TEST_F(LayerTreeHostImplTest, ScrollbarRegistration) { // Check scrollbar registration on a sublayer. child->SetScrollClipLayer(child_clip->id()); - child_clip->AddChild(child.Pass()); - root_scroll->AddChild(child_clip.Pass()); + child_clip->AddChild(std::move(child)); + root_scroll->AddChild(std::move(child_clip)); EXPECT_EQ(0ul, host_impl_->ScrollbarsFor(child_scroll_id).size()); EXPECT_EQ(nullptr, host_impl_->ScrollbarAnimationControllerForId(child_scroll_id)); @@ -2574,7 +2576,7 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale( scrollbar->SetBounds(scrollbar_size); scrollbar->SetTouchEventHandlerRegion(gfx::Rect(scrollbar_size)); host_impl_->active_tree()->InnerViewportContainerLayer()->AddChild( - scrollbar.Pass()); + std::move(scrollbar)); host_impl_->active_tree()->DidBecomeActive(); DrawFrame(); @@ -3257,7 +3259,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) { scoped_ptr root = LayerImpl::Create(host_impl_->active_tree(), 1); root->SetScrollClipLayer(Layer::INVALID_ID); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); DrawFrame(); // Scroll event is ignored because layer is not scrollable. @@ -3301,8 +3303,8 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest { bool CreateHostImpl(const LayerTreeSettings& settings, scoped_ptr output_surface) override { - bool init = - LayerTreeHostImplTest::CreateHostImpl(settings, output_surface.Pass()); + bool init = LayerTreeHostImplTest::CreateHostImpl( + settings, std::move(output_surface)); if (init) { host_impl_->active_tree()->set_top_controls_height(top_controls_height_); host_impl_->active_tree()->SetCurrentTopControlsShownRatio(1.f); @@ -3350,12 +3352,12 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest { int outer_viewport_scroll_layer_id = outer_scroll->id(); int page_scale_layer_id = page_scale->id(); - outer_clip->AddChild(outer_scroll.Pass()); - root->AddChild(outer_clip.Pass()); - page_scale->AddChild(root.Pass()); - root_clip->AddChild(page_scale.Pass()); + outer_clip->AddChild(std::move(outer_scroll)); + root->AddChild(std::move(outer_clip)); + page_scale->AddChild(std::move(root)); + root_clip->AddChild(std::move(page_scale)); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->SetViewportLayersFromIds( Layer::INVALID_ID, page_scale_layer_id, inner_viewport_scroll_layer_id, outer_viewport_scroll_layer_id); @@ -3641,8 +3643,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollableSublayer) { // scroll child to limit child->SetScrollDelta(gfx::Vector2dF(0, 100.f)); - child_clip->AddChild(child.Pass()); - outer_viewport_scroll_layer->AddChild(child_clip.Pass()); + child_clip->AddChild(std::move(child)); + outer_viewport_scroll_layer->AddChild(std::move(child_clip)); // Scroll 25px to hide top controls gfx::Vector2dF scroll_delta(0.f, 25.f); @@ -4015,11 +4017,11 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) { scroll_layer->SetScrollClipLayer(3); scroll_layer->SetBounds(contents_size); scroll_layer->SetPosition(gfx::PointF()); - scroll_layer->AddChild(content_layer.Pass()); - scroll_clip_layer->AddChild(scroll_layer.Pass()); + scroll_layer->AddChild(std::move(content_layer)); + scroll_clip_layer->AddChild(std::move(scroll_layer)); scroll_clip_layer->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(scroll_clip_layer.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(scroll_clip_layer)); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -4038,7 +4040,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) { root->SetBounds(surface_size); root->AddChild(CreateScrollableLayer(2, contents_size, root.get())); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -4055,7 +4057,7 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) { scoped_ptr root = LayerImpl::Create(host_impl_->active_tree(), 1); root->AddChild(CreateScrollableLayer(2, surface_size, root.get())); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -4080,8 +4082,8 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesBackfacingChild) { child->SetTransform(matrix); child->SetDoubleSided(false); - root->AddChild(child.Pass()); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + root->AddChild(std::move(child)); + host_impl_->active_tree()->SetRootLayer(std::move(root)); DrawFrame(); // Scroll event is ignored because the scrollable layer is not facing the @@ -4105,11 +4107,11 @@ TEST_F(LayerTreeHostImplTest, ScrollBlockedByContentLayer) { // CreateScrollableLayer() use the same surface size. scoped_ptr scroll_layer = CreateScrollableLayer(2, surface_size, clip_layer.get()); - scroll_layer->AddChild(content_layer.Pass()); - clip_layer->AddChild(scroll_layer.Pass()); + scroll_layer->AddChild(std::move(content_layer)); + clip_layer->AddChild(std::move(scroll_layer)); clip_layer->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(clip_layer.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(clip_layer)); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -4232,8 +4234,8 @@ TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) { LayerImpl::Create(host_impl_->active_tree(), 6); scoped_ptr scrollable_child = CreateScrollableLayer(7, surface_size, scrollable_child_clip.get()); - scrollable_child_clip->AddChild(scrollable_child.Pass()); - child->AddChild(scrollable_child_clip.Pass()); + scrollable_child_clip->AddChild(std::move(scrollable_child)); + child->AddChild(std::move(scrollable_child_clip)); LayerImpl* grand_child = child->children()[0].get(); grand_child->SetDrawsContent(true); @@ -4316,11 +4318,11 @@ TEST_F(LayerTreeHostImplTest, ScrollChildBeyondLimit) { scoped_ptr child = CreateScrollableLayer(2, content_size, root.get()); LayerImpl* grand_child_layer = grand_child.get(); - child->AddChild(grand_child.Pass()); + child->AddChild(std::move(grand_child)); LayerImpl* child_layer = child.get(); - root->AddChild(child.Pass()); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + root->AddChild(std::move(child)); + host_impl_->active_tree()->SetRootLayer(std::move(root)); host_impl_->active_tree()->DidBecomeActive(); host_impl_->SetViewportSize(surface_size); grand_child_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 5)); @@ -4366,13 +4368,13 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) { scoped_ptr child = CreateScrollableLayer(3, surface_size, root.get()); LayerImpl* grand_child_layer = grand_child.get(); - child->AddChild(grand_child.Pass()); + child->AddChild(std::move(grand_child)); LayerImpl* child_layer = child.get(); - root_scrolling->AddChild(child.Pass()); - root->AddChild(root_scrolling.Pass()); + root_scrolling->AddChild(std::move(child)); + root->AddChild(std::move(root_scrolling)); EXPECT_EQ(viewport_size, root->bounds()); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); host_impl_->active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 1, 2, Layer::INVALID_ID); host_impl_->active_tree()->DidBecomeActive(); @@ -4482,11 +4484,11 @@ TEST_F(LayerTreeHostImplTest, ScrollEventBubbling) { root->SetBounds(content_size); int root_scroll_id = root->id(); - root->AddChild(child.Pass()); - root_clip->AddChild(root.Pass()); + root->AddChild(std::move(child)); + root_clip->AddChild(std::move(root)); host_impl_->SetViewportSize(surface_size); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 3, 2, Layer::INVALID_ID); host_impl_->active_tree()->DidBecomeActive(); @@ -4516,8 +4518,8 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) { CreateScrollableLayer(2, surface_size, root_clip.get()); root_scroll->SetIsContainerForFixedPositionLayers(true); root_clip->SetHasRenderSurface(true); - root_clip->AddChild(root_scroll.Pass()); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + root_clip->AddChild(std::move(root_scroll)); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 1, 2, Layer::INVALID_ID); host_impl_->active_tree()->DidBecomeActive(); @@ -4532,9 +4534,9 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) { scoped_ptr root_scroll2 = CreateScrollableLayer(4, surface_size, root_clip2.get()); root_scroll2->SetIsContainerForFixedPositionLayers(true); - root_clip2->AddChild(root_scroll2.Pass()); + root_clip2->AddChild(std::move(root_scroll2)); root_clip2->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root_clip2.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip2)); host_impl_->active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 3, 4, Layer::INVALID_ID); host_impl_->active_tree()->DidBecomeActive(); @@ -4610,8 +4612,8 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) { clip_layer->SetTransformOrigin(gfx::Point3F( clip_layer->bounds().width() * 0.5f, clip_layer->bounds().height(), 0.f)); LayerImpl* child_ptr = child.get(); - clip_layer->AddChild(child.Pass()); - scroll_layer->AddChild(clip_layer.Pass()); + clip_layer->AddChild(std::move(child)); + scroll_layer->AddChild(std::move(clip_layer)); gfx::Size surface_size(50, 50); host_impl_->SetViewportSize(surface_size); @@ -4688,8 +4690,8 @@ TEST_F(LayerTreeHostImplTest, ScrollPerspectiveTransformedLayer) { // lines up over the child. clip_layer->SetTransformOrigin(gfx::Point3F( clip_layer->bounds().width(), clip_layer->bounds().height(), 0.f)); - clip_layer->AddChild(child.Pass()); - scroll_layer->AddChild(clip_layer.Pass()); + clip_layer->AddChild(std::move(child)); + scroll_layer->AddChild(std::move(clip_layer)); gfx::Size surface_size(50, 50); host_impl_->SetViewportSize(surface_size); @@ -5116,14 +5118,14 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) { scoped_ptr child = CreateScrollableLayer(2, surface_size, root_clip.get()); LayerImpl* grand_child_layer = grand_child.get(); - child->AddChild(grand_child.Pass()); + child->AddChild(std::move(grand_child)); LayerImpl* child_layer = child.get(); - root->AddChild(child.Pass()); - root_clip->AddChild(root.Pass()); + root->AddChild(std::move(child)); + root_clip->AddChild(std::move(root)); child_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 3)); grand_child_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 2)); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->DidBecomeActive(); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -5363,7 +5365,7 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) { root->SetBounds(gfx::Size(10, 10)); root->SetDrawsContent(false); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); } LayerImpl* root = host_impl_->active_tree()->root_layer(); @@ -5852,14 +5854,14 @@ TEST_F(LayerTreeHostImplTest, ReshapeNotCalledUntilDraw) { scoped_refptr provider(TestContextProvider::Create()); scoped_ptr output_surface( FakeOutputSurface::Create3d(provider)); - CreateHostImpl(DefaultSettings(), output_surface.Pass()); + CreateHostImpl(DefaultSettings(), std::move(output_surface)); scoped_ptr root = FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 1); root->SetBounds(gfx::Size(10, 10)); root->SetDrawsContent(true); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); EXPECT_FALSE(provider->TestContext3d()->reshape_called()); provider->TestContext3d()->clear_reshape_called(); @@ -5932,8 +5934,8 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) { child->SetDrawsContent(true); root->SetBounds(gfx::Size(500, 500)); root->SetDrawsContent(true); - root->AddChild(child.Pass()); - layer_tree_host_impl->active_tree()->SetRootLayer(root.Pass()); + root->AddChild(std::move(child)); + layer_tree_host_impl->active_tree()->SetRootLayer(std::move(root)); LayerTreeHostImpl::FrameData frame; @@ -5991,9 +5993,9 @@ TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) { root->SetBounds(gfx::Size(10, 10)); root->SetDrawsContent(true); root->SetHasRenderSurface(true); - root->AddChild(child.Pass()); + root->AddChild(std::move(child)); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); LayerTreeHostImpl::FrameData frame; @@ -6125,7 +6127,7 @@ TEST_F(LayerTreeHostImplTest, NoPartialSwap) { LayerTreeSettings settings = DefaultSettings(); settings.renderer_settings.partial_swap_enabled = false; CreateHostImpl(settings, - FakeOutputSurface::Create3d(mock_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(mock_context_owned))); SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1)); // Without partial swap, and no clipping, no scissor is set. @@ -6160,7 +6162,8 @@ TEST_F(LayerTreeHostImplTest, PartialSwap) { LayerTreeSettings settings = DefaultSettings(); settings.renderer_settings.partial_swap_enabled = true; - CreateHostImpl(settings, FakeOutputSurface::Create3d(context_owned.Pass())); + CreateHostImpl(settings, + FakeOutputSurface::Create3d(std::move(context_owned))); SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1)); // The first frame is not a partially-swapped one. No scissor should be set. @@ -6257,12 +6260,12 @@ static scoped_ptr SetupLayersForOpacity( grand_child->draw_properties().visible_layer_rect = grand_child_rect; grand_child->SetDrawsContent(true); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); - my_host_impl->active_tree()->SetRootLayer(root.Pass()); + my_host_impl->active_tree()->SetRootLayer(std::move(root)); my_host_impl->active_tree()->BuildPropertyTreesForTesting(); - return my_host_impl.Pass(); + return my_host_impl; } TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) { @@ -6328,8 +6331,8 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { TestWebGraphicsContext3D::Create(); TestWebGraphicsContext3D* context3d = context.get(); scoped_ptr output_surface( - FakeOutputSurface::Create3d(context.Pass())); - CreateHostImpl(DefaultSettings(), output_surface.Pass()); + FakeOutputSurface::Create3d(std::move(context))); + CreateHostImpl(DefaultSettings(), std::move(output_surface)); scoped_ptr root_layer = LayerImpl::Create(host_impl_->active_tree(), 1); @@ -6345,16 +6348,16 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); video_layer->SetBounds(gfx::Size(10, 10)); video_layer->SetDrawsContent(true); - root_layer->AddChild(video_layer.Pass()); + root_layer->AddChild(std::move(video_layer)); scoped_ptr io_surface_layer = IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); io_surface_layer->SetBounds(gfx::Size(10, 10)); io_surface_layer->SetDrawsContent(true); io_surface_layer->SetIOSurfaceProperties(1, gfx::Size(10, 10)); - root_layer->AddChild(io_surface_layer.Pass()); + root_layer->AddChild(std::move(io_surface_layer)); - host_impl_->active_tree()->SetRootLayer(root_layer.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); EXPECT_EQ(0u, context3d->NumTextures()); @@ -6391,7 +6394,7 @@ TEST_F(LayerTreeHostImplTest, HasTransparentBackground) { LayerTreeSettings settings = DefaultSettings(); settings.renderer_settings.partial_swap_enabled = false; CreateHostImpl(settings, - FakeOutputSurface::Create3d(mock_context_owned.Pass())); + FakeOutputSurface::Create3d(std::move(mock_context_owned))); SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1)); host_impl_->active_tree()->set_background_color(SK_ColorWHITE); @@ -6475,9 +6478,9 @@ TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) { child->SetPosition(gfx::PointF(9.f, 9.f)); child->SetBounds(gfx::Size(1, 1)); child->SetDrawsContent(true); - root->AddChild(child.Pass()); + root->AddChild(std::move(child)); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); // Draw a frame. In the first frame, the entire viewport should be damaged. gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); @@ -6543,12 +6546,12 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) { LayerImpl* root = scoped_root.get(); root->SetHasRenderSurface(true); - host_impl_->pending_tree()->SetRootLayer(scoped_root.Pass()); + host_impl_->pending_tree()->SetRootLayer(std::move(scoped_root)); scoped_ptr scoped_scrolling_layer = LayerImpl::Create(host_impl_->pending_tree(), 2); LayerImpl* scrolling_layer = scoped_scrolling_layer.get(); - root->AddChild(scoped_scrolling_layer.Pass()); + root->AddChild(std::move(scoped_scrolling_layer)); gfx::Size content_layer_bounds(100000, 100); scoped_refptr raster_source( @@ -6558,7 +6561,7 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) { FakePictureLayerImpl::CreateWithRasterSource(host_impl_->pending_tree(), 3, raster_source); LayerImpl* content_layer = scoped_content_layer.get(); - scrolling_layer->AddChild(scoped_content_layer.Pass()); + scrolling_layer->AddChild(std::move(scoped_content_layer)); content_layer->SetBounds(content_layer_bounds); content_layer->SetDrawsContent(true); @@ -6704,8 +6707,8 @@ TEST_F(LayerTreeHostImplTest, host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); video_layer->SetBounds(gfx::Size(10, 10)); video_layer->SetDrawsContent(true); - root_layer->AddChild(video_layer.Pass()); - SetupRootLayerImpl(root_layer.Pass()); + root_layer->AddChild(std::move(video_layer)); + SetupRootLayerImpl(std::move(root_layer)); LayerTreeHostImpl::FrameData frame; EXPECT_EQ(DRAW_SUCCESS, PrepareToDrawFrame(&frame)); @@ -6811,7 +6814,7 @@ TEST_F(LayerTreeHostImplTest, UIResourceManagement) { TestWebGraphicsContext3D::Create(); TestWebGraphicsContext3D* context3d = context.get(); scoped_ptr output_surface = FakeOutputSurface::Create3d(); - CreateHostImpl(DefaultSettings(), output_surface.Pass()); + CreateHostImpl(DefaultSettings(), std::move(output_surface)); EXPECT_EQ(0u, context3d->NumTextures()); @@ -6927,12 +6930,12 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldNotBubble) { scoped_ptr child = CreateScrollableLayer(2, content_size, root_clip.get()); - root->AddChild(child.Pass()); + root->AddChild(std::move(child)); int root_id = root->id(); - root_clip->AddChild(root.Pass()); + root_clip->AddChild(std::move(root)); host_impl_->SetViewportSize(surface_size); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 3, 1, Layer::INVALID_ID); host_impl_->active_tree()->DidBecomeActive(); @@ -6974,11 +6977,11 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldContinueScrollingCurrentLayer) { scoped_ptr child = CreateScrollableLayer(3, surface_size, root.get()); child->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 4)); - child->AddChild(grand_child.Pass()); + child->AddChild(std::move(grand_child)); - root_scrolling->AddChild(child.Pass()); - root->AddChild(root_scrolling.Pass()); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + root_scrolling->AddChild(std::move(child)); + root->AddChild(std::move(root_scrolling)); + host_impl_->active_tree()->SetRootLayer(std::move(root)); host_impl_->active_tree()->DidBecomeActive(); host_impl_->SetViewportSize(surface_size); DrawFrame(); @@ -7041,11 +7044,11 @@ TEST_F(LayerTreeHostImplTest, WheelFlingShouldntBubble) { scoped_ptr child = CreateScrollableLayer(2, content_size, root_clip.get()); - root_scroll->AddChild(child.Pass()); - root_clip->AddChild(root_scroll.Pass()); + root_scroll->AddChild(std::move(child)); + root_clip->AddChild(std::move(root_scroll)); host_impl_->SetViewportSize(surface_size); - host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root_clip)); host_impl_->active_tree()->DidBecomeActive(); DrawFrame(); { @@ -7092,7 +7095,7 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownNotOnAncestorChain) { occluder_layer->SetPosition(gfx::PointF()); // The parent of the occluder is *above* the scroller. - page_scale_layer->AddChild(occluder_layer.Pass()); + page_scale_layer->AddChild(std::move(occluder_layer)); DrawFrame(); @@ -7129,8 +7132,8 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownScrollAncestorMismatch) { child_scroll->SetPosition(gfx::PointF(10.f, 10.f)); - child_scroll->AddChild(occluder_layer.Pass()); - scroll_layer->AddChild(child_scroll.Pass()); + child_scroll->AddChild(std::move(occluder_layer)); + scroll_layer->AddChild(std::move(child_scroll)); DrawFrame(); @@ -7153,7 +7156,7 @@ TEST_F(LayerTreeHostImplTest, NotScrollInvisibleScroller) { CreateScrollableLayer(child_scroll_layer_id, content_size, root); child_scroll->SetDrawsContent(false); - scroll_layer->AddChild(child_scroll.Pass()); + scroll_layer->AddChild(std::move(child_scroll)); DrawFrame(); @@ -7191,9 +7194,9 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleDescendent) { // Move the grand child so it's not hit by our test point. grand_child_layer->SetPosition(gfx::PointF(10.f, 10.f)); - child_layer->AddChild(grand_child_layer.Pass()); - invisible_scroll_layer->AddChild(child_layer.Pass()); - root_scroll_layer->AddChild(invisible_scroll_layer.Pass()); + child_layer->AddChild(std::move(grand_child_layer)); + invisible_scroll_layer->AddChild(std::move(child_layer)); + root_scroll_layer->AddChild(std::move(invisible_scroll_layer)); DrawFrame(); @@ -7242,10 +7245,10 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleScrollChild) { scroll_child->SetScrollParent(invisible_scroll.get()); - container->AddChild(invisible_scroll.Pass()); - container->AddChild(scroll_child.Pass()); + container->AddChild(std::move(invisible_scroll)); + container->AddChild(std::move(scroll_child)); - scroll_layer->AddChild(container.Pass()); + scroll_layer->AddChild(std::move(container)); DrawFrame(); @@ -7268,7 +7271,7 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) { root->SetDrawsContent(true); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); FakeOutputSurface* fake_output_surface = static_cast(host_impl_->output_surface()); @@ -7282,7 +7285,7 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) { ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); scoped_ptr swap_promise( new LatencyInfoSwapPromise(latency_info)); - host_impl_->active_tree()->QueuePinnedSwapPromise(swap_promise.Pass()); + host_impl_->active_tree()->QueuePinnedSwapPromise(std::move(swap_promise)); host_impl_->SetNeedsRedraw(); gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); @@ -7308,7 +7311,7 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) { root->SetDrawsContent(true); root->SetHasRenderSurface(true); - host_impl_->active_tree()->SetRootLayer(root.Pass()); + host_impl_->active_tree()->SetRootLayer(std::move(root)); // Ensure the default frame selection bounds are empty. FakeOutputSurface* fake_output_surface = @@ -7935,14 +7938,14 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest { contents->SetBounds(content_size); contents->SetPosition(gfx::PointF()); - outer_scroll->AddChild(contents.Pass()); - outer_clip->AddChild(outer_scroll.Pass()); - inner_scroll->AddChild(outer_clip.Pass()); - page_scale->AddChild(inner_scroll.Pass()); - inner_clip->AddChild(page_scale.Pass()); + outer_scroll->AddChild(std::move(contents)); + outer_clip->AddChild(std::move(outer_scroll)); + inner_scroll->AddChild(std::move(outer_clip)); + page_scale->AddChild(std::move(inner_scroll)); + inner_clip->AddChild(std::move(page_scale)); inner_clip->SetHasRenderSurface(true); - layer_tree_impl->SetRootLayer(inner_clip.Pass()); + layer_tree_impl->SetRootLayer(std::move(inner_clip)); layer_tree_impl->SetViewportLayersFromIds( Layer::INVALID_ID, kPageScaleLayerId, kInnerViewportScrollLayerId, kOuterViewportScrollLayerId); @@ -8107,7 +8110,7 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, scoped_ptr child = CreateScrollableLayer(10, outer_viewport, outer_scroll); LayerImpl* child_scroll = child.get(); - outer_scroll->children()[0]->AddChild(child.Pass()); + outer_scroll->children()[0]->AddChild(std::move(child)); DrawFrame(); { @@ -8164,7 +8167,7 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, scoped_ptr child = CreateScrollableLayer(10, outer_viewport, outer_scroll); LayerImpl* child_scroll = child.get(); - outer_scroll->children()[0]->AddChild(child.Pass()); + outer_scroll->children()[0]->AddChild(std::move(child)); DrawFrame(); @@ -8600,7 +8603,7 @@ TEST_F(LayerTreeHostImplTest, InvalidLayerNotAddedToRasterQueue) { layer->tilings()->tiling_at(0)->CreateAllTilesForTesting(); layer->tilings()->tiling_at(0)->ComputeTilePriorityRects( gfx::Rect(gfx::Size(10, 10)), 1.f, 1.0, Occlusion()); - host_impl_->pending_tree()->SetRootLayer(layer.Pass()); + host_impl_->pending_tree()->SetRootLayer(std::move(layer)); FakePictureLayerImpl* root_layer = static_cast( host_impl_->pending_tree()->root_layer()); @@ -8628,7 +8631,7 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) { scoped_ptr pending_layer = FakePictureLayerImpl::Create(pending_tree, 10); FakePictureLayerImpl* raw_pending_layer = pending_layer.get(); - pending_tree->SetRootLayer(pending_layer.Pass()); + pending_tree->SetRootLayer(std::move(pending_layer)); ASSERT_EQ(raw_pending_layer, pending_tree->root_layer()); EXPECT_EQ(0u, raw_pending_layer->did_become_active_call_count()); @@ -8638,7 +8641,7 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) { scoped_ptr mask_layer = FakePictureLayerImpl::Create(pending_tree, 11); FakePictureLayerImpl* raw_mask_layer = mask_layer.get(); - raw_pending_layer->SetMaskLayer(mask_layer.Pass()); + raw_pending_layer->SetMaskLayer(std::move(mask_layer)); ASSERT_EQ(raw_mask_layer, raw_pending_layer->mask_layer()); EXPECT_EQ(1u, raw_pending_layer->did_become_active_call_count()); @@ -8652,8 +8655,8 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) { scoped_ptr replica_mask_layer = FakePictureLayerImpl::Create(pending_tree, 13); FakePictureLayerImpl* raw_replica_mask_layer = replica_mask_layer.get(); - replica_layer->SetMaskLayer(replica_mask_layer.Pass()); - raw_pending_layer->SetReplicaLayer(replica_layer.Pass()); + replica_layer->SetMaskLayer(std::move(replica_mask_layer)); + raw_pending_layer->SetReplicaLayer(std::move(replica_layer)); ASSERT_EQ(raw_replica_mask_layer, raw_pending_layer->replica_layer()->mask_layer()); @@ -8951,7 +8954,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusModes) { LayerTreeSettings msaaSettings = GpuRasterizationEnabledSettings(); msaaSettings.gpu_rasterization_msaa_sample_count = 4; EXPECT_TRUE(CreateHostImpl( - msaaSettings, FakeOutputSurface::Create3d(context_with_msaa.Pass()))); + msaaSettings, FakeOutputSurface::Create3d(std::move(context_with_msaa)))); host_impl_->SetHasGpuRasterizationTrigger(true); host_impl_->SetContentIsSuitableForGpuRasterization(false); EXPECT_EQ(GpuRasterizationStatus::MSAA_CONTENT, @@ -9009,7 +9012,7 @@ TEST_F(LayerTreeHostImplTest, BeginCommitReclaimsResources) { // Hold an unowned pointer to the output surface to use for mock expectations. MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); - CreateHostImpl(DefaultSettings(), output_surface.Pass()); + CreateHostImpl(DefaultSettings(), std::move(output_surface)); EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); host_impl_->BeginCommit(); } diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc index ef4e3eb637dd0d..99bf3d4cb0509b 100644 --- a/cc/trees/layer_tree_host_perftest.cc +++ b/cc/trees/layer_tree_host_perftest.cc @@ -297,7 +297,7 @@ class BrowserCompositorInvalidateLayerTreePerfTest GL_TEXTURE_2D); next_sync_point_++; - tab_contents_->SetTextureMailbox(mailbox, callback.Pass()); + tab_contents_->SetTextureMailbox(mailbox, std::move(callback)); } void DidCommit() override { diff --git a/cc/trees/layer_tree_host_pixeltest_blending.cc b/cc/trees/layer_tree_host_pixeltest_blending.cc index 688c9fbc1ca4c8..29ab0d0a6dc8aa 100644 --- a/cc/trees/layer_tree_host_pixeltest_blending.cc +++ b/cc/trees/layer_tree_host_pixeltest_blending.cc @@ -145,7 +145,7 @@ class LayerTreeHostBlendingPixelTest : public LayerTreeHostPixelResourceTest { layer->SetBounds(gfx::Size(width, height)); skia::RefPtr image = skia::AdoptRef(backing_store->newImageSnapshot()); - layer->SetImage(image.Pass()); + layer->SetImage(std::move(image)); return layer; } @@ -170,7 +170,7 @@ class LayerTreeHostBlendingPixelTest : public LayerTreeHostPixelResourceTest { paint); skia::RefPtr image = skia::AdoptRef(surface->newImageSnapshot()); - mask->SetImage(image.Pass()); + mask->SetImage(std::move(image)); layer->SetMaskLayer(mask.get()); } diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc index 1e395ab4c633d2..6d3313c746710f 100644 --- a/cc/trees/layer_tree_host_pixeltest_masks.cc +++ b/cc/trees/layer_tree_host_pixeltest_masks.cc @@ -61,7 +61,7 @@ class MaskContentLayerClient : public ContentLayerClient { skia::RefPtr picture = skia::AdoptRef(recorder.endRecordingAsPicture()); - item->SetNew(picture.Pass()); + item->SetNew(std::move(picture)); display_list->Finalize(); return display_list; @@ -115,7 +115,7 @@ TEST_P(LayerTreeHostMasksPixelTest, ImageMaskOfLayer) { mask_display_list->Raster(canvas, nullptr, gfx::Rect(mask_bounds), 1.0f); skia::RefPtr image = skia::AdoptRef(surface->newImageSnapshot()); - mask->SetImage(image.Pass()); + mask->SetImage(std::move(image)); scoped_refptr green = CreateSolidColorLayerWithBorder( gfx::Rect(25, 25, 50, 50), kCSSGreen, 1, SK_ColorBLACK); @@ -339,7 +339,7 @@ class CheckerContentLayerClient : public ContentLayerClient { skia::RefPtr picture = skia::AdoptRef(recorder.endRecordingAsPicture()); - item->SetNew(picture.Pass()); + item->SetNew(std::move(picture)); display_list->Finalize(); return display_list; @@ -379,7 +379,7 @@ class CircleContentLayerClient : public ContentLayerClient { auto* item = display_list->CreateAndAppendItem(); skia::RefPtr picture = skia::AdoptRef(recorder.endRecordingAsPicture()); - item->SetNew(picture.Pass()); + item->SetNew(std::move(picture)); display_list->Finalize(); return display_list; diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc index d7f0a92b1ee641..da04d4241c3943 100644 --- a/cc/trees/layer_tree_host_pixeltest_readback.cc +++ b/cc/trees/layer_tree_host_pixeltest_readback.cc @@ -83,7 +83,7 @@ class LayerTreeHostReadbackPixelTest if (!copy_subrect_.IsEmpty()) request->set_area(copy_subrect_); - return request.Pass(); + return request; } void BeginTest() override { @@ -125,7 +125,8 @@ class LayerTreeHostReadbackPixelTest CopyTextureMailboxToBitmap(result->size(), texture_mailbox); release_callback->Run(gpu::SyncToken(), false); - ReadbackResultAsBitmap(CopyOutputResult::CreateBitmapResult(bitmap.Pass())); + ReadbackResultAsBitmap( + CopyOutputResult::CreateBitmapResult(std::move(bitmap))); } ReadbackType readback_type_; diff --git a/cc/trees/layer_tree_host_pixeltest_tiles.cc b/cc/trees/layer_tree_host_pixeltest_tiles.cc index c3dd34e2452e97..932972100da827 100644 --- a/cc/trees/layer_tree_host_pixeltest_tiles.cc +++ b/cc/trees/layer_tree_host_pixeltest_tiles.cc @@ -134,7 +134,7 @@ class BlueYellowClient : public ContentLayerClient { skia::AdoptRef(recorder.endRecordingAsPicture()); auto* item = display_list->CreateAndAppendItem(); - item->SetNew(picture.Pass()); + item->SetNew(std::move(picture)); display_list->Finalize(); return display_list; diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 5e4e1ef6065011..7d2dbef7115ef7 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -441,7 +441,7 @@ class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { SetWorkerContextShouldAggressivelyFreeResources(true)) .After(visibility_true) .WillOnce(testing::Invoke([this](bool is_visible) { EndTest(); })); - return output_surface.Pass(); + return std::move(output_surface); } void InitializeSettings(LayerTreeSettings* settings) override { @@ -1217,12 +1217,12 @@ class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { scoped_ptr recording( new FakeDisplayListRecordingSource); root_layer_ = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &client_, recording.Pass()); + layer_settings(), &client_, std::move(recording)); root_layer_->SetBounds(gfx::Size(50, 50)); recording.reset(new FakeDisplayListRecordingSource); child_layer_ = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &client_, recording.Pass()); + layer_settings(), &client_, std::move(recording)); child_layer_->SetBounds(gfx::Size(25, 25)); child_layer_->SetIsDrawable(true); child_layer_->SetContentsOpaque(true); @@ -2246,9 +2246,10 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { mock_context_ = mock_context_owned.get(); if (delegating_renderer()) - return FakeOutputSurface::CreateDelegating3d(mock_context_owned.Pass()); + return FakeOutputSurface::CreateDelegating3d( + std::move(mock_context_owned)); else - return FakeOutputSurface::Create3d(mock_context_owned.Pass()); + return FakeOutputSurface::Create3d(std::move(mock_context_owned)); } void SetupTree() override { @@ -3850,7 +3851,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface : first_output_surface_memory_limit_, gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, ManagedMemoryPolicy::kDefaultNumResourcesLimit))); - return output_surface.Pass(); + return output_surface; } void SetupTree() override { @@ -4015,7 +4016,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { ASSERT_LE(commit_count_, 2); scoped_ptr swap_promise( new TestSwapPromise(&swap_promise_result_[commit_count_])); - layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise)); } void BeginTest() override { PostSetNeedsCommitToMainThread(); } @@ -4202,7 +4203,7 @@ class LayerTreeHostTestBreakSwapPromiseForVisibility layer_tree_host()->SetVisible(false); scoped_ptr swap_promise( new TestSwapPromise(&swap_promise_result_)); - layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise)); } void ScheduledActionWillSendBeginMainFrame() override { @@ -4246,7 +4247,7 @@ class LayerTreeHostTestBreakSwapPromiseForContext : public LayerTreeHostTest { layer_tree_host()->DidLoseOutputSurface(); scoped_ptr swap_promise( new TestSwapPromise(&swap_promise_result_)); - layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise)); } void ScheduledActionWillSendBeginMainFrame() override { @@ -4426,7 +4427,7 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest { scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &layer_client_, recording_source.Pass()); + layer_settings(), &layer_client_, std::move(recording_source)); layer_ = layer.get(); layer->SetBounds(gfx::Size(10, 10)); layer->SetIsDrawable(true); @@ -4481,7 +4482,7 @@ class LayerTreeHostTestEmptyLayerGpuRasterization : public LayerTreeHostTest { scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &layer_client_, recording_source.Pass()); + layer_settings(), &layer_client_, std::move(recording_source)); layer_ = layer.get(); layer->SetBounds(gfx::Size()); layer->SetIsDrawable(true); @@ -4538,7 +4539,7 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest { scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &layer_client_, recording_source.Pass()); + layer_settings(), &layer_client_, std::move(recording_source)); layer_ = layer.get(); layer->SetBounds(gfx::Size(10, 10)); layer->SetIsDrawable(true); @@ -4607,7 +4608,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest { scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource( - layer_settings(), &layer_client_, recording_source.Pass()); + layer_settings(), &layer_client_, std::move(recording_source)); layer_ = layer.get(); layer->SetBounds(gfx::Size(10, 10)); @@ -4921,20 +4922,20 @@ class LayerTreeHostTestSynchronousCompositeSwapPromise // Successful composite. scoped_ptr swap_promise0( new TestSwapPromise(&swap_promise_result_[0])); - layer_tree_host()->QueueSwapPromise(swap_promise0.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise0)); layer_tree_host()->Composite(base::TimeTicks::Now()); // Fail to swap (no damage). scoped_ptr swap_promise1( new TestSwapPromise(&swap_promise_result_[1])); - layer_tree_host()->QueueSwapPromise(swap_promise1.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise1)); layer_tree_host()->SetNeedsCommit(); layer_tree_host()->Composite(base::TimeTicks::Now()); // Fail to draw (not visible). scoped_ptr swap_promise2( new TestSwapPromise(&swap_promise_result_[2])); - layer_tree_host()->QueueSwapPromise(swap_promise2.Pass()); + layer_tree_host()->QueueSwapPromise(std::move(swap_promise2)); layer_tree_host()->SetNeedsDisplayOnAllLayers(); layer_tree_host()->SetVisible(false); layer_tree_host()->Composite(base::TimeTicks::Now()); @@ -5052,7 +5053,7 @@ class LayerTreeHostTestCrispUpAfterPinchEnds : public LayerTreeHostTest { recording->SetPlaybackAllowedEvent(&playback_allowed_event_); scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, - recording.Pass()); + std::move(recording)); layer->SetBounds(gfx::Size(500, 500)); layer->SetContentsOpaque(true); // Avoid LCD text on the layer so we don't cause extra commits when we @@ -5226,9 +5227,9 @@ class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy #endif if (delegating_renderer()) - return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); + return FakeOutputSurface::CreateDelegating3d(std::move(context3d)); else - return FakeOutputSurface::Create3d(context3d.Pass()); + return FakeOutputSurface::Create3d(std::move(context3d)); } }; @@ -5254,7 +5255,7 @@ class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest { new FakeDisplayListRecordingSource); scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, - recording.Pass()); + std::move(recording)); layer->SetBounds(gfx::Size(500, 500)); layer->SetContentsOpaque(true); root->AddChild(layer); @@ -5295,7 +5296,7 @@ class GpuRasterizationRasterizesBorderTiles : public LayerTreeHostTest { new FakeDisplayListRecordingSource); scoped_refptr root = FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, - recording.Pass()); + std::move(recording)); root->SetBounds(gfx::Size(10000, 10000)); root->SetContentsOpaque(true); @@ -5348,7 +5349,7 @@ class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles recording->SetPlaybackAllowedEvent(&playback_allowed_event_); scoped_refptr layer = FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_, - recording.Pass()); + std::move(recording)); layer->SetBounds(gfx::Size(500, 500)); layer->SetContentsOpaque(true); // Avoid LCD text on the layer so we don't cause extra commits when we diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 4ae38fea33ddbc..e7cfa62d593d15 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -414,8 +414,8 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation // Any valid AnimationCurve will do here. scoped_ptr curve(new FakeFloatAnimationCurve()); scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 1, Animation::OPACITY)); - layer->layer_animation_controller()->AddAnimation(animation.Pass()); + Animation::Create(std::move(curve), 1, 1, Animation::OPACITY)); + layer->layer_animation_controller()->AddAnimation(std::move(animation)); // We add the animation *before* attaching the layer to the tree. layer_tree_host()->root_layer()->AddChild(layer); @@ -650,10 +650,11 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated ScrollOffsetAnimationCurve::Create( gfx::ScrollOffset(500.f, 550.f), EaseInOutTimingFunction::Create())); - scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 0, Animation::SCROLL_OFFSET)); + scoped_ptr animation(Animation::Create( + std::move(curve), 1, 0, Animation::SCROLL_OFFSET)); animation->set_needs_synchronized_start_time(true); - bool animation_added = scroll_layer_->AddAnimation(animation.Pass()); + bool animation_added = + scroll_layer_->AddAnimation(std::move(animation)); bool impl_scrolling_supported = layer_tree_host()->proxy()->SupportsImplScrolling(); EXPECT_EQ(impl_scrolling_supported, animation_added); @@ -701,9 +702,9 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval ScrollOffsetAnimationCurve::Create(gfx::ScrollOffset(6500.f, 7500.f), EaseInOutTimingFunction::Create())); scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 0, Animation::SCROLL_OFFSET)); + Animation::Create(std::move(curve), 1, 0, Animation::SCROLL_OFFSET)); animation->set_needs_synchronized_start_time(true); - scroll_layer_->AddAnimation(animation.Pass()); + scroll_layer_->AddAnimation(std::move(animation)); } void BeginTest() override { PostSetNeedsCommitToMainThread(); } diff --git a/cc/trees/layer_tree_host_unittest_animation_timelines.cc b/cc/trees/layer_tree_host_unittest_animation_timelines.cc index 30b69ee1fb3869..da0c6ef56148d5 100644 --- a/cc/trees/layer_tree_host_unittest_animation_timelines.cc +++ b/cc/trees/layer_tree_host_unittest_animation_timelines.cc @@ -425,8 +425,8 @@ class LayerTreeHostTimelinesTestLayerAddedWithAnimation // Any valid AnimationCurve will do here. scoped_ptr curve(new FakeFloatAnimationCurve()); scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 1, Animation::OPACITY)); - player_->AddAnimation(animation.Pass()); + Animation::Create(std::move(curve), 1, 1, Animation::OPACITY)); + player_->AddAnimation(std::move(animation)); // We add the animation *before* attaching the layer to the tree. layer_tree_host()->root_layer()->AddChild(layer); @@ -559,13 +559,13 @@ class LayerTreeHostTimelinesTestScrollOffsetChangesArePropagated ScrollOffsetAnimationCurve::Create( gfx::ScrollOffset(500.f, 550.f), EaseInOutTimingFunction::Create())); - scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 0, Animation::SCROLL_OFFSET)); + scoped_ptr animation(Animation::Create( + std::move(curve), 1, 0, Animation::SCROLL_OFFSET)); animation->set_needs_synchronized_start_time(true); bool impl_scrolling_supported = layer_tree_host()->proxy()->SupportsImplScrolling(); if (impl_scrolling_supported) - player_child_->AddAnimation(animation.Pass()); + player_child_->AddAnimation(std::move(animation)); else EndTest(); break; @@ -611,12 +611,12 @@ class LayerTreeHostTimelinesTestScrollOffsetAnimationRemoval ScrollOffsetAnimationCurve::Create(gfx::ScrollOffset(6500.f, 7500.f), EaseInOutTimingFunction::Create())); scoped_ptr animation( - Animation::Create(curve.Pass(), 1, 0, Animation::SCROLL_OFFSET)); + Animation::Create(std::move(curve), 1, 0, Animation::SCROLL_OFFSET)); animation->set_needs_synchronized_start_time(true); AttachPlayersToTimeline(); player_child_->AttachLayer(scroll_layer_->id()); - player_child_->AddAnimation(animation.Pass()); + player_child_->AddAnimation(std::move(animation)); } void BeginTest() override { PostSetNeedsCommitToMainThread(); } diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 3bb21701a7667a..86d999232572bb 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -100,9 +100,9 @@ class LayerTreeHostContextTest : public LayerTreeTest { } if (delegating_renderer()) - return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); + return FakeOutputSurface::CreateDelegating3d(std::move(context3d)); else - return FakeOutputSurface::Create3d(context3d.Pass()); + return FakeOutputSurface::Create3d(std::move(context3d)); } DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, @@ -194,7 +194,7 @@ class LayerTreeHostContextTestLostContextSucceeds scoped_ptr surface( LayerTreeHostContextTest::CreateOutputSurface()); CHECK(surface); - layer_tree_host()->SetOutputSurface(surface.Pass()); + layer_tree_host()->SetOutputSurface(std::move(surface)); } void DidInitializeOutputSurface() override { @@ -408,7 +408,7 @@ class LayerTreeHostClientTakeAwayOutputSurface LayerTreeHostContextTest::CreateOutputSurface(); CHECK(surface); setos_counter_++; - layer_tree_host()->SetOutputSurface(surface.Pass()); + layer_tree_host()->SetOutputSurface(std::move(surface)); } void HideAndReleaseOutputSurface() { @@ -936,12 +936,12 @@ class LayerTreeHostContextTestDontUseLostResources AddOneOfEveryQuadType(pass.get(), child_resource_provider_.get(), RenderPassId(2, 1), &mailbox_sync_point); - frame_data->render_pass_list.push_back(pass_for_quad.Pass()); - frame_data->render_pass_list.push_back(pass.Pass()); + frame_data->render_pass_list.push_back(std::move(pass_for_quad)); + frame_data->render_pass_list.push_back(std::move(pass)); delegated_resource_collection_ = new DelegatedFrameResourceCollection; delegated_frame_provider_ = new DelegatedFrameProvider( - delegated_resource_collection_.get(), frame_data.Pass()); + delegated_resource_collection_.get(), std::move(frame_data)); ResourceId resource = child_resource_provider_->CreateResource( gfx::Size(4, 4), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888); diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc index 4340241e72c628..a11ad9546407fd 100644 --- a/cc/trees/layer_tree_host_unittest_copyrequest.cc +++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc @@ -610,7 +610,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface // Save the result for later. EXPECT_FALSE(result_); - result_ = result.Pass(); + result_ = std::move(result); // Post a commit to lose the output surface. layer_tree_host()->SetNeedsCommit(); @@ -846,7 +846,7 @@ class LayerTreeHostCopyRequestTestProvideTexture TextureMailbox(mailbox, sync_token_, GL_TEXTURE_2D)); EXPECT_TRUE(request->has_texture_mailbox()); - copy_layer_->RequestCopyOfOutput(request.Pass()); + copy_layer_->RequestCopyOfOutput(std::move(request)); } void AfterTest() override { @@ -907,7 +907,7 @@ class LayerTreeHostCopyRequestTestDestroyBeforeCopy base::Bind(&LayerTreeHostCopyRequestTestDestroyBeforeCopy:: CopyOutputCallback, base::Unretained(this))); - copy_layer_->RequestCopyOfOutput(request.Pass()); + copy_layer_->RequestCopyOfOutput(std::move(request)); layer_tree_host()->SetViewportSize(gfx::Size()); break; @@ -984,7 +984,7 @@ class LayerTreeHostCopyRequestTestShutdownBeforeCopy base::Bind(&LayerTreeHostCopyRequestTestShutdownBeforeCopy:: CopyOutputCallback, base::Unretained(this))); - copy_layer_->RequestCopyOfOutput(request.Pass()); + copy_layer_->RequestCopyOfOutput(std::move(request)); layer_tree_host()->SetViewportSize(gfx::Size()); break; diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc index 22dff3e92c6e13..897f225d355973 100644 --- a/cc/trees/layer_tree_host_unittest_delegated.cc +++ b/cc/trees/layer_tree_host_unittest_delegated.cc @@ -85,8 +85,8 @@ class LayerTreeHostDelegatedTest : public LayerTreeTest { root_output_rect, root_damage_rect, gfx::Transform()); - frame->render_pass_list.push_back(root_pass.Pass()); - return frame.Pass(); + frame->render_pass_list.push_back(std::move(root_pass)); + return frame; } scoped_ptr CreateInvalidFrameData( @@ -131,8 +131,8 @@ class LayerTreeHostDelegatedTest : public LayerTreeTest { flipped, nearest_neighbor); - frame->render_pass_list.push_back(root_pass.Pass()); - return frame.Pass(); + frame->render_pass_list.push_back(std::move(root_pass)); + return frame; } void AddTransferableResource(DelegatedFrameData* frame, @@ -257,7 +257,7 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer gfx::Size frame_size = root_pass->output_rect.size(); if (frame_provider_.get() && frame_size == frame_provider_->frame_size()) { - frame_provider_->SetFrameData(frame_data.Pass()); + frame_provider_->SetFrameData(std::move(frame_data)); return; } @@ -268,7 +268,7 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer } frame_provider_ = new DelegatedFrameProvider(resource_collection_.get(), - frame_data.Pass()); + std::move(frame_data)); delegated_ = CreateDelegatedLayer(frame_provider_.get()); } @@ -421,7 +421,7 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame1.get(), 999); AddTransferableResource(frame1.get(), 999); - SetFrameData(frame1.Pass()); + SetFrameData(std::move(frame1)); } void DidInitializeOutputSurface() override { @@ -696,7 +696,7 @@ class LayerTreeHostDelegatedTestMergeResources CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame1.get(), 999); AddTransferableResource(frame1.get(), 999); - SetFrameData(frame1.Pass()); + SetFrameData(std::move(frame1)); // The second frame uses resource 999 still, but also adds 555. scoped_ptr frame2 = @@ -705,7 +705,7 @@ class LayerTreeHostDelegatedTestMergeResources AddTransferableResource(frame2.get(), 999); AddTextureQuad(frame2.get(), 555); AddTransferableResource(frame2.get(), 555); - SetFrameData(frame2.Pass()); + SetFrameData(std::move(frame2)); // The resource 999 from frame1 is returned since it is still on the main // thread. @@ -757,7 +757,7 @@ class LayerTreeHostDelegatedTestRemapResourcesInQuads AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); PostSetNeedsCommitToMainThread(); } @@ -814,7 +814,7 @@ class LayerTreeHostDelegatedTestReturnUnusedResources AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // All of the resources are in use. @@ -828,7 +828,7 @@ class LayerTreeHostDelegatedTestReturnUnusedResources AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 3: // 555 is no longer in use. @@ -841,7 +841,7 @@ class LayerTreeHostDelegatedTestReturnUnusedResources // Stop using any resources. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 4: // Postpone collecting resources for a frame. They should still be there @@ -897,7 +897,7 @@ class LayerTreeHostDelegatedTestReusedResources AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // All of the resources are in use. @@ -909,7 +909,7 @@ class LayerTreeHostDelegatedTestReusedResources frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); AddTransferableResource(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // Resource are not immediately released. resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -922,7 +922,7 @@ class LayerTreeHostDelegatedTestReusedResources AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 3: // The 999 resource is the only unused one. Two references were sent, so @@ -965,7 +965,7 @@ class LayerTreeHostDelegatedTestFrameBeforeAck AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // All of the resources are in use. @@ -977,7 +977,7 @@ class LayerTreeHostDelegatedTestFrameBeforeAck frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); AddTransferableResource(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // Resource are not immediately released. resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1000,7 +1000,7 @@ class LayerTreeHostDelegatedTestFrameBeforeAck AddTextureQuad(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTextureQuad(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; } } @@ -1063,7 +1063,7 @@ class LayerTreeHostDelegatedTestFrameBeforeTakeResources AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // All of the resources are in use. @@ -1075,7 +1075,7 @@ class LayerTreeHostDelegatedTestFrameBeforeTakeResources frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); AddTransferableResource(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // Resource are not immediately released. resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1095,7 +1095,7 @@ class LayerTreeHostDelegatedTestFrameBeforeTakeResources AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // The resources are used by the new frame but are returned anyway since // we passed them again. @@ -1179,7 +1179,7 @@ class LayerTreeHostDelegatedTestBadFrame AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // All of the resources are in use. @@ -1197,7 +1197,7 @@ class LayerTreeHostDelegatedTestBadFrame AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); AddTextureQuad(frame.get(), 775); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // The parent compositor (this one) does a commit. break; @@ -1209,7 +1209,7 @@ class LayerTreeHostDelegatedTestBadFrame // Now send a good frame with 999 again. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // The bad frame's resource is given back to the child compositor. resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1333,7 +1333,7 @@ class LayerTreeHostDelegatedTestUnnamedResource AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1342,7 +1342,7 @@ class LayerTreeHostDelegatedTestUnnamedResource // Now send an empty frame. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // The unused resource should be returned. resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1399,13 +1399,13 @@ class LayerTreeHostDelegatedTestDontLeakResource AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // But then we immediately stop using 999. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // The unused resources should be returned. 555 is still used, but it's @@ -1418,7 +1418,7 @@ class LayerTreeHostDelegatedTestDontLeakResource } // Send a frame with no resources in it. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 3: // The now unused resource 555 should be returned. @@ -1478,7 +1478,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1490,7 +1490,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 3: // Since 999 is in the grandparent it is not returned. @@ -1618,7 +1618,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake AddTransferableResource(frame.get(), 555); AddTextureQuad(frame.get(), 444); AddTransferableResource(frame.get(), 444); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1629,7 +1629,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // 999 and 444 will be returned for frame 1, but not 555 since it's in // the current frame. break; @@ -1640,7 +1640,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 4: // 555 from frame 1 and 2 isn't returned since it's still in use. 999 @@ -1653,7 +1653,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake } frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); // 555 will be returned 3 times for frames 1 2 and 3, and 999 will be // returned once for frame 3. break; @@ -1728,7 +1728,7 @@ class DelegatedFrameIsActivatedDuringCommit CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); AddTransferableResource(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); PostSetNeedsCommitToMainThread(); } @@ -1755,7 +1755,7 @@ class DelegatedFrameIsActivatedDuringCommit CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; } case 2: @@ -1768,7 +1768,7 @@ class DelegatedFrameIsActivatedDuringCommit // Finish the test by releasing resources on the next frame. scoped_ptr frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; } } @@ -1819,7 +1819,7 @@ class LayerTreeHostDelegatedTestTwoImplLayers AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1838,7 +1838,7 @@ class LayerTreeHostDelegatedTestTwoImplLayers // Use a frame with no resources in it. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 4: // We gave one frame to the frame provider, so we should get one @@ -1878,7 +1878,7 @@ class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames AddTransferableResource(frame.get(), 999); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -1896,7 +1896,7 @@ class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames delegated_->RemoveFromParent(); delegated_ = NULL; - frame_provider_->SetFrameData(frame.Pass()); + frame_provider_->SetFrameData(std::move(frame)); delegated_ = CreateDelegatedLayer(frame_provider_.get()); break; case 3: @@ -1906,7 +1906,7 @@ class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames // Use a frame with no resources in it. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 4: // We gave two frames to the frame provider, so we should get two @@ -1949,7 +1949,7 @@ class LayerTreeHostDelegatedTestTwoLayers AddTransferableResource(frame.get(), 555); // Create a DelegatedRendererLayer using the frame. - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // Create a second DelegatedRendererLayer using the same frame provider. @@ -2036,7 +2036,7 @@ class LayerTreeHostDelegatedTestRemoveAndAddToTree AddTransferableResource(frame.get(), 555); // Create a DelegatedRendererLayer using the frame. - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -2066,7 +2066,7 @@ class LayerTreeHostDelegatedTestRemoveAndAddToTree AddTransferableResource(frame.get(), 888); AddTextureQuad(frame.get(), 777); AddTransferableResource(frame.get(), 777); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 5: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -2127,7 +2127,7 @@ class LayerTreeHostDelegatedTestRemoveAndChangeResources AddTransferableResource(frame.get(), 555); // Create a DelegatedRendererLayer using the frame. - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); @@ -2149,7 +2149,7 @@ class LayerTreeHostDelegatedTestRemoveAndChangeResources AddTransferableResource(frame.get(), 888); AddTextureQuad(frame.get(), 777); AddTransferableResource(frame.get(), 777); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); resource_collection_->TakeUnusedResourcesForChildCompositor(&resources); { @@ -2204,14 +2204,14 @@ class LayerTreeHostDelegatedTestActiveFrameIsValid frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 999); AddTransferableResource(frame.get(), 999); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; case 2: // This frame stops in the pending tree while we redraw the active tree. frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); AddTextureQuad(frame.get(), 555); AddTransferableResource(frame.get(), 555); - SetFrameData(frame.Pass()); + SetFrameData(std::move(frame)); break; } } diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 9250ce584ed77a..25ec5dbda5e46e 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -221,7 +221,7 @@ void LayerTreeImpl::UpdateScrollbars(int scroll_layer_id, int clip_layer_id) { } void LayerTreeImpl::SetRootLayer(scoped_ptr layer) { - root_layer_ = layer.Pass(); + root_layer_ = std::move(layer); layer_tree_host_impl_->OnCanDrawStateChangedForTree(); } @@ -261,7 +261,7 @@ gfx::ScrollOffset LayerTreeImpl::TotalMaxScrollOffset() const { scoped_ptr LayerTreeImpl::DetachLayerTree() { render_surface_layer_list_.clear(); set_needs_update_draw_properties(); - return root_layer_.Pass(); + return std::move(root_layer_); } static void UpdateClipTreeForBoundsDeltaOnLayer(LayerImpl* layer, @@ -325,7 +325,7 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { target_tree->elastic_overscroll()->PushPendingToActive(); target_tree->pending_page_scale_animation_ = - pending_page_scale_animation_.Pass(); + std::move(pending_page_scale_animation_); target_tree->SetViewportLayersFromIds( overscroll_elasticity_layer_id_, page_scale_layer_id_, @@ -1122,14 +1122,14 @@ bool LayerTreeImpl::DistributeRootScrollOffset( void LayerTreeImpl::QueueSwapPromise(scoped_ptr swap_promise) { DCHECK(swap_promise); - swap_promise_list_.push_back(swap_promise.Pass()); + swap_promise_list_.push_back(std::move(swap_promise)); } void LayerTreeImpl::QueuePinnedSwapPromise( scoped_ptr swap_promise) { DCHECK(IsActiveTree()); DCHECK(swap_promise); - pinned_swap_promise_list_.push_back(swap_promise.Pass()); + pinned_swap_promise_list_.push_back(std::move(swap_promise)); } void LayerTreeImpl::PassSwapPromises( @@ -1760,12 +1760,12 @@ VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() void LayerTreeImpl::SetPendingPageScaleAnimation( scoped_ptr pending_animation) { - pending_page_scale_animation_ = pending_animation.Pass(); + pending_page_scale_animation_ = std::move(pending_animation); } scoped_ptr LayerTreeImpl::TakePendingPageScaleAnimation() { - return pending_page_scale_animation_.Pass(); + return std::move(pending_page_scale_animation_); } bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index a757d8663ed6e2..9a9cfe56a4916d 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -72,7 +72,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -130,7 +130,7 @@ TEST_F(LayerTreeImplTest, UpdateViewportAndHitTest) { root->SetDrawsContent(true); host_impl->SetViewportSize(root->bounds()); - host_impl->active_tree()->SetRootLayer(root.Pass()); + host_impl->active_tree()->SetRootLayer(std::move(root)); host_impl->UpdateNumChildrenAndDrawPropertiesForActiveTree(); EXPECT_EQ( gfx::RectF(gfx::SizeF(bounds)), @@ -170,10 +170,10 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) { hud->SetDrawsContent(true); host_impl().active_tree()->set_hud_layer(hud.get()); - root->AddChild(hud.Pass()); + root->AddChild(std::move(hud)); host_impl().SetViewportSize(hud_bounds); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -227,7 +227,7 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. ASSERT_EQ(1u, RenderSurfaceLayerList().size()); @@ -288,7 +288,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -340,7 +340,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -404,7 +404,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -468,12 +468,12 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, position, bounds, true, false, false); child->SetDrawsContent(true); - clipping_layer->AddChild(child.Pass()); - root->AddChild(clipping_layer.Pass()); + clipping_layer->AddChild(std::move(child)); + root->AddChild(std::move(clipping_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -574,13 +574,13 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { false, false); rotated_leaf->SetDrawsContent(true); - grand_child->AddChild(rotated_leaf.Pass()); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + grand_child->AddChild(std::move(rotated_leaf)); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // (11, 89) is close to the the bottom left corner within the clip, but it is @@ -664,12 +664,12 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, position, bounds, true, false, false); child->SetDrawsContent(true); - intermediate_layer->AddChild(child.Pass()); - root->AddChild(intermediate_layer.Pass()); + intermediate_layer->AddChild(std::move(child)); + root->AddChild(std::move(intermediate_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -750,9 +750,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { false, false); grand_child1->SetDrawsContent(true); - child1->AddChild(grand_child1.Pass()); - root->AddChild(child1.Pass()); - root->AddChild(child2.Pass()); + child1->AddChild(std::move(grand_child1)); + root->AddChild(std::move(child1)); + root->AddChild(std::move(child2)); } LayerImpl* child1 = root->children()[0].get(); @@ -760,7 +760,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { LayerImpl* grand_child1 = child1->children()[0].get(); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -870,11 +870,11 @@ int LayerTreeImplTest::HitTestSimpleTree(int root_id, right_child->Set3dSortingContextId(right_child_sorting_context); } - root->AddChild(left_child.Pass()); - root->AddChild(right_child.Pass()); + root->AddChild(std::move(left_child)); + root->AddChild(std::move(right_child)); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); CHECK_EQ(1u, RenderSurfaceLayerList().size()); @@ -978,9 +978,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { grand_child1->SetDrawsContent(true); grand_child1->SetShouldFlattenTransform(false); - child1->AddChild(grand_child1.Pass()); - root->AddChild(child1.Pass()); - root->AddChild(child2.Pass()); + child1->AddChild(std::move(grand_child1)); + root->AddChild(std::move(child1)); + root->AddChild(std::move(child2)); } LayerImpl* child1 = root->children()[0].get(); @@ -988,7 +988,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { LayerImpl* grand_child1 = child1->children()[0].get(); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1079,12 +1079,12 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { // This should let |grand_child| "escape" |child|'s clip. grand_child->SetClipParent(root.get()); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); gfx::PointF test_point(12.f, 52.f); @@ -1138,13 +1138,13 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { grand_child->SetDrawsContent(true); grand_child->SetHasRenderSurface(true); - scroll_child->AddChild(grand_child.Pass()); - root->AddChild(scroll_child.Pass()); - root->AddChild(child.Pass()); + scroll_child->AddChild(std::move(grand_child)); + root->AddChild(std::move(scroll_child)); + root->AddChild(std::move(child)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); gfx::PointF test_point(12.f, 52.f); @@ -1210,9 +1210,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { grand_child1->SetDrawsContent(true); grand_child1->SetHasRenderSurface(true); - child1->AddChild(grand_child1.Pass()); - root->AddChild(child1.Pass()); - root->AddChild(child2.Pass()); + child1->AddChild(std::move(grand_child1)); + root->AddChild(std::move(child1)); + root->AddChild(std::move(child2)); } LayerImpl* child1 = root->children()[0].get(); @@ -1220,7 +1220,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { LayerImpl* grand_child1 = child1->children()[0].get(); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1305,7 +1305,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1390,7 +1390,7 @@ TEST_F(LayerTreeImplTest, root->SetTouchEventHandlerRegion(touch_handler_region); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1463,7 +1463,7 @@ TEST_F(LayerTreeImplTest, root->SetTouchEventHandlerRegion(touch_handler_region); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1535,7 +1535,7 @@ TEST_F(LayerTreeImplTest, test_layer->SetDrawsContent(true); test_layer->SetTouchEventHandlerRegion(touch_handler_region); - root->AddChild(test_layer.Pass()); + root->AddChild(std::move(test_layer)); } float device_scale_factor = 3.f; @@ -1549,7 +1549,7 @@ TEST_F(LayerTreeImplTest, host_impl().active_tree()->PushPageScaleFromMainThread( page_scale_factor, page_scale_factor, max_page_scale_factor); host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 1, 1, Layer::INVALID_ID); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -1688,12 +1688,12 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { position, bounds, true, false, false); child->SetDrawsContent(true); child->SetTouchEventHandlerRegion(touch_handler_region); - clipping_layer->AddChild(child.Pass()); - root->AddChild(clipping_layer.Pass()); + clipping_layer->AddChild(std::move(child)); + root->AddChild(std::move(clipping_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1761,7 +1761,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { false, false); touch_layer->SetDrawsContent(true); touch_layer->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50)); - root->AddChild(touch_layer.Pass()); + root->AddChild(std::move(touch_layer)); } { @@ -1775,11 +1775,11 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { transform_origin, position, bounds, true, false, false); notouch_layer->SetDrawsContent(true); - root->AddChild(notouch_layer.Pass()); + root->AddChild(std::move(notouch_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -1843,10 +1843,10 @@ TEST_F(LayerTreeImplTest, HitTestingTouchHandlerRegionsForLayerThatIsNotDrawn) { test_layer->SetDrawsContent(false); test_layer->SetTouchEventHandlerRegion(touch_handler_region); - root->AddChild(test_layer.Pass()); + root->AddChild(std::move(test_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); LayerImpl* test_layer = @@ -1915,7 +1915,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -2013,12 +2013,12 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { transform_origin, position, bounds, true, false, false); clipped_layer->SetDrawsContent(true); - clipping_layer->AddChild(clipped_layer.Pass()); - root->AddChild(clipping_layer.Pass()); + clipping_layer->AddChild(std::move(clipped_layer)); + root->AddChild(std::move(clipping_layer)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); // Sanity check the scenario we just created. @@ -2101,7 +2101,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { transform_origin, position, bounds, true, false, false); sub_layer->SetDrawsContent(true); - root->AddChild(sub_layer.Pass()); + root->AddChild(std::move(sub_layer)); } float device_scale_factor = 3.f; @@ -2114,7 +2114,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { host_impl().active_tree()->PushPageScaleFromMainThread( page_scale_factor, page_scale_factor, page_scale_factor); host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().active_tree()->SetViewportLayersFromIds(Layer::INVALID_ID, 1, 1, Layer::INVALID_ID); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); @@ -2191,12 +2191,12 @@ TEST_F(LayerTreeImplTest, SelectionBoundsWithLargeTransforms) { false, false); grand_child->SetDrawsContent(true); - child->AddChild(grand_child.Pass()); - root->AddChild(child.Pass()); + child->AddChild(std::move(grand_child)); + root->AddChild(std::move(child)); } host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); + host_impl().active_tree()->SetRootLayer(std::move(root)); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); LayerSelection input; diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc index 7e4a8f8bca73e5..b7ecf3b6a22e28 100644 --- a/cc/trees/occlusion_tracker_perftest.cc +++ b/cc/trees/occlusion_tracker_perftest.cc @@ -46,7 +46,7 @@ class OcclusionTrackerPerfTest : public testing::Test { scoped_ptr root_layer = LayerImpl::Create(active_tree(), 1); root_layer->SetHasRenderSurface(true); - active_tree()->SetRootLayer(root_layer.Pass()); + active_tree()->SetRootLayer(std::move(root_layer)); } LayerTreeImpl* active_tree() { return host_impl_->active_tree(); } @@ -90,7 +90,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_FullyOccluded) { opaque_layer->SetContentsOpaque(true); opaque_layer->SetDrawsContent(true); opaque_layer->SetBounds(viewport_rect.size()); - active_tree()->root_layer()->AddChild(opaque_layer.Pass()); + active_tree()->root_layer()->AddChild(std::move(opaque_layer)); bool update_lcd_text = false; active_tree()->UpdateDrawProperties(update_lcd_text); @@ -159,7 +159,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_10OpaqueLayers) { opaque_layer->SetBounds( gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); opaque_layer->SetPosition(gfx::PointF(i, i)); - active_tree()->root_layer()->AddChild(opaque_layer.Pass()); + active_tree()->root_layer()->AddChild(std::move(opaque_layer)); } bool update_lcd_text = false; diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index 958d532d4d9c42..c8c7d4b12cd592 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -104,7 +104,7 @@ class OcclusionTrackerTest : public testing::Test { SetProperties(layer_ptr, transform, position, bounds); DCHECK(!root_.get()); - root_ = layer.Pass(); + root_ = std::move(layer); layer_ptr->SetHasRenderSurface(true); SetRootLayerOnMainThread(layer_ptr); @@ -121,7 +121,7 @@ class OcclusionTrackerTest : public testing::Test { scoped_ptr layer = LayerImpl::Create(tree, id); LayerImpl* layer_ptr = layer.get(); SetProperties(layer_ptr, transform, position, bounds); - parent->AddChild(layer.Pass()); + parent->AddChild(std::move(layer)); return layer_ptr; } @@ -155,7 +155,7 @@ class OcclusionTrackerTest : public testing::Test { layer_ptr->SetOpaqueContentsRect(gfx::Rect()); } - parent->AddChild(layer.Pass()); + parent->AddChild(std::move(layer)); return layer_ptr; } @@ -168,7 +168,7 @@ class OcclusionTrackerTest : public testing::Test { scoped_ptr layer(new TestContentLayerImpl(tree, id)); TestContentLayerImpl* layer_ptr = layer.get(); SetProperties(layer_ptr, transform, position, bounds); - SetReplica(owning_layer, layer.Pass()); + SetReplica(owning_layer, std::move(layer)); return layer_ptr; } @@ -178,7 +178,7 @@ class OcclusionTrackerTest : public testing::Test { scoped_ptr layer(new TestContentLayerImpl(tree, id)); TestContentLayerImpl* layer_ptr = layer.get(); SetProperties(layer_ptr, identity_matrix, gfx::PointF(), bounds); - SetMask(owning_layer, layer.Pass()); + SetMask(owning_layer, std::move(layer)); return layer_ptr; } @@ -296,11 +296,11 @@ class OcclusionTrackerTest : public testing::Test { } void SetReplica(LayerImpl* owning_layer, scoped_ptr layer) { - owning_layer->SetReplicaLayer(layer.Pass()); + owning_layer->SetReplicaLayer(std::move(layer)); } void SetMask(LayerImpl* owning_layer, scoped_ptr layer) { - owning_layer->SetMaskLayer(layer.Pass()); + owning_layer->SetMaskLayer(std::move(layer)); } bool opaque_layers_; diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 3bcf018014a081..46f26ff9657489 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -29,7 +29,7 @@ scoped_ptr SingleThreadProxy::Create( scoped_ptr external_begin_frame_source) { return make_scoped_ptr( new SingleThreadProxy(layer_tree_host, client, task_runner_provider, - external_begin_frame_source.Pass())); + std::move(external_begin_frame_source))); } SingleThreadProxy::SingleThreadProxy( @@ -40,7 +40,7 @@ SingleThreadProxy::SingleThreadProxy( : layer_tree_host_(layer_tree_host), client_(client), task_runner_provider_(task_runner_provider), - external_begin_frame_source_(external_begin_frame_source.Pass()), + external_begin_frame_source_(std::move(external_begin_frame_source)), next_frame_is_newly_committed_frame_(false), #if DCHECK_IS_ON() inside_impl_frame_(false), @@ -68,10 +68,11 @@ SingleThreadProxy::SingleThreadProxy( CompositorTimingHistory::BROWSER_UMA, layer_tree_host->rendering_stats_instrumentation())); - scheduler_on_impl_thread_ = Scheduler::Create( - this, scheduler_settings, layer_tree_host_->id(), - task_runner_provider_->MainThreadTaskRunner(), - external_begin_frame_source_.get(), compositor_timing_history.Pass()); + scheduler_on_impl_thread_ = + Scheduler::Create(this, scheduler_settings, layer_tree_host_->id(), + task_runner_provider_->MainThreadTaskRunner(), + external_begin_frame_source_.get(), + std::move(compositor_timing_history)); } } @@ -424,7 +425,7 @@ void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); DCHECK(task_runner_provider_->IsImplThread()); DebugScopedSetMainThread main(task_runner_provider_); - layer_tree_host_->SetAnimationEvents(events.Pass()); + layer_tree_host_->SetAnimationEvents(std::move(events)); } bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } @@ -504,8 +505,8 @@ void SingleThreadProxy::OnDrawForOutputSurface() { void SingleThreadProxy::PostFrameTimingEventsOnImplThread( scoped_ptr composite_events, scoped_ptr main_frame_events) { - layer_tree_host_->RecordFrameTimingEvents(composite_events.Pass(), - main_frame_events.Pass()); + layer_tree_host_->RecordFrameTimingEvents(std::move(composite_events), + std::move(main_frame_events)); } void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index a1928408413628..0369508d21a6d8 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -49,8 +49,9 @@ scoped_ptr ThreadProxy::Create( LayerTreeHost* layer_tree_host, TaskRunnerProvider* task_runner_provider, scoped_ptr external_begin_frame_source) { - return make_scoped_ptr(new ThreadProxy(layer_tree_host, task_runner_provider, - external_begin_frame_source.Pass())); + return make_scoped_ptr( + new ThreadProxy(layer_tree_host, task_runner_provider, + std::move(external_begin_frame_source))); } ThreadProxy::ThreadProxy( @@ -63,7 +64,7 @@ ThreadProxy::ThreadProxy( this, layer_tree_host->id(), layer_tree_host->rendering_stats_instrumentation(), - external_begin_frame_source.Pass()) { + std::move(external_begin_frame_source)) { TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy"); DCHECK(task_runner_provider_); DCHECK(task_runner_provider_->IsMainThread()); @@ -111,7 +112,7 @@ ThreadProxy::CompositorThreadOnly::CompositorThreadOnly( base::Bind(&ThreadProxy::RenewTreePriority, base::Unretained(proxy)), base::TimeDelta::FromMilliseconds( kSmoothnessTakesPriorityExpirationDelay * 1000)), - external_begin_frame_source(external_begin_frame_source.Pass()), + external_begin_frame_source(std::move(external_begin_frame_source)), rendering_stats_instrumentation(rendering_stats_instrumentation), weak_factory(proxy) {} @@ -124,7 +125,7 @@ ThreadProxy::~ThreadProxy() { } void ThreadProxy::SetChannel(scoped_ptr threaded_channel) { - threaded_channel_ = threaded_channel.Pass(); + threaded_channel_ = std::move(threaded_channel); main().channel_main = threaded_channel_.get(); } @@ -376,7 +377,7 @@ void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( TRACE_EVENT0("cc", "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); DCHECK(task_runner_provider_->IsImplThread()); - impl().channel_impl->SetAnimationEvents(events.Pass()); + impl().channel_impl->SetAnimationEvents(std::move(events)); } bool ThreadProxy::IsInsideDraw() { return impl().inside_draw; } @@ -574,7 +575,7 @@ void ThreadProxy::ScheduledActionSendBeginMainFrame( // main_frame_before_activation_enabled is set, since we might run this code // twice before recording a duration. crbug.com/469824 impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args; - impl().channel_impl->BeginMainFrame(begin_main_frame_state.Pass()); + impl().channel_impl->BeginMainFrame(std::move(begin_main_frame_state)); devtools_instrumentation::DidRequestMainThreadFrame( impl().layer_tree_host_id); } @@ -937,7 +938,7 @@ void ThreadProxy::DidCompleteSwapBuffers() { void ThreadProxy::SetAnimationEvents(scoped_ptr events) { TRACE_EVENT0("cc", "ThreadProxy::SetAnimationEvents"); DCHECK(task_runner_provider_->IsMainThread()); - main().layer_tree_host->SetAnimationEvents(events.Pass()); + main().layer_tree_host->SetAnimationEvents(std::move(events)); } void ThreadProxy::InitializeImplOnImpl(CompletionEvent* completion, @@ -964,7 +965,7 @@ void ThreadProxy::InitializeImplOnImpl(CompletionEvent* completion, Scheduler::Create(this, scheduler_settings, impl().layer_tree_host_id, task_runner_provider_->ImplThreadTaskRunner(), impl().external_begin_frame_source.get(), - compositor_timing_history.Pass()); + std::move(compositor_timing_history)); DCHECK_EQ(impl().scheduler->visible(), impl().layer_tree_host_impl->visible()); @@ -1169,16 +1170,16 @@ void ThreadProxy::PostFrameTimingEventsOnImplThread( scoped_ptr composite_events, scoped_ptr main_frame_events) { DCHECK(task_runner_provider_->IsImplThread()); - impl().channel_impl->PostFrameTimingEventsOnMain(composite_events.Pass(), - main_frame_events.Pass()); + impl().channel_impl->PostFrameTimingEventsOnMain( + std::move(composite_events), std::move(main_frame_events)); } void ThreadProxy::PostFrameTimingEventsOnMain( scoped_ptr composite_events, scoped_ptr main_frame_events) { DCHECK(task_runner_provider_->IsMainThread()); - main().layer_tree_host->RecordFrameTimingEvents(composite_events.Pass(), - main_frame_events.Pass()); + main().layer_tree_host->RecordFrameTimingEvents(std::move(composite_events), + std::move(main_frame_events)); } base::WeakPtr ThreadProxy::GetMainWeakPtr() { diff --git a/cc/trees/threaded_channel.cc b/cc/trees/threaded_channel.cc index a2cb7831b61238..37ed58f7328de5 100644 --- a/cc/trees/threaded_channel.cc +++ b/cc/trees/threaded_channel.cc @@ -209,8 +209,8 @@ void ThreadedChannel::PostFrameTimingEventsOnMain( MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&ProxyMain::PostFrameTimingEventsOnMain, proxy_main_->GetMainWeakPtr(), - base::Passed(composite_events.Pass()), - base::Passed(main_frame_events.Pass()))); + base::Passed(std::move(composite_events)), + base::Passed(std::move(main_frame_events)))); } void ThreadedChannel::BeginMainFrame( diff --git a/cc/trees/threaded_channel_unittest.cc b/cc/trees/threaded_channel_unittest.cc index e9b6d5141f0f71..152ff59bebbfb0 100644 --- a/cc/trees/threaded_channel_unittest.cc +++ b/cc/trees/threaded_channel_unittest.cc @@ -266,7 +266,8 @@ class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest { void StartTestOnImplThread() override { scoped_ptr events( make_scoped_ptr(new AnimationEventsVector)); - thread_proxy_->PostAnimationEventsToMainThreadOnImplThread(events.Pass()); + thread_proxy_->PostAnimationEventsToMainThreadOnImplThread( + std::move(events)); } void ReceivedSetAnimationEvents() override { diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc index 4ecf5d3c957636..993514716e1155 100644 --- a/cc/trees/tree_synchronizer.cc +++ b/cc/trees/tree_synchronizer.cc @@ -32,7 +32,7 @@ void CollectExistingLayerImplRecursive(ScopedPtrLayerImplMap* old_layers, CollectExistingLayerImplRecursive(old_layers, layer_impl->TakeReplicaLayer()); int id = layer_impl->id(); - old_layers->set(id, layer_impl.Pass()); + old_layers->set(id, std::move(layer_impl)); } template @@ -46,28 +46,29 @@ scoped_ptr SynchronizeTreesInternal( ScopedPtrLayerImplMap old_layers; RawPtrLayerImplMap new_layers; - CollectExistingLayerImplRecursive(&old_layers, old_layer_impl_root.Pass()); + CollectExistingLayerImplRecursive(&old_layers, + std::move(old_layer_impl_root)); scoped_ptr new_tree = SynchronizeTreesRecursive( &new_layers, &old_layers, layer_root, tree_impl); - return new_tree.Pass(); + return new_tree; } scoped_ptr TreeSynchronizer::SynchronizeTrees( Layer* layer_root, scoped_ptr old_layer_impl_root, LayerTreeImpl* tree_impl) { - return SynchronizeTreesInternal( - layer_root, old_layer_impl_root.Pass(), tree_impl); + return SynchronizeTreesInternal(layer_root, std::move(old_layer_impl_root), + tree_impl); } scoped_ptr TreeSynchronizer::SynchronizeTrees( LayerImpl* layer_root, scoped_ptr old_layer_impl_root, LayerTreeImpl* tree_impl) { - return SynchronizeTreesInternal( - layer_root, old_layer_impl_root.Pass(), tree_impl); + return SynchronizeTreesInternal(layer_root, std::move(old_layer_impl_root), + tree_impl); } template @@ -81,7 +82,7 @@ scoped_ptr ReuseOrCreateLayerImpl(RawPtrLayerImplMap* new_layers, layer_impl = layer->CreateLayerImpl(tree_impl); (*new_layers)[layer->id()] = layer_impl.get(); - return layer_impl.Pass(); + return layer_impl; } template @@ -107,7 +108,7 @@ scoped_ptr SynchronizeTreesRecursiveInternal( layer_impl->SetReplicaLayer(SynchronizeTreesRecursiveInternal( new_layers, old_layers, layer->replica_layer(), tree_impl)); - return layer_impl.Pass(); + return layer_impl; } scoped_ptr SynchronizeTreesRecursive( diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 6d88157d7c2fd5..0d7c06727e7104 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -267,10 +267,9 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeReusingLayers) { // Synchronize again. After the sync the trees should be equivalent and we // should have created and destroyed one LayerImpl. - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); @@ -312,10 +311,9 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndTrackStackingOrderChange) { // re-insert the layer and sync again. child2->RemoveFromParent(); layer_tree_root->AddChild(child2); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); @@ -429,10 +427,9 @@ TEST_F(TreeSynchronizerTest, ReuseLayerImplsAfterStructuralChange) { // After another synchronize our trees should match and we should not have // destroyed any LayerImpls - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); @@ -476,10 +473,9 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeThenDestroy) { // be deleted. scoped_refptr new_layer_tree_root = Layer::Create(layer_settings_); host_->SetRootLayer(new_layer_tree_root); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(new_layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + new_layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(new_layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); @@ -534,30 +530,27 @@ TEST_F(TreeSynchronizerTest, SyncMaskReplicaAndReplicaMaskLayers) { // Remove the mask layer. layer_tree_root->children()[0]->SetMaskLayer(NULL); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); // Remove the replica layer. layer_tree_root->children()[1]->SetReplicaLayer(NULL); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); // Remove the replica mask. replica_layer_with_mask->SetMaskLayer(NULL); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root.get(), host_->active_tree()); @@ -587,10 +580,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { layer_tree_root.get(), nullptr, host_->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_->active_tree()); EXPECT_TRUE(static_cast( layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); @@ -632,10 +624,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { // Remove the first scroll child. layer_tree_root->children()[1]->RemoveFromParent(); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_impl->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_impl->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); { @@ -649,10 +640,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { scoped_refptr additional_scroll_child = Layer::Create(layer_settings_); layer_tree_root->AddChild(additional_scroll_child); additional_scroll_child->SetScrollParent(scroll_parent.get()); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_impl->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_impl->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); { @@ -702,10 +692,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { clip_child1->RemoveFromParent(); clip_child1 = NULL; - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_impl->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_impl->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); ExpectTreesAreIdentical(layer_tree_root.get(), @@ -716,10 +705,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { scoped_refptr additional_clip_child = Layer::Create(layer_settings_); intervening->AddChild(additional_clip_child); additional_clip_child->SetClipParent(clip_parent.get()); - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_impl->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_impl->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); ExpectTreesAreIdentical(layer_tree_root.get(), @@ -729,10 +717,9 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { // Remove the nearest clipping ancestor. clip_parent->RemoveFromParent(); clip_parent = NULL; - layer_impl_tree_root = - TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), - layer_impl_tree_root.Pass(), - host_impl->active_tree()); + layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( + layer_tree_root.get(), std::move(layer_impl_tree_root), + host_impl->active_tree()); TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root.get()); ExpectTreesAreIdentical(layer_tree_root.get(),