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

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

Issue 1394353002: Add Protobuf support in cc for gfx objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build for other targets Created 5 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_PROTO_GFX_CONVERSIONS_H_
6 #define CC_PROTO_GFX_CONVERSIONS_H_
7
8 #include "cc/base/cc_export.h"
9
10 namespace gfx {
11 class Point;
12 class PointF;
13 class Rect;
14 class RectF;
15 class Size;
16 class SizeF;
17 class Transform;
18 }
19
20 namespace cc {
21
22 namespace proto {
23 class Point;
24 class PointF;
25 class Rect;
26 class RectF;
27 class Size;
28 class SizeF;
29 class Transform;
30 }
31
32 CC_EXPORT void PointToProto(const gfx::Point& point, proto::Point* proto);
33 CC_EXPORT void ProtoToPoint(const proto::Point& proto, gfx::Point* point);
danakj 2015/10/14 23:10:10 do we need this
David Trainor- moved to gerrit 2015/10/15 22:18:02 Yeah we could probably get away with only one. Th
danakj 2015/10/15 22:22:33 It should use RVO and not actually copy too. :)
34 CC_EXPORT gfx::Point ProtoToPoint(const proto::Point& proto);
danakj 2015/10/14 23:10:10 and this?
35
36 CC_EXPORT void PointFToProto(const gfx::PointF& point, proto::PointF* proto);
37 CC_EXPORT void ProtoToPointF(const proto::PointF& proto, gfx::PointF* point);
38 CC_EXPORT gfx::PointF ProtoToPointF(const proto::PointF& proto);
39
40 CC_EXPORT void RectToProto(const gfx::Rect& rect, proto::Rect* proto);
41 CC_EXPORT void ProtoToRect(const proto::Rect& proto, gfx::Rect* rect);
42 CC_EXPORT gfx::Rect ProtoToRect(const proto::Rect& proto);
43
44 CC_EXPORT void RectFToProto(const gfx::RectF& rect, proto::RectF* proto);
45 CC_EXPORT void ProtoToRectF(const proto::RectF& proto, gfx::RectF* rect);
46 CC_EXPORT gfx::RectF ProtoToRectF(const proto::RectF& proto);
47
48 CC_EXPORT void SizeToProto(const gfx::Size& size, proto::Size* proto);
49 CC_EXPORT void ProtoToSize(const proto::Size& proto, gfx::Size* size);
50 CC_EXPORT gfx::Size ProtoToSize(const proto::Size& proto);
51
52 CC_EXPORT void SizeFToProto(const gfx::SizeF& size, proto::SizeF* proto);
53 CC_EXPORT void ProtoToSizeF(const proto::SizeF& proto, gfx::SizeF* size);
54 CC_EXPORT gfx::SizeF ProtoToSizeF(const proto::SizeF& proto);
55
56 CC_EXPORT void TransformToProto(const gfx::Transform& transform,
57 proto::Transform* proto);
58 CC_EXPORT void ProtoToTransform(const proto::Transform& proto,
59 gfx::Transform* transform);
60 CC_EXPORT gfx::Transform ProtoToTransform(const proto::Transform& proto);
61
62 } // namespace cc
63
64 #endif // CC_PROTO_GFX_CONVERSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698