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

Side by Side Diff: cc/base/math_util.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link crbug to TODO Created 6 years, 2 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 | « cc/base/math_util.h ('k') | cc/blink/web_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/base/math_util.h ('k') | cc/blink/web_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698