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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 res->AppendDouble(pt.y()); | 617 res->AppendDouble(pt.y()); |
618 res->AppendDouble(pt.z()); | 618 res->AppendDouble(pt.z()); |
619 } | 619 } |
620 | 620 |
621 void MathUtil::AddToTracedValue(const gfx::Vector2d& v, | 621 void MathUtil::AddToTracedValue(const gfx::Vector2d& v, |
622 base::debug::TracedValue* res) { | 622 base::debug::TracedValue* res) { |
623 res->AppendInteger(v.x()); | 623 res->AppendInteger(v.x()); |
624 res->AppendInteger(v.y()); | 624 res->AppendInteger(v.y()); |
625 } | 625 } |
626 | 626 |
| 627 void MathUtil::AddToTracedValue(const gfx::Vector2dF& v, |
| 628 base::debug::TracedValue* res) { |
| 629 res->AppendDouble(v.x()); |
| 630 res->AppendDouble(v.y()); |
| 631 } |
| 632 |
627 void MathUtil::AddToTracedValue(const gfx::QuadF& q, | 633 void MathUtil::AddToTracedValue(const gfx::QuadF& q, |
628 base::debug::TracedValue* res) { | 634 base::debug::TracedValue* res) { |
629 res->AppendDouble(q.p1().x()); | 635 res->AppendDouble(q.p1().x()); |
630 res->AppendDouble(q.p1().y()); | 636 res->AppendDouble(q.p1().y()); |
631 res->AppendDouble(q.p2().x()); | 637 res->AppendDouble(q.p2().x()); |
632 res->AppendDouble(q.p2().y()); | 638 res->AppendDouble(q.p2().y()); |
633 res->AppendDouble(q.p3().x()); | 639 res->AppendDouble(q.p3().x()); |
634 res->AppendDouble(q.p3().y()); | 640 res->AppendDouble(q.p3().y()); |
635 res->AppendDouble(q.p4().x()); | 641 res->AppendDouble(q.p4().x()); |
636 res->AppendDouble(q.p4().y()); | 642 res->AppendDouble(q.p4().y()); |
(...skipping 28 matching lines...) Expand all Loading... |
665 | 671 |
666 double MathUtil::AsDoubleSafely(double value) { | 672 double MathUtil::AsDoubleSafely(double value) { |
667 return std::min(value, std::numeric_limits<double>::max()); | 673 return std::min(value, std::numeric_limits<double>::max()); |
668 } | 674 } |
669 | 675 |
670 float MathUtil::AsFloatSafely(float value) { | 676 float MathUtil::AsFloatSafely(float value) { |
671 return std::min(value, std::numeric_limits<float>::max()); | 677 return std::min(value, std::numeric_limits<float>::max()); |
672 } | 678 } |
673 | 679 |
674 } // namespace cc | 680 } // namespace cc |
OLD | NEW |