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

Side by Side Diff: cc/blink/web_layer_impl_fixed_bounds_unittest.cc

Issue 1859733002: cc: Remove usage of Layer draw_transform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments Created 4 years, 8 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 | « no previous file | cc/layers/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "cc/blink/web_layer_impl_fixed_bounds.h" 6 #include "cc/blink/web_layer_impl_fixed_bounds.h"
7 #include "cc/layers/picture_image_layer.h" 7 #include "cc/layers/picture_image_layer.h"
8 #include "cc/test/fake_layer_tree_host.h" 8 #include "cc/test/fake_layer_tree_host.h"
9 #include "cc/test/geometry_test_utils.h" 9 #include "cc/test/geometry_test_utils.h"
10 #include "cc/test/test_task_graph_runner.h" 10 #include "cc/test/test_task_graph_runner.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 scoped_ptr<WebLayerImplFixedBounds> layer(new WebLayerImplFixedBounds()); 62 scoped_ptr<WebLayerImplFixedBounds> layer(new WebLayerImplFixedBounds());
63 CheckBoundsScaleSimple(layer.get(), WebSize(100, 200), gfx::Size(150, 250)); 63 CheckBoundsScaleSimple(layer.get(), WebSize(100, 200), gfx::Size(150, 250));
64 // Change fixed_bounds. 64 // Change fixed_bounds.
65 CheckBoundsScaleSimple(layer.get(), WebSize(100, 200), gfx::Size(75, 100)); 65 CheckBoundsScaleSimple(layer.get(), WebSize(100, 200), gfx::Size(75, 100));
66 // Change bounds. 66 // Change bounds.
67 CheckBoundsScaleSimple(layer.get(), WebSize(300, 100), gfx::Size(75, 100)); 67 CheckBoundsScaleSimple(layer.get(), WebSize(300, 100), gfx::Size(75, 100));
68 } 68 }
69 69
70 void ExpectEqualLayerRectsInTarget(cc::Layer* layer1, cc::Layer* layer2) { 70 void ExpectEqualLayerRectsInTarget(cc::Layer* layer1, cc::Layer* layer2) {
71 gfx::RectF layer1_rect_in_target(gfx::SizeF(layer1->bounds())); 71 gfx::RectF layer1_rect_in_target(gfx::SizeF(layer1->bounds()));
72 layer1->draw_transform().TransformRect(&layer1_rect_in_target); 72 layer1->screen_space_transform().TransformRect(&layer1_rect_in_target);
73 73
74 gfx::RectF layer2_rect_in_target(gfx::SizeF(layer2->bounds())); 74 gfx::RectF layer2_rect_in_target(gfx::SizeF(layer2->bounds()));
75 layer2->draw_transform().TransformRect(&layer2_rect_in_target); 75 layer2->screen_space_transform().TransformRect(&layer2_rect_in_target);
76 76
77 EXPECT_FLOAT_RECT_EQ(layer1_rect_in_target, layer2_rect_in_target); 77 EXPECT_FLOAT_RECT_EQ(layer1_rect_in_target, layer2_rect_in_target);
78 } 78 }
79 79
80 void CompareFixedBoundsLayerAndNormalLayer(const WebFloatPoint& anchor_point, 80 void CompareFixedBoundsLayerAndNormalLayer(const WebFloatPoint& anchor_point,
81 const gfx::Transform& transform) { 81 const gfx::Transform& transform) {
82 const gfx::Size kDeviceViewportSize(800, 600); 82 const gfx::Size kDeviceViewportSize(800, 600);
83 const float kDeviceScaleFactor = 2.f; 83 const float kDeviceScaleFactor = 2.f;
84 const float kPageScaleFactor = 1.5f; 84 const float kPageScaleFactor = 1.5f;
85 85
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); 170 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform);
171 171
172 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to 172 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to
173 // WebLayerImpl. 173 // WebLayerImpl.
174 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); 174 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform);
175 } 175 }
176 176
177 } // namespace 177 } // namespace
178 } // namespace cc_blink 178 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698