OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 static bool ApproximatelyEqual(const gfx::Transform& a, | 2473 static bool ApproximatelyEqual(const gfx::Transform& a, |
2474 const gfx::Transform& b) { | 2474 const gfx::Transform& b) { |
2475 static const float component_tolerance = 0.1f; | 2475 static const float component_tolerance = 0.1f; |
2476 | 2476 |
2477 // We may have a larger discrepancy in the scroll components due to snapping | 2477 // We may have a larger discrepancy in the scroll components due to snapping |
2478 // (floating point error might round the other way). | 2478 // (floating point error might round the other way). |
2479 static const float translation_tolerance = 1.f; | 2479 static const float translation_tolerance = 1.f; |
2480 | 2480 |
2481 for (int row = 0; row < 4; row++) { | 2481 for (int row = 0; row < 4; row++) { |
2482 for (int col = 0; col < 4; col++) { | 2482 for (int col = 0; col < 4; col++) { |
2483 static const float delta = | 2483 const float delta = |
2484 std::abs(a.matrix().get(row, col) - b.matrix().get(row, col)); | 2484 std::abs(a.matrix().get(row, col) - b.matrix().get(row, col)); |
2485 const float tolerance = | 2485 const float tolerance = |
2486 col == 3 && row < 3 ? translation_tolerance : component_tolerance; | 2486 col == 3 && row < 3 ? translation_tolerance : component_tolerance; |
2487 if (delta > tolerance) | 2487 if (delta > tolerance) |
2488 return false; | 2488 return false; |
2489 } | 2489 } |
2490 } | 2490 } |
2491 | 2491 |
2492 return true; | 2492 return true; |
2493 } | 2493 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 PropertyTrees* trees_from_inputs) { | 2648 PropertyTrees* trees_from_inputs) { |
2649 return layer->layer_tree_host()->property_trees(); | 2649 return layer->layer_tree_host()->property_trees(); |
2650 } | 2650 } |
2651 | 2651 |
2652 PropertyTrees* GetPropertyTrees(LayerImpl* layer, | 2652 PropertyTrees* GetPropertyTrees(LayerImpl* layer, |
2653 PropertyTrees* trees_from_inputs) { | 2653 PropertyTrees* trees_from_inputs) { |
2654 return trees_from_inputs; | 2654 return trees_from_inputs; |
2655 } | 2655 } |
2656 | 2656 |
2657 } // namespace cc | 2657 } // namespace cc |
OLD | NEW |