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

Unified Diff: cc/base/math_util.cc

Issue 20994007: Add impl/comp scrolling instrumentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/base/math_util.cc
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 39a183e27dbb35ffaef05f704f1dd821d33fb1ef..b9e715612fca9c6866dd62e274c5139da9e7848f 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/transform.h"
+#include "ui/gfx/vector2d.h"
#include "ui/gfx/vector2d_f.h"
namespace cc {
@@ -496,6 +497,20 @@ scoped_ptr<base::Value> MathUtil::AsValue(gfx::Rect r) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(gfx::Vector2d vec) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ res->AppendInteger(vec.x());
+ res->AppendInteger(vec.y());
+ return res.PassAs<base::Value>();
+}
+
+scoped_ptr<base::Value> MathUtil::AsValue(gfx::Vector2dF vec) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ res->AppendDouble(vec.x());
+ res->AppendDouble(vec.y());
+ return res.PassAs<base::Value>();
+}
+
bool MathUtil::FromValue(const base::Value* raw_value, gfx::Rect* out_rect) {
const base::ListValue* value = NULL;
if (!raw_value->GetAsList(&value))
« no previous file with comments | « cc/base/math_util.h ('k') | cc/layers/layer.cc » ('j') | cc/trees/layer_tree_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698