OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
11 #include "ipc/param_traits_macros.h" | 11 #include "ipc/param_traits_macros.h" |
12 #include "ui/gfx/buffer_types.h" | 12 #include "ui/gfx/buffer_types.h" |
13 #include "ui/gfx/ipc/gfx_ipc_export.h" | 13 #include "ui/gfx/ipc/gfx_ipc_export.h" |
14 #include "ui/gfx/ipc/gfx_param_traits_macros.h" | 14 #include "ui/gfx/ipc/gfx_param_traits_macros.h" |
15 | 15 |
16 class SkBitmap; | 16 class SkBitmap; |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class Point; | 19 class Point; |
20 class PointF; | 20 class PointF; |
| 21 class Point3F; |
21 class Range; | 22 class Range; |
22 class Rect; | 23 class Rect; |
23 class RectF; | 24 class RectF; |
24 class Size; | 25 class Size; |
25 class SizeF; | 26 class SizeF; |
26 class Vector2d; | 27 class Vector2d; |
27 class Vector2dF; | 28 class Vector2dF; |
28 } // namespace gfx | 29 } // namespace gfx |
29 | 30 |
30 namespace IPC { | 31 namespace IPC { |
31 | 32 |
32 template <> | 33 template <> |
33 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> { | 34 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> { |
34 typedef gfx::Point param_type; | 35 typedef gfx::Point param_type; |
35 static void Write(Message* m, const param_type& p); | 36 static void Write(Message* m, const param_type& p); |
36 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 37 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
37 static void Log(const param_type& p, std::string* l); | 38 static void Log(const param_type& p, std::string* l); |
38 }; | 39 }; |
39 | 40 |
40 template <> | 41 template <> |
41 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> { | 42 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> { |
42 typedef gfx::PointF param_type; | 43 typedef gfx::PointF param_type; |
43 static void Write(Message* m, const param_type& p); | 44 static void Write(Message* m, const param_type& p); |
44 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 45 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
45 static void Log(const param_type& p, std::string* l); | 46 static void Log(const param_type& p, std::string* l); |
46 }; | 47 }; |
47 | 48 |
48 template <> | 49 template <> |
| 50 struct GFX_IPC_EXPORT ParamTraits<gfx::Point3F> { |
| 51 typedef gfx::Point3F param_type; |
| 52 static void Write(Message* m, const param_type& p); |
| 53 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 54 static void Log(const param_type& p, std::string* l); |
| 55 }; |
| 56 |
| 57 template <> |
49 struct GFX_IPC_EXPORT ParamTraits<gfx::Size> { | 58 struct GFX_IPC_EXPORT ParamTraits<gfx::Size> { |
50 typedef gfx::Size param_type; | 59 typedef gfx::Size param_type; |
51 static void Write(Message* m, const param_type& p); | 60 static void Write(Message* m, const param_type& p); |
52 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 61 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
53 static void Log(const param_type& p, std::string* l); | 62 static void Log(const param_type& p, std::string* l); |
54 }; | 63 }; |
55 | 64 |
56 template <> | 65 template <> |
57 struct GFX_IPC_EXPORT ParamTraits<gfx::SizeF> { | 66 struct GFX_IPC_EXPORT ParamTraits<gfx::SizeF> { |
58 typedef gfx::SizeF param_type; | 67 typedef gfx::SizeF param_type; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { | 118 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { |
110 typedef gfx::Range param_type; | 119 typedef gfx::Range param_type; |
111 static void Write(Message* m, const param_type& p); | 120 static void Write(Message* m, const param_type& p); |
112 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 121 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
113 static void Log(const param_type& p, std::string* l); | 122 static void Log(const param_type& p, std::string* l); |
114 }; | 123 }; |
115 | 124 |
116 } // namespace IPC | 125 } // namespace IPC |
117 | 126 |
118 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 127 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
OLD | NEW |