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

Side by Side Diff: webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc

Issue 23724024: Refactor TransformPoint{,Reverse}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and resolve conflicts. Created 7 years, 3 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 | « ui/views/view.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_image_layer.h" 6 #include "cc/layers/picture_image_layer.h"
7 #include "cc/test/fake_layer_tree_host.h" 7 #include "cc/test/fake_layer_tree_host.h"
8 #include "cc/test/geometry_test_utils.h" 8 #include "cc/test/geometry_test_utils.h"
9 #include "cc/trees/layer_tree_host_common.h" 9 #include "cc/trees/layer_tree_host_common.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 15 matching lines...) Expand all
26 layer->SetFixedBounds(gfx::Size(100, 100)); 26 layer->SetFixedBounds(gfx::Size(100, 100));
27 layer->setBounds(WebSize(100, 100)); 27 layer->setBounds(WebSize(100, 100));
28 EXPECT_EQ(WebSize(100, 100), layer->bounds()); 28 EXPECT_EQ(WebSize(100, 100), layer->bounds());
29 EXPECT_EQ(gfx::Size(100, 100), layer->layer()->bounds()); 29 EXPECT_EQ(gfx::Size(100, 100), layer->layer()->bounds());
30 EXPECT_EQ(gfx::Transform(), layer->layer()->transform()); 30 EXPECT_EQ(gfx::Transform(), layer->layer()->transform());
31 } 31 }
32 32
33 gfx::Point3F TransformPoint(const gfx::Transform& transform, 33 gfx::Point3F TransformPoint(const gfx::Transform& transform,
34 const gfx::Point3F& point) { 34 const gfx::Point3F& point) {
35 gfx::Point3F result = point; 35 gfx::Point3F result = point;
36 transform.TransformPoint(result); 36 transform.TransformPoint(&result);
37 return result; 37 return result;
38 } 38 }
39 39
40 void CheckBoundsScaleSimple(WebLayerImplFixedBounds* layer, 40 void CheckBoundsScaleSimple(WebLayerImplFixedBounds* layer,
41 const WebSize& bounds, 41 const WebSize& bounds,
42 const gfx::Size& fixed_bounds) { 42 const gfx::Size& fixed_bounds) {
43 layer->setBounds(bounds); 43 layer->setBounds(bounds);
44 layer->SetFixedBounds(fixed_bounds); 44 layer->SetFixedBounds(fixed_bounds);
45 45
46 EXPECT_EQ(bounds, layer->bounds()); 46 EXPECT_EQ(bounds, layer->bounds());
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to 195 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to
196 // WebLayerImpl. 196 // WebLayerImpl.
197 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), 197 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f),
198 transform, 198 transform,
199 sublayer_transform); 199 sublayer_transform);
200 } 200 }
201 201
202 } // namespace 202 } // namespace
203 } // namespace webkit 203 } // namespace webkit
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698