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

Unified Diff: cc/math_util.cc

Issue 12096112: [cc] Trace detailed tile info when --trace-all-rendered-frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/math_util.cc
diff --git a/cc/math_util.cc b/cc/math_util.cc
index 481c4d69fd37db0cead1d156211ab80322e2a395..9f14395affe9bd1f39d644351b6de028d8073d1a 100644
--- a/cc/math_util.cc
+++ b/cc/math_util.cc
@@ -7,6 +7,7 @@
#include <cmath>
#include <limits>
+#include "base/values.h"
#include "ui/gfx/quad_f.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_conversions.h"
@@ -385,4 +386,20 @@ gfx::Vector2dF MathUtil::projectVector(gfx::Vector2dF source, gfx::Vector2dF des
return gfx::Vector2dF(projectedLength * destination.x(), projectedLength * destination.y());
}
+static scoped_ptr<base::Value> asValue(gfx::PointF pt) {
+ scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
+ res->SetDouble("x", pt.x());
+ res->SetDouble("y", pt.y());
+ return res.PassAs<base::Value>();
+}
+
+static scoped_ptr<base::Value> asValue(gfx::QuadF q) {
+ scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
+ res->Set("p1", asValue(q.p1()).release());
+ res->Set("p2", asValue(q.p2()).release());
+ res->Set("p3", asValue(q.p3()).release());
+ res->Set("p4", asValue(q.p4()).release());
+ return res.PassAs<base::Value>();
+}
+
} // namespace cc
« no previous file with comments | « cc/math_util.h ('k') | cc/picture_layer_tiling.cc » ('j') | cc/picture_layer_tiling.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698