summaryrefslogtreecommitdiffstats
path: root/cc/surfaces
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2015-12-18 00:10:12 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 08:10:52 +0000
commitf9c838ef0cdc43cd851fcaac77286563a5ba9577 (patch)
tree5e315a0399f91f6996bbad30ef930107e41d4d94 /cc/surfaces
parent32e9f8bbd34e924a562530c298148a6647c38817 (diff)
downloadchromium_src-f9c838ef0cdc43cd851fcaac77286563a5ba9577.zip
chromium_src-f9c838ef0cdc43cd851fcaac77286563a5ba9577.tar.gz
chromium_src-f9c838ef0cdc43cd851fcaac77286563a5ba9577.tar.bz2
Convert Pass()→std::move() in cc/
BUG=557422 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1540503002 Cr-Commit-Position: refs/heads/master@{#366046}
Diffstat (limited to 'cc/surfaces')
-rw-r--r--cc/surfaces/display_unittest.cc7
-rw-r--r--cc/surfaces/surface_aggregator_unittest.cc15
-rw-r--r--cc/surfaces/surface_factory_unittest.cc17
3 files changed, 24 insertions, 15 deletions
diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc
index c699349..9c90ce0 100644
--- a/cc/surfaces/display_unittest.cc
+++ b/cc/surfaces/display_unittest.cc
@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "cc/surfaces/display.h"
+
+#include <utility>
+
#include "base/test/null_task_runner.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/copy_output_result.h"
#include "cc/output/delegated_frame_data.h"
#include "cc/quads/render_pass.h"
#include "cc/resources/shared_bitmap_manager.h"
-#include "cc/surfaces/display.h"
#include "cc/surfaces/display_client.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_factory.h"
@@ -403,7 +406,7 @@ TEST_F(DisplayTest, DisplayDamaged) {
pass->damage_rect = gfx::Rect(0, 0, 99, 99);
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);
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index f89ae3b..a0ac9f0 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "cc/surfaces/surface_aggregator.h"
+
+#include <utility>
+
#include "cc/output/compositor_frame.h"
#include "cc/output/delegated_frame_data.h"
#include "cc/quads/render_pass.h"
@@ -11,7 +15,6 @@
#include "cc/quads/texture_draw_quad.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "cc/surfaces/surface.h"
-#include "cc/surfaces/surface_aggregator.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
#include "cc/surfaces/surface_id_allocator.h"
@@ -505,7 +508,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, UnreferencedSurface) {
scoped_ptr<CopyOutputRequest> 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));
SurfaceId parent_surface_id = allocator_.GenerateId();
factory_.Create(parent_surface_id);
@@ -524,10 +527,10 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, UnreferencedSurface) {
parent_passes, arraysize(parent_passes));
scoped_ptr<CompositorFrame> frame(new CompositorFrame);
- frame->delegated_frame_data = frame_data.Pass();
+ frame->delegated_frame_data = std::move(frame_data);
frame->metadata.referenced_surfaces.push_back(embedded_surface_id);
- factory_.SubmitCompositorFrame(parent_surface_id, frame.Pass(),
+ factory_.SubmitCompositorFrame(parent_surface_id, std::move(frame),
SurfaceFactory::DrawCallback());
}
@@ -541,13 +544,13 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, UnreferencedSurface) {
root_passes, arraysize(root_passes));
scoped_ptr<CompositorFrame> frame(new CompositorFrame);
- frame->delegated_frame_data = frame_data.Pass();
+ frame->delegated_frame_data = std::move(frame_data);
frame->metadata.referenced_surfaces.push_back(parent_surface_id);
// Reference to Surface ID of a Surface that doesn't exist should be
// included in previous_contained_surfaces, but otherwise ignored.
frame->metadata.referenced_surfaces.push_back(nonexistent_surface_id);
- factory_.SubmitCompositorFrame(root_surface_id_, frame.Pass(),
+ factory_.SubmitCompositorFrame(root_surface_id_, std::move(frame),
SurfaceFactory::DrawCallback());
}
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index b022327..cf242c3 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "cc/surfaces/surface_factory.h"
+
+#include <utility>
+
#include "base/bind.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/copy_output_request.h"
@@ -9,7 +13,6 @@
#include "cc/output/delegated_frame_data.h"
#include "cc/resources/resource_provider.h"
#include "cc/surfaces/surface.h"
-#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/test/scheduler_test_common.h"
@@ -540,11 +543,11 @@ TEST_F(SurfaceFactoryTest, DuplicateCopyRequest) {
{
scoped_ptr<RenderPass> render_pass(RenderPass::Create());
scoped_ptr<DelegatedFrameData> 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<CompositorFrame> frame(new CompositorFrame);
frame->metadata.referenced_surfaces.push_back(surface_id_);
- 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());
}
void* source1 = &source1;
@@ -556,7 +559,7 @@ TEST_F(SurfaceFactoryTest, DuplicateCopyRequest) {
base::Bind(&CopyRequestTestCallback, &called1));
request->set_source(source1);
- factory_->RequestCopyOfSurface(surface_id_, request.Pass());
+ factory_->RequestCopyOfSurface(surface_id_, std::move(request));
EXPECT_FALSE(called1);
bool called2 = false;
@@ -564,7 +567,7 @@ TEST_F(SurfaceFactoryTest, DuplicateCopyRequest) {
base::Bind(&CopyRequestTestCallback, &called2));
request->set_source(source2);
- factory_->RequestCopyOfSurface(surface_id_, request.Pass());
+ factory_->RequestCopyOfSurface(surface_id_, std::move(request));
// Callbacks have different sources so neither should be called.
EXPECT_FALSE(called1);
EXPECT_FALSE(called2);
@@ -574,7 +577,7 @@ TEST_F(SurfaceFactoryTest, DuplicateCopyRequest) {
base::Bind(&CopyRequestTestCallback, &called3));
request->set_source(source1);
- factory_->RequestCopyOfSurface(surface_id_, request.Pass());
+ factory_->RequestCopyOfSurface(surface_id_, std::move(request));
// Two callbacks are from source1, so the first should be called.
EXPECT_TRUE(called1);
EXPECT_FALSE(called2);