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

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: Dont expose to extension yet Created 7 years, 10 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
« no previous file with comments | « cc/math_util.h ('k') | cc/picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/math_util.cc
diff --git a/cc/math_util.cc b/cc/math_util.cc
index 481c4d69fd37db0cead1d156211ab80322e2a395..ff24fa2eb24458caa01a8dd215995a83eafba0b8 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,27 @@ gfx::Vector2dF MathUtil::projectVector(gfx::Vector2dF source, gfx::Vector2dF des
return gfx::Vector2dF(projectedLength * destination.x(), projectedLength * destination.y());
}
+scoped_ptr<base::Value> MathUtil::asValue(gfx::Size s) {
+ scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
+ res->SetDouble("width", s.width());
+ res->SetDouble("height", s.height());
+ return res.PassAs<base::Value>();
+}
+
+scoped_ptr<base::Value> MathUtil::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>();
+}
+
+scoped_ptr<base::Value> MathUtil::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_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698