| Index: cc/surfaces/surface_aggregator_perftest.cc
|
| diff --git a/cc/surfaces/surface_aggregator_perftest.cc b/cc/surfaces/surface_aggregator_perftest.cc
|
| index d9037435f2bc3cf4e7f6b26d5eeb7a2b87fb9b7e..a1e45654b8503c68c8ed5fec4caf9a20effd3ae9 100644
|
| --- a/cc/surfaces/surface_aggregator_perftest.cc
|
| +++ b/cc/surfaces/surface_aggregator_perftest.cc
|
| @@ -22,6 +22,9 @@
|
| namespace cc {
|
| namespace {
|
|
|
| +static constexpr uint32_t kArbitraryGpuId = 0;
|
| +static constexpr uint32_t kArbitraryClientId = 0;
|
| +
|
| class EmptySurfaceFactoryClient : public SurfaceFactoryClient {
|
| public:
|
| void ReturnResources(const ReturnedResourceArray& resources) override {}
|
| @@ -49,7 +52,7 @@ class SurfaceAggregatorPerfTest : public testing::Test {
|
| aggregator_.reset(new SurfaceAggregator(&manager_, resource_provider_.get(),
|
| optimize_damage));
|
| for (int i = 1; i <= num_surfaces; i++) {
|
| - factory_.Create(SurfaceId(0, i, 0));
|
| + factory_.Create(SurfaceId(kArbitraryGpuId, kArbitraryClientId, i, 0));
|
| std::unique_ptr<RenderPass> pass(RenderPass::Create());
|
| std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
|
|
|
| @@ -85,18 +88,21 @@ class SurfaceAggregatorPerfTest : public testing::Test {
|
| if (i > 1) {
|
| SurfaceDrawQuad* surface_quad =
|
| pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
|
| - surface_quad->SetNew(sqs, gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1),
|
| - SurfaceId(0, i - 1, 0));
|
| + surface_quad->SetNew(
|
| + sqs, gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1),
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, i - 1, 0));
|
| }
|
|
|
| frame_data->render_pass_list.push_back(std::move(pass));
|
| CompositorFrame frame;
|
| frame.delegated_frame_data = std::move(frame_data);
|
| - factory_.SubmitCompositorFrame(SurfaceId(0, i, 0), std::move(frame),
|
| - SurfaceFactory::DrawCallback());
|
| + factory_.SubmitCompositorFrame(
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, i, 0),
|
| + std::move(frame), SurfaceFactory::DrawCallback());
|
| }
|
|
|
| - factory_.Create(SurfaceId(0, num_surfaces + 1, 0));
|
| + factory_.Create(
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, num_surfaces + 1, 0));
|
| timer_.Reset();
|
| do {
|
| std::unique_ptr<RenderPass> pass(RenderPass::Create());
|
| @@ -105,9 +111,9 @@ class SurfaceAggregatorPerfTest : public testing::Test {
|
| SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState();
|
| SurfaceDrawQuad* surface_quad =
|
| pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
|
| - surface_quad->SetNew(sqs, gfx::Rect(0, 0, 100, 100),
|
| - gfx::Rect(0, 0, 100, 100),
|
| - SurfaceId(0, num_surfaces, 0));
|
| + surface_quad->SetNew(
|
| + sqs, gfx::Rect(0, 0, 100, 100), gfx::Rect(0, 0, 100, 100),
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, num_surfaces, 0));
|
|
|
| if (full_damage)
|
| pass->damage_rect = gfx::Rect(0, 0, 100, 100);
|
| @@ -117,21 +123,22 @@ class SurfaceAggregatorPerfTest : public testing::Test {
|
| frame_data->render_pass_list.push_back(std::move(pass));
|
| CompositorFrame frame;
|
| frame.delegated_frame_data = std::move(frame_data);
|
| - factory_.SubmitCompositorFrame(SurfaceId(0, num_surfaces + 1, 0),
|
| - std::move(frame),
|
| - SurfaceFactory::DrawCallback());
|
| + factory_.SubmitCompositorFrame(
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, num_surfaces + 1, 0),
|
| + std::move(frame), SurfaceFactory::DrawCallback());
|
|
|
| - CompositorFrame aggregated =
|
| - aggregator_->Aggregate(SurfaceId(0, num_surfaces + 1, 0));
|
| + CompositorFrame aggregated = aggregator_->Aggregate(
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, num_surfaces + 1, 0));
|
| timer_.NextLap();
|
| } while (!timer_.HasTimeLimitExpired());
|
|
|
| perf_test::PrintResult("aggregator_speed", "", name, timer_.LapsPerSecond(),
|
| "runs/s", true);
|
|
|
| - factory_.Destroy(SurfaceId(0, num_surfaces + 1, 0));
|
| + factory_.Destroy(
|
| + SurfaceId(kArbitraryGpuId, kArbitraryClientId, num_surfaces + 1, 0));
|
| for (int i = 1; i <= num_surfaces; i++)
|
| - factory_.Destroy(SurfaceId(0, i, 0));
|
| + factory_.Destroy(SurfaceId(kArbitraryGpuId, kArbitraryClientId, i, 0));
|
| }
|
|
|
| protected:
|
|
|