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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2140313004: cc: Fix non root copy request visible rect in HighDPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 8fc6c56aa965dfad5eb8a116a5d70683faa61b5e..e22b0e95e16976c136db40a3e18d765f238ab353 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1466,7 +1466,6 @@ TEST_F(LayerTreeHostCommonTest, DrawableContentRectForReferenceFilterHighDpi) {
const float device_scale_factor = 2.0f;
LayerImpl* root = root_layer_for_testing();
- root->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor);
LayerImpl* child = AddChild<LayerImpl>(root);
child->SetDrawsContent(true);
@@ -4791,7 +4790,6 @@ TEST_F(LayerTreeHostCommonScalingTest, SurfaceLayerTransformsInHighDPI) {
root->layer_tree_impl()->SetViewportLayersFromIds(
Layer::INVALID_ID, page_scale->id(), Layer::INVALID_ID,
Layer::INVALID_ID);
- root->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor);
root->layer_tree_impl()->BuildLayerListAndPropertyTreesForTesting();
root->layer_tree_impl()->SetPageScaleOnActiveTree(page_scale_factor);
ExecuteCalculateDrawProperties(root, device_scale_factor, page_scale_factor,
@@ -5866,6 +5864,20 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectInNonRootCopyRequest) {
EXPECT_EQ(gfx::Rect(10, 10), copy_child->visible_layer_rect());
EXPECT_EQ(gfx::Rect(10, 10), copy_clipped_child->visible_layer_rect());
EXPECT_EQ(gfx::Rect(5, 5), copy_surface->visible_layer_rect());
+
+ // Case 3: When there is device scale factor.
+ float device_scale_factor = 2.f;
+ copy_layer->test_properties()->copy_requests.push_back(
+ CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback)));
+
+ DCHECK(!copy_layer->test_properties()->copy_requests.empty());
+ ExecuteCalculateDrawProperties(root, device_scale_factor);
+ DCHECK(copy_layer->test_properties()->copy_requests.empty());
+
+ EXPECT_EQ(gfx::Rect(50, 50), copy_layer->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), copy_child->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), copy_clipped_child->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(5, 5), copy_surface->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698