OLD | NEW |
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/base/math_util.h" | 5 #include "cc/base/math_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 res->AppendDouble(pt.y()); | 736 res->AppendDouble(pt.y()); |
737 res->AppendDouble(pt.z()); | 737 res->AppendDouble(pt.z()); |
738 } | 738 } |
739 | 739 |
740 void MathUtil::AddToTracedValue(const gfx::Vector2d& v, | 740 void MathUtil::AddToTracedValue(const gfx::Vector2d& v, |
741 base::debug::TracedValue* res) { | 741 base::debug::TracedValue* res) { |
742 res->AppendInteger(v.x()); | 742 res->AppendInteger(v.x()); |
743 res->AppendInteger(v.y()); | 743 res->AppendInteger(v.y()); |
744 } | 744 } |
745 | 745 |
| 746 void MathUtil::AddToTracedValue(const gfx::Vector2dF& v, |
| 747 base::debug::TracedValue* res) { |
| 748 res->AppendDouble(v.x()); |
| 749 res->AppendDouble(v.y()); |
| 750 } |
| 751 |
746 void MathUtil::AddToTracedValue(const gfx::QuadF& q, | 752 void MathUtil::AddToTracedValue(const gfx::QuadF& q, |
747 base::debug::TracedValue* res) { | 753 base::debug::TracedValue* res) { |
748 res->AppendDouble(q.p1().x()); | 754 res->AppendDouble(q.p1().x()); |
749 res->AppendDouble(q.p1().y()); | 755 res->AppendDouble(q.p1().y()); |
750 res->AppendDouble(q.p2().x()); | 756 res->AppendDouble(q.p2().x()); |
751 res->AppendDouble(q.p2().y()); | 757 res->AppendDouble(q.p2().y()); |
752 res->AppendDouble(q.p3().x()); | 758 res->AppendDouble(q.p3().x()); |
753 res->AppendDouble(q.p3().y()); | 759 res->AppendDouble(q.p3().y()); |
754 res->AppendDouble(q.p4().x()); | 760 res->AppendDouble(q.p4().x()); |
755 res->AppendDouble(q.p4().y()); | 761 res->AppendDouble(q.p4().y()); |
(...skipping 28 matching lines...) Expand all Loading... |
784 | 790 |
785 double MathUtil::AsDoubleSafely(double value) { | 791 double MathUtil::AsDoubleSafely(double value) { |
786 return std::min(value, std::numeric_limits<double>::max()); | 792 return std::min(value, std::numeric_limits<double>::max()); |
787 } | 793 } |
788 | 794 |
789 float MathUtil::AsFloatSafely(float value) { | 795 float MathUtil::AsFloatSafely(float value) { |
790 return std::min(value, std::numeric_limits<float>::max()); | 796 return std::min(value, std::numeric_limits<float>::max()); |
791 } | 797 } |
792 | 798 |
793 } // namespace cc | 799 } // namespace cc |
OLD | NEW |