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"
33 struct GFX_IPC_EXPORT ParamTraits
<gfx::Point
> {
34 typedef gfx::Point param_type
;
35 static void Write(Message
* m
, const param_type
& p
);
36 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
37 static void Log(const param_type
& p
, std::string
* l
);
41 struct GFX_IPC_EXPORT ParamTraits
<gfx::PointF
> {
42 typedef gfx::PointF param_type
;
43 static void Write(Message
* m
, const param_type
& p
);
44 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
45 static void Log(const param_type
& p
, std::string
* l
);
49 struct GFX_IPC_EXPORT ParamTraits
<gfx::Size
> {
50 typedef gfx::Size param_type
;
51 static void Write(Message
* m
, const param_type
& p
);
52 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
53 static void Log(const param_type
& p
, std::string
* l
);
57 struct GFX_IPC_EXPORT ParamTraits
<gfx::SizeF
> {
58 typedef gfx::SizeF param_type
;
59 static void Write(Message
* m
, const param_type
& p
);
60 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
61 static void Log(const param_type
& p
, std::string
* l
);
65 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2d
> {
66 typedef gfx::Vector2d param_type
;
67 static void Write(Message
* m
, const param_type
& p
);
68 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
69 static void Log(const param_type
& p
, std::string
* l
);
73 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2dF
> {
74 typedef gfx::Vector2dF param_type
;
75 static void Write(Message
* m
, const param_type
& p
);
76 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
77 static void Log(const param_type
& p
, std::string
* l
);
81 struct GFX_IPC_EXPORT ParamTraits
<gfx::Rect
> {
82 typedef gfx::Rect param_type
;
83 static void Write(Message
* m
, const param_type
& p
);
84 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
85 static void Log(const param_type
& p
, std::string
* l
);
89 struct GFX_IPC_EXPORT ParamTraits
<gfx::RectF
> {
90 typedef gfx::RectF param_type
;
91 static void Write(Message
* m
, const param_type
& p
);
92 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
93 static void Log(const param_type
& p
, std::string
* l
);
97 struct GFX_IPC_EXPORT ParamTraits
<SkBitmap
> {
98 typedef SkBitmap param_type
;
99 static void Write(Message
* m
, const param_type
& p
);
101 // Note: This function expects parameter |r| to be of type &SkBitmap since
102 // r->SetConfig() and r->SetPixels() are called.
103 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
105 static void Log(const param_type
& p
, std::string
* l
);
109 struct GFX_IPC_EXPORT ParamTraits
<gfx::Range
> {
110 typedef gfx::Range param_type
;
111 static void Write(Message
* m
, const param_type
& p
);
112 static bool Read(const Message
* m
, base::PickleIterator
* iter
, param_type
* r
);
113 static void Log(const param_type
& p
, std::string
* l
);
118 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_