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..9295e0246d178460dd65e900a507684753df7356 100644 |
--- a/cc/surfaces/surface_aggregator_perftest.cc |
+++ b/cc/surfaces/surface_aggregator_perftest.cc |
@@ -22,6 +22,8 @@ |
namespace cc { |
namespace { |
+static constexpr uint32_t kArbitraryClientId = 0; |
+ |
class EmptySurfaceFactoryClient : public SurfaceFactoryClient { |
public: |
void ReturnResources(const ReturnedResourceArray& resources) override {} |
@@ -49,7 +51,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(kArbitraryClientId, i, 0)); |
std::unique_ptr<RenderPass> pass(RenderPass::Create()); |
std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
@@ -86,17 +88,18 @@ class SurfaceAggregatorPerfTest : public testing::Test { |
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)); |
+ SurfaceId(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), |
+ factory_.SubmitCompositorFrame(SurfaceId(kArbitraryClientId, i, 0), |
+ std::move(frame), |
SurfaceFactory::DrawCallback()); |
} |
- factory_.Create(SurfaceId(0, num_surfaces + 1, 0)); |
+ factory_.Create(SurfaceId(kArbitraryClientId, num_surfaces + 1, 0)); |
timer_.Reset(); |
do { |
std::unique_ptr<RenderPass> pass(RenderPass::Create()); |
@@ -107,7 +110,7 @@ class SurfaceAggregatorPerfTest : public testing::Test { |
pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
surface_quad->SetNew(sqs, gfx::Rect(0, 0, 100, 100), |
gfx::Rect(0, 0, 100, 100), |
- SurfaceId(0, num_surfaces, 0)); |
+ SurfaceId(kArbitraryClientId, num_surfaces, 0)); |
if (full_damage) |
pass->damage_rect = gfx::Rect(0, 0, 100, 100); |
@@ -117,21 +120,21 @@ 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(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(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(kArbitraryClientId, num_surfaces + 1, 0)); |
for (int i = 1; i <= num_surfaces; i++) |
- factory_.Destroy(SurfaceId(0, i, 0)); |
+ factory_.Destroy(SurfaceId(kArbitraryClientId, i, 0)); |
} |
protected: |