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

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: Disable pixel test for Android 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
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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698