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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 res->AppendInteger(v.x()); | 771 res->AppendInteger(v.x()); |
772 res->AppendInteger(v.y()); | 772 res->AppendInteger(v.y()); |
773 } | 773 } |
774 | 774 |
775 void MathUtil::AddToTracedValue(const gfx::Vector2dF& v, | 775 void MathUtil::AddToTracedValue(const gfx::Vector2dF& v, |
776 base::debug::TracedValue* res) { | 776 base::debug::TracedValue* res) { |
777 res->AppendDouble(v.x()); | 777 res->AppendDouble(v.x()); |
778 res->AppendDouble(v.y()); | 778 res->AppendDouble(v.y()); |
779 } | 779 } |
780 | 780 |
| 781 void MathUtil::AddToTracedValue(const gfx::ScrollOffset& v, |
| 782 base::debug::TracedValue* res) { |
| 783 res->AppendDouble(v.x()); |
| 784 res->AppendDouble(v.y()); |
| 785 } |
| 786 |
781 void MathUtil::AddToTracedValue(const gfx::QuadF& q, | 787 void MathUtil::AddToTracedValue(const gfx::QuadF& q, |
782 base::debug::TracedValue* res) { | 788 base::debug::TracedValue* res) { |
783 res->AppendDouble(q.p1().x()); | 789 res->AppendDouble(q.p1().x()); |
784 res->AppendDouble(q.p1().y()); | 790 res->AppendDouble(q.p1().y()); |
785 res->AppendDouble(q.p2().x()); | 791 res->AppendDouble(q.p2().x()); |
786 res->AppendDouble(q.p2().y()); | 792 res->AppendDouble(q.p2().y()); |
787 res->AppendDouble(q.p3().x()); | 793 res->AppendDouble(q.p3().x()); |
788 res->AppendDouble(q.p3().y()); | 794 res->AppendDouble(q.p3().y()); |
789 res->AppendDouble(q.p4().x()); | 795 res->AppendDouble(q.p4().x()); |
790 res->AppendDouble(q.p4().y()); | 796 res->AppendDouble(q.p4().y()); |
(...skipping 28 matching lines...) Expand all Loading... |
819 | 825 |
820 double MathUtil::AsDoubleSafely(double value) { | 826 double MathUtil::AsDoubleSafely(double value) { |
821 return std::min(value, std::numeric_limits<double>::max()); | 827 return std::min(value, std::numeric_limits<double>::max()); |
822 } | 828 } |
823 | 829 |
824 float MathUtil::AsFloatSafely(float value) { | 830 float MathUtil::AsFloatSafely(float value) { |
825 return std::min(value, std::numeric_limits<float>::max()); | 831 return std::min(value, std::numeric_limits<float>::max()); |
826 } | 832 } |
827 | 833 |
828 } // namespace cc | 834 } // namespace cc |
OLD | NEW |