OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/debug/lap_timer.h" | 9 #include "cc/debug/lap_timer.h" |
10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 gfx::PointF uv_top_left(0, 0); | 66 gfx::PointF uv_top_left(0, 0); |
67 gfx::PointF uv_bottom_right(1, 1); | 67 gfx::PointF uv_bottom_right(1, 1); |
68 SkColor background_color = SK_ColorRED; | 68 SkColor background_color = SK_ColorRED; |
69 float vertex_opacity[4] = {1.f, 1.f, 1.f, 1.f}; | 69 float vertex_opacity[4] = {1.f, 1.f, 1.f, 1.f}; |
70 bool y_flipped = false; | 70 bool y_flipped = false; |
71 bool nearest_neighbor = true; | 71 bool nearest_neighbor = true; |
72 | 72 |
73 quad->SetNew(shared_state_, rect, rect, rect, resource_id, | 73 quad->SetNew(shared_state_, rect, rect, rect, resource_id, |
74 premultiplied_alpha, uv_top_left, uv_bottom_right, | 74 premultiplied_alpha, uv_top_left, uv_bottom_right, |
75 background_color, vertex_opacity, y_flipped, | 75 background_color, vertex_opacity, y_flipped, |
76 nearest_neighbor); | 76 nearest_neighbor, false); |
77 quads->push_back(quad); | 77 quads->push_back(quad); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 void RunIterateResourceTest(const std::string& test_name, int quad_count) { | 81 void RunIterateResourceTest(const std::string& test_name, int quad_count) { |
82 CreateRenderPass(); | 82 CreateRenderPass(); |
83 std::vector<DrawQuad*> quads; | 83 std::vector<DrawQuad*> quads; |
84 GenerateTextureDrawQuads(quad_count, &quads); | 84 GenerateTextureDrawQuads(quad_count, &quads); |
85 | 85 |
86 timer_.Reset(); | 86 timer_.Reset(); |
(...skipping 17 matching lines...) Expand all Loading... |
104 }; | 104 }; |
105 | 105 |
106 TEST_F(DrawQuadPerfTest, IterateResources) { | 106 TEST_F(DrawQuadPerfTest, IterateResources) { |
107 RunIterateResourceTest("10_quads", 10); | 107 RunIterateResourceTest("10_quads", 10); |
108 RunIterateResourceTest("100_quads", 100); | 108 RunIterateResourceTest("100_quads", 100); |
109 RunIterateResourceTest("500_quads", 500); | 109 RunIterateResourceTest("500_quads", 500); |
110 } | 110 } |
111 | 111 |
112 } // namespace | 112 } // namespace |
113 } // namespace cc | 113 } // namespace cc |
OLD | NEW |