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 "ipc/param_traits_macros.h"
12 #include "ui/gfx/buffer_types.h"
13 #include "ui/gfx/ipc/gfx_ipc_export.h"
14 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
34 struct GFX_IPC_EXPORT ParamTraits
<gfx::Point
> {
35 typedef gfx::Point param_type
;
36 static void Write(Message
* m
, const param_type
& p
);
37 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
38 static void Log(const param_type
& p
, std::string
* l
);
42 struct GFX_IPC_EXPORT ParamTraits
<gfx::PointF
> {
43 typedef gfx::PointF param_type
;
44 static void Write(Message
* m
, const param_type
& p
);
45 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
46 static void Log(const param_type
& p
, std::string
* l
);
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
);
58 struct GFX_IPC_EXPORT ParamTraits
<gfx::Size
> {
59 typedef gfx::Size param_type
;
60 static void Write(Message
* m
, const param_type
& p
);
61 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
62 static void Log(const param_type
& p
, std::string
* l
);
66 struct GFX_IPC_EXPORT ParamTraits
<gfx::SizeF
> {
67 typedef gfx::SizeF param_type
;
68 static void Write(Message
* m
, const param_type
& p
);
69 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
70 static void Log(const param_type
& p
, std::string
* l
);
74 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2d
> {
75 typedef gfx::Vector2d param_type
;
76 static void Write(Message
* m
, const param_type
& p
);
77 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
78 static void Log(const param_type
& p
, std::string
* l
);
82 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2dF
> {
83 typedef gfx::Vector2dF param_type
;
84 static void Write(Message
* m
, const param_type
& p
);
85 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
86 static void Log(const param_type
& p
, std::string
* l
);
90 struct GFX_IPC_EXPORT ParamTraits
<gfx::Rect
> {
91 typedef gfx::Rect param_type
;
92 static void Write(Message
* m
, const param_type
& p
);
93 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
94 static void Log(const param_type
& p
, std::string
* l
);
98 struct GFX_IPC_EXPORT ParamTraits
<gfx::RectF
> {
99 typedef gfx::RectF param_type
;
100 static void Write(Message
* m
, const param_type
& p
);
101 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
102 static void Log(const param_type
& p
, std::string
* l
);
106 struct GFX_IPC_EXPORT ParamTraits
<SkBitmap
> {
107 typedef SkBitmap param_type
;
108 static void Write(Message
* m
, const param_type
& p
);
110 // Note: This function expects parameter |r| to be of type &SkBitmap since
111 // r->SetConfig() and r->SetPixels() are called.
112 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
114 static void Log(const param_type
& p
, std::string
* l
);
118 struct GFX_IPC_EXPORT ParamTraits
<gfx::Range
> {
119 typedef gfx::Range param_type
;
120 static void Write(Message
* m
, const param_type
& p
);
121 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
122 static void Log(const param_type
& p
, std::string
* l
);
127 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_