Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: cc/test/layer_test_common.cc

Issue 2673813002: Changes the bounds being sent for occlusion from physical pixels to DIP (Closed)
Patch Set: Resolving comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/surface_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
41 gfx::RectF floored_rect(std::floor(r.x()), std::floor(r.y()), 41 gfx::RectF floored_rect(std::floor(r.x()), std::floor(r.y()),
42 std::floor(r.width()), std::floor(r.height())); 42 std::floor(r.width()), std::floor(r.height()));
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 EXPECT_TRUE(iter->rect.Contains(iter->visible_rect));
danakj 2017/02/10 20:35:44 In order to exactly cover, would the rects not nee
malaykeshav 2017/02/10 21:02:50 I think its: all the |quads| (visible) combined sh
danakj 2017/02/10 22:06:45 OK I think you're right, and checking that the vis
52
51 gfx::RectF quad_rectf = MathUtil::MapClippedRect( 53 gfx::RectF quad_rectf = MathUtil::MapClippedRect(
52 iter->shared_quad_state->quad_to_target_transform, 54 iter->shared_quad_state->quad_to_target_transform,
53 gfx::RectF(iter->rect)); 55 gfx::RectF(iter->visible_rect));
54 56
55 // Before testing for exact coverage in the integer world, assert that 57 // Before testing for exact coverage in the integer world, assert that
56 // rounding will not round the rect incorrectly. 58 // rounding will not round the rect incorrectly.
57 ASSERT_TRUE(CanRectFBeSafelyRoundedToRect(quad_rectf)); 59 ASSERT_TRUE(CanRectFBeSafelyRoundedToRect(quad_rectf));
58 60
59 gfx::Rect quad_rect = gfx::ToEnclosingRect(quad_rectf); 61 gfx::Rect quad_rect = gfx::ToEnclosingRect(quad_rectf);
60 62
61 EXPECT_TRUE(rect.Contains(quad_rect)) << quad_string << iter.index() 63 EXPECT_TRUE(rect.Contains(quad_rect)) << quad_string << iter.index()
62 << " rect: " << rect.ToString() 64 << " rect: " << rect.ToString()
63 << " quad: " << quad_rect.ToString(); 65 << " quad: " << quad_rect.ToString();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 209 }
208 210
209 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} 211 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {}
210 212
211 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { 213 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() {
212 root_layer_for_testing()->test_properties()->copy_requests.push_back( 214 root_layer_for_testing()->test_properties()->copy_requests.push_back(
213 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); 215 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback)));
214 } 216 }
215 217
216 } // namespace cc 218 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698