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

Side by Side Diff: cc/proto/gfx_conversions.h

Issue 1417963011: Added serialization to protobufs for property trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PROTO_GFX_CONVERSIONS_H_ 5 #ifndef CC_PROTO_GFX_CONVERSIONS_H_
6 #define CC_PROTO_GFX_CONVERSIONS_H_ 6 #define CC_PROTO_GFX_CONVERSIONS_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 class Point; 11 class Point;
12 class PointF; 12 class PointF;
13 class Rect; 13 class Rect;
14 class RectF; 14 class RectF;
15 class ScrollOffset;
15 class Size; 16 class Size;
16 class SizeF; 17 class SizeF;
17 class Transform; 18 class Transform;
19 class Vector2dF;
18 } 20 }
19 21
20 namespace cc { 22 namespace cc {
21 23
22 namespace proto { 24 namespace proto {
23 class Point; 25 class Point;
24 class PointF; 26 class PointF;
25 class Rect; 27 class Rect;
26 class RectF; 28 class RectF;
29 class ScrollOffset;
27 class Size; 30 class Size;
28 class SizeF; 31 class SizeF;
29 class Transform; 32 class Transform;
33 class Vector2dF;
30 } 34 }
31 35
32 // TODO(dtrainor): Move these to a class and make them static 36 // TODO(dtrainor): Move these to a class and make them static
33 // (crbug.com/548432). 37 // (crbug.com/548432).
34 CC_EXPORT void PointToProto(const gfx::Point& point, proto::Point* proto); 38 CC_EXPORT void PointToProto(const gfx::Point& point, proto::Point* proto);
35 CC_EXPORT gfx::Point ProtoToPoint(const proto::Point& proto); 39 CC_EXPORT gfx::Point ProtoToPoint(const proto::Point& proto);
36 40
37 CC_EXPORT void PointFToProto(const gfx::PointF& point, proto::PointF* proto); 41 CC_EXPORT void PointFToProto(const gfx::PointF& point, proto::PointF* proto);
38 CC_EXPORT gfx::PointF ProtoToPointF(const proto::PointF& proto); 42 CC_EXPORT gfx::PointF ProtoToPointF(const proto::PointF& proto);
39 43
40 CC_EXPORT void RectToProto(const gfx::Rect& rect, proto::Rect* proto); 44 CC_EXPORT void RectToProto(const gfx::Rect& rect, proto::Rect* proto);
41 CC_EXPORT gfx::Rect ProtoToRect(const proto::Rect& proto); 45 CC_EXPORT gfx::Rect ProtoToRect(const proto::Rect& proto);
42 46
43 CC_EXPORT void RectFToProto(const gfx::RectF& rect, proto::RectF* proto); 47 CC_EXPORT void RectFToProto(const gfx::RectF& rect, proto::RectF* proto);
44 CC_EXPORT gfx::RectF ProtoToRectF(const proto::RectF& proto); 48 CC_EXPORT gfx::RectF ProtoToRectF(const proto::RectF& proto);
45 49
46 CC_EXPORT void SizeToProto(const gfx::Size& size, proto::Size* proto); 50 CC_EXPORT void SizeToProto(const gfx::Size& size, proto::Size* proto);
47 CC_EXPORT gfx::Size ProtoToSize(const proto::Size& proto); 51 CC_EXPORT gfx::Size ProtoToSize(const proto::Size& proto);
48 52
49 CC_EXPORT void SizeFToProto(const gfx::SizeF& size, proto::SizeF* proto); 53 CC_EXPORT void SizeFToProto(const gfx::SizeF& size, proto::SizeF* proto);
50 CC_EXPORT gfx::SizeF ProtoToSizeF(const proto::SizeF& proto); 54 CC_EXPORT gfx::SizeF ProtoToSizeF(const proto::SizeF& proto);
51 55
52 CC_EXPORT void TransformToProto(const gfx::Transform& transform, 56 CC_EXPORT void TransformToProto(const gfx::Transform& transform,
53 proto::Transform* proto); 57 proto::Transform* proto);
54 CC_EXPORT gfx::Transform ProtoToTransform(const proto::Transform& proto); 58 CC_EXPORT gfx::Transform ProtoToTransform(const proto::Transform& proto);
55 59
60 CC_EXPORT void Vector2dFToProto(const gfx::Vector2dF& vector,
61 proto::Vector2dF* proto);
62 CC_EXPORT gfx::Vector2dF ProtoToVector2dF(const proto::Vector2dF& proto);
63
64 CC_EXPORT void ScrollOffsetToProto(const gfx::ScrollOffset& scroll_offset,
65 proto::ScrollOffset* proto);
66 CC_EXPORT gfx::ScrollOffset ProtoToScrollOffset(
67 const proto::ScrollOffset& proto);
68
56 } // namespace cc 69 } // namespace cc
57 70
58 #endif // CC_PROTO_GFX_CONVERSIONS_H_ 71 #endif // CC_PROTO_GFX_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « cc/proto/BUILD.gn ('k') | cc/proto/gfx_conversions.cc » ('j') | cc/proto/property_tree.proto » ('J')

Powered by Google App Engine
This is Rietveld 408576698