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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_
6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_
10 #include "ipc/ipc_message_utils.h"
11 #include "ui/gfx/ipc/gfx_ipc_export.h"
12 #include "ui/gfx/ipc/gfx_param_traits.h"
30 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> {
31 typedef gfx::Point param_type;
32 static void Write(Message* m, const param_type& p);
33 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
34 static void Log(const param_type& p, std::string* l);
38 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> {
39 typedef gfx::PointF param_type;
40 static void Write(Message* m, const param_type& p);
41 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
42 static void Log(const param_type& p, std::string* l);
46 struct GFX_IPC_EXPORT ParamTraits<gfx::Size> {
47 typedef gfx::Size param_type;
48 static void Write(Message* m, const param_type& p);
49 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
50 static void Log(const param_type& p, std::string* l);
54 struct GFX_IPC_EXPORT ParamTraits<gfx::SizeF> {
55 typedef gfx::SizeF param_type;
56 static void Write(Message* m, const param_type& p);
57 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
58 static void Log(const param_type& p, std::string* l);
62 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2d> {
63 typedef gfx::Vector2d param_type;
64 static void Write(Message* m, const param_type& p);
65 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
66 static void Log(const param_type& p, std::string* l);
70 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2dF> {
71 typedef gfx::Vector2dF param_type;
72 static void Write(Message* m, const param_type& p);
73 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
74 static void Log(const param_type& p, std::string* l);
78 struct GFX_IPC_EXPORT ParamTraits<gfx::Rect> {
79 typedef gfx::Rect param_type;
80 static void Write(Message* m, const param_type& p);
81 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
82 static void Log(const param_type& p, std::string* l);
86 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> {
87 typedef gfx::RectF param_type;
88 static void Write(Message* m, const param_type& p);
89 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
90 static void Log(const param_type& p, std::string* l);
94 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> {
95 typedef SkBitmap param_type;
96 static void Write(Message* m, const param_type& p);
98 // Note: This function expects parameter |r| to be of type &SkBitmap since
99 // r->SetConfig() and r->SetPixels() are called.
100 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
102 static void Log(const param_type& p, std::string* l);
107 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_