Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 return floored_rect == r; | 43 return floored_rect == r; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void LayerTestCommon::VerifyQuadsExactlyCoverRect(const QuadList& quads, | 46 void LayerTestCommon::VerifyQuadsExactlyCoverRect(const QuadList& quads, |
| 47 const gfx::Rect& rect) { | 47 const gfx::Rect& rect) { |
| 48 Region remaining = rect; | 48 Region remaining = rect; |
| 49 | 49 |
| 50 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) { | 50 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) { |
| 51 gfx::RectF quad_rectf = MathUtil::MapClippedRect( | 51 gfx::RectF quad_rectf = MathUtil::MapClippedRect( |
| 52 iter->shared_quad_state->quad_to_target_transform, | 52 iter->shared_quad_state->quad_to_target_transform, |
| 53 gfx::RectF(iter->rect)); | 53 gfx::RectF(iter->visible_rect)); |
|
danakj
2017/02/10 16:32:22
Should this verify quad rect /and/ visible rect?
malaykeshav
2017/02/10 20:24:58
Done
| |
| 54 | 54 |
| 55 // Before testing for exact coverage in the integer world, assert that | 55 // Before testing for exact coverage in the integer world, assert that |
| 56 // rounding will not round the rect incorrectly. | 56 // rounding will not round the rect incorrectly. |
| 57 ASSERT_TRUE(CanRectFBeSafelyRoundedToRect(quad_rectf)); | 57 ASSERT_TRUE(CanRectFBeSafelyRoundedToRect(quad_rectf)); |
| 58 | 58 |
| 59 gfx::Rect quad_rect = gfx::ToEnclosingRect(quad_rectf); | 59 gfx::Rect quad_rect = gfx::ToEnclosingRect(quad_rectf); |
| 60 | 60 |
| 61 EXPECT_TRUE(rect.Contains(quad_rect)) << quad_string << iter.index() | 61 EXPECT_TRUE(rect.Contains(quad_rect)) << quad_string << iter.index() |
| 62 << " rect: " << rect.ToString() | 62 << " rect: " << rect.ToString() |
| 63 << " quad: " << quad_rect.ToString(); | 63 << " quad: " << quad_rect.ToString(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 } | 207 } |
| 208 | 208 |
| 209 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} | 209 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} |
| 210 | 210 |
| 211 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { | 211 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { |
| 212 root_layer_for_testing()->test_properties()->copy_requests.push_back( | 212 root_layer_for_testing()->test_properties()->copy_requests.push_back( |
| 213 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); | 213 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace cc | 216 } // namespace cc |
| OLD | NEW |