Chromium Code Reviews| Index: cc/proto/gfx_conversions.h |
| diff --git a/cc/proto/gfx_conversions.h b/cc/proto/gfx_conversions.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a244d364c981ea97d0e029a5cff4df4dc12bea2f |
| --- /dev/null |
| +++ b/cc/proto/gfx_conversions.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_PROTO_GFX_CONVERSIONS_H_ |
| +#define CC_PROTO_GFX_CONVERSIONS_H_ |
| + |
| +#include "cc/base/cc_export.h" |
| + |
| +namespace gfx { |
| +class Point; |
| +class PointF; |
| +class Rect; |
| +class RectF; |
| +class Size; |
| +class SizeF; |
| +class Transform; |
| +} |
| + |
| +namespace cc { |
| + |
| +namespace proto { |
| +class Point; |
| +class PointF; |
| +class Rect; |
| +class RectF; |
| +class Size; |
| +class SizeF; |
| +class Transform; |
| +} |
| + |
| +CC_EXPORT void PointToProto(const gfx::Point& point, proto::Point* proto); |
| +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. :)
|
| +CC_EXPORT gfx::Point ProtoToPoint(const proto::Point& proto); |
|
danakj
2015/10/14 23:10:10
and this?
|
| + |
| +CC_EXPORT void PointFToProto(const gfx::PointF& point, proto::PointF* proto); |
| +CC_EXPORT void ProtoToPointF(const proto::PointF& proto, gfx::PointF* point); |
| +CC_EXPORT gfx::PointF ProtoToPointF(const proto::PointF& proto); |
| + |
| +CC_EXPORT void RectToProto(const gfx::Rect& rect, proto::Rect* proto); |
| +CC_EXPORT void ProtoToRect(const proto::Rect& proto, gfx::Rect* rect); |
| +CC_EXPORT gfx::Rect ProtoToRect(const proto::Rect& proto); |
| + |
| +CC_EXPORT void RectFToProto(const gfx::RectF& rect, proto::RectF* proto); |
| +CC_EXPORT void ProtoToRectF(const proto::RectF& proto, gfx::RectF* rect); |
| +CC_EXPORT gfx::RectF ProtoToRectF(const proto::RectF& proto); |
| + |
| +CC_EXPORT void SizeToProto(const gfx::Size& size, proto::Size* proto); |
| +CC_EXPORT void ProtoToSize(const proto::Size& proto, gfx::Size* size); |
| +CC_EXPORT gfx::Size ProtoToSize(const proto::Size& proto); |
| + |
| +CC_EXPORT void SizeFToProto(const gfx::SizeF& size, proto::SizeF* proto); |
| +CC_EXPORT void ProtoToSizeF(const proto::SizeF& proto, gfx::SizeF* size); |
| +CC_EXPORT gfx::SizeF ProtoToSizeF(const proto::SizeF& proto); |
| + |
| +CC_EXPORT void TransformToProto(const gfx::Transform& transform, |
| + proto::Transform* proto); |
| +CC_EXPORT void ProtoToTransform(const proto::Transform& proto, |
| + gfx::Transform* transform); |
| +CC_EXPORT gfx::Transform ProtoToTransform(const proto::Transform& proto); |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_PROTO_GFX_CONVERSIONS_H_ |