| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
| 8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "cc/ipc/cc_param_traits.h" | 9 #include "cc/ipc/cc_param_traits.h" |
| 10 #include "cc/ipc/compositor_frame.mojom.h" | 10 #include "cc/ipc/compositor_frame.mojom.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 static void RunCompositorFrameTest(const std::string& test_name, | 196 static void RunCompositorFrameTest(const std::string& test_name, |
| 197 uint32_t num_quads, | 197 uint32_t num_quads, |
| 198 uint32_t num_passes, | 198 uint32_t num_passes, |
| 199 UseSingleSharedQuadState single_sqs) { | 199 UseSingleSharedQuadState single_sqs) { |
| 200 CompositorFrame frame; | 200 CompositorFrame frame; |
| 201 | 201 |
| 202 for (uint32_t i = 0; i < num_passes; ++i) { | 202 for (uint32_t i = 0; i < num_passes; ++i) { |
| 203 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); | 203 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 204 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), | 204 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), |
| 205 gfx::Transform()); | 205 gfx::Transform(), FilterOperations(), |
| 206 FilterOperations()); |
| 206 for (uint32_t j = 0; j < num_quads; ++j) { | 207 for (uint32_t j = 0; j < num_quads; ++j) { |
| 207 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO) | 208 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO) |
| 208 render_pass->CreateAndAppendSharedQuadState(); | 209 render_pass->CreateAndAppendSharedQuadState(); |
| 209 const gfx::Rect bounds(100, 100, 100, 100); | 210 const gfx::Rect bounds(100, 100, 100, 100); |
| 210 const bool kForceAntiAliasingOff = true; | 211 const bool kForceAntiAliasingOff = true; |
| 211 SolidColorDrawQuad* quad = | 212 SolidColorDrawQuad* quad = |
| 212 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 213 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 213 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds, | 214 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds, |
| 214 SK_ColorRED, kForceAntiAliasingOff); | 215 SK_ColorRED, kForceAntiAliasingOff); |
| 215 } | 216 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 UseSingleSharedQuadState::NO); | 257 UseSingleSharedQuadState::NO); |
| 257 } | 258 } |
| 258 | 259 |
| 259 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) { | 260 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) { |
| 260 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000, | 261 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000, |
| 261 UseSingleSharedQuadState::NO); | 262 UseSingleSharedQuadState::NO); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace | 265 } // namespace |
| 265 } // namespace cc | 266 } // namespace cc |
| OLD | NEW |