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

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

Issue 394193003: Implement HiDPI and pinch-zoom scaling of filter params (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra headers; unneeded code in tests Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « cc/base/math_util.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/base/math_util.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698