OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/test/layer_test_common.h" | 5 #include "cc/test/layer_test_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/animation/animation_id_provider.h" | 10 #include "cc/animation/animation_id_provider.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 EXPECT_TRUE(remaining.IsEmpty()); | 70 EXPECT_TRUE(remaining.IsEmpty()); |
71 } | 71 } |
72 | 72 |
73 // static | 73 // static |
74 void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads, | 74 void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads, |
75 const gfx::Rect& occluded, | 75 const gfx::Rect& occluded, |
76 size_t* partially_occluded_count) { | 76 size_t* partially_occluded_count) { |
77 // No quad should exist if it's fully occluded. | 77 // No quad should exist if it's fully occluded. |
78 for (const auto& quad : quads) { | 78 for (auto* quad : quads) { |
79 gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect( | 79 gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect( |
80 quad->shared_quad_state->quad_to_target_transform, quad->visible_rect); | 80 quad->shared_quad_state->quad_to_target_transform, quad->visible_rect); |
81 EXPECT_FALSE(occluded.Contains(target_visible_rect)); | 81 EXPECT_FALSE(occluded.Contains(target_visible_rect)); |
82 } | 82 } |
83 | 83 |
84 // Quads that are fully occluded on one axis only should be shrunken. | 84 // Quads that are fully occluded on one axis only should be shrunken. |
85 for (const auto& quad : quads) { | 85 for (auto* quad : quads) { |
86 gfx::Rect target_rect = MathUtil::MapEnclosingClippedRect( | 86 gfx::Rect target_rect = MathUtil::MapEnclosingClippedRect( |
87 quad->shared_quad_state->quad_to_target_transform, quad->rect); | 87 quad->shared_quad_state->quad_to_target_transform, quad->rect); |
88 if (!quad->shared_quad_state->quad_to_target_transform | 88 if (!quad->shared_quad_state->quad_to_target_transform |
89 .IsIdentityOrIntegerTranslation()) { | 89 .IsIdentityOrIntegerTranslation()) { |
90 DCHECK(quad->shared_quad_state->quad_to_target_transform | 90 DCHECK(quad->shared_quad_state->quad_to_target_transform |
91 .IsPositiveScaleOrTranslation()) | 91 .IsPositiveScaleOrTranslation()) |
92 << quad->shared_quad_state->quad_to_target_transform.ToString(); | 92 << quad->shared_quad_state->quad_to_target_transform.ToString(); |
93 gfx::RectF target_rectf = MathUtil::MapClippedRect( | 93 gfx::RectF target_rectf = MathUtil::MapClippedRect( |
94 quad->shared_quad_state->quad_to_target_transform, | 94 quad->shared_quad_state->quad_to_target_transform, |
95 gfx::RectF(quad->rect)); | 95 gfx::RectF(quad->rect)); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 | 207 |
208 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} | 208 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} |
209 | 209 |
210 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { | 210 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { |
211 root_layer_for_testing()->test_properties()->copy_requests.push_back( | 211 root_layer_for_testing()->test_properties()->copy_requests.push_back( |
212 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); | 212 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); |
213 } | 213 } |
214 | 214 |
215 } // namespace cc | 215 } // namespace cc |
OLD | NEW |