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

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

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « base/debug/trace_event_impl.h ('k') | cc/base/math_util.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 #ifndef CC_BASE_MATH_UTIL_H_ 5 #ifndef CC_BASE_MATH_UTIL_H_
6 #define CC_BASE_MATH_UTIL_H_ 6 #define CC_BASE_MATH_UTIL_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/base/cc_export.h"
14 #include "ui/gfx/box_f.h" 14 #include "ui/gfx/box_f.h"
15 #include "ui/gfx/point3_f.h" 15 #include "ui/gfx/point3_f.h"
16 #include "ui/gfx/point_f.h" 16 #include "ui/gfx/point_f.h"
17 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
18 #include "ui/gfx/transform.h" 18 #include "ui/gfx/transform.h"
19 19
20 namespace base { class Value; } 20 namespace base {
21 class Value;
22 namespace debug {
23 class TracedValue;
24 }
25 }
21 26
22 namespace gfx { 27 namespace gfx {
23 class QuadF; 28 class QuadF;
24 class Rect; 29 class Rect;
25 class RectF; 30 class RectF;
26 class Transform; 31 class Transform;
27 class Vector2dF; 32 class Vector2dF;
28 class Vector2d; 33 class Vector2d;
29 } 34 }
30 35
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 static scoped_ptr<base::Value> AsValue(const gfx::Size& s); 181 static scoped_ptr<base::Value> AsValue(const gfx::Size& s);
177 static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s); 182 static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s);
178 static scoped_ptr<base::Value> AsValue(const gfx::Rect& r); 183 static scoped_ptr<base::Value> AsValue(const gfx::Rect& r);
179 static bool FromValue(const base::Value*, gfx::Rect* out_rect); 184 static bool FromValue(const base::Value*, gfx::Rect* out_rect);
180 static scoped_ptr<base::Value> AsValue(const gfx::PointF& q); 185 static scoped_ptr<base::Value> AsValue(const gfx::PointF& q);
181 static scoped_ptr<base::Value> AsValue(const gfx::Point3F&); 186 static scoped_ptr<base::Value> AsValue(const gfx::Point3F&);
182 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v); 187 static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v);
183 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q); 188 static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q);
184 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect); 189 static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect);
185 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform); 190 static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform);
186 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box); 191 static scoped_ptr<base::Value> AsValue(const gfx::BoxF& box);
nduca 2014/07/30 07:52:32 do we need these now that we have AddToTracedValue
yurys 2014/07/30 09:44:58 Hopefully not. I will remove all unused utility fu
yurys 2014/07/30 14:41:16 Some of them need to stay as they are used in Laye
187 192
193 static void AddToTracedValue(const gfx::Size& s,
194 base::debug::TracedValue* res);
195 static void AddToTracedValue(const gfx::SizeF& s,
196 base::debug::TracedValue* res);
197 static void AddToTracedValue(const gfx::Rect& r,
198 base::debug::TracedValue* res);
199 static void AddToTracedValue(const gfx::PointF& q,
200 base::debug::TracedValue* res);
201 static void AddToTracedValue(const gfx::Point3F&,
202 base::debug::TracedValue* res);
203 static void AddToTracedValue(const gfx::Vector2d& v,
204 base::debug::TracedValue* res);
205 static void AddToTracedValue(const gfx::QuadF& q,
206 base::debug::TracedValue* res);
207 static void AddToTracedValue(const gfx::RectF& rect,
208 base::debug::TracedValue* res);
209 static void AddToTracedValue(const gfx::Transform& transform,
210 base::debug::TracedValue* res);
211 static void AddToTracedValue(const gfx::BoxF& box,
212 base::debug::TracedValue* res);
213
188 // Returns a base::Value representation of the floating point value. 214 // Returns a base::Value representation of the floating point value.
189 // If the value is inf, returns max double/float representation. 215 // If the value is inf, returns max double/float representation.
190 static scoped_ptr<base::Value> AsValueSafely(double value); 216 static scoped_ptr<base::Value> AsValueSafely(double value);
191 static scoped_ptr<base::Value> AsValueSafely(float value); 217 static scoped_ptr<base::Value> AsValueSafely(float value);
218 static double AsDoubleSafely(double value);
219 static float AsFloatSafely(float value);
192 }; 220 };
193 221
194 } // namespace cc 222 } // namespace cc
195 223
196 #endif // CC_BASE_MATH_UTIL_H_ 224 #endif // CC_BASE_MATH_UTIL_H_
OLDNEW
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | cc/base/math_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698