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"
31 struct GFX_IPC_EXPORT ParamTraits
<gfx::Point
> {
32 typedef gfx::Point param_type
;
33 static void Write(Message
* m
, const param_type
& p
);
34 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
35 static void Log(const param_type
& p
, std::string
* l
);
39 struct GFX_IPC_EXPORT ParamTraits
<gfx::PointF
> {
40 typedef gfx::PointF param_type
;
41 static void Write(Message
* m
, const param_type
& p
);
42 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
43 static void Log(const param_type
& p
, std::string
* l
);
47 struct GFX_IPC_EXPORT ParamTraits
<gfx::Size
> {
48 typedef gfx::Size param_type
;
49 static void Write(Message
* m
, const param_type
& p
);
50 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
51 static void Log(const param_type
& p
, std::string
* l
);
55 struct GFX_IPC_EXPORT ParamTraits
<gfx::SizeF
> {
56 typedef gfx::SizeF param_type
;
57 static void Write(Message
* m
, const param_type
& p
);
58 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
59 static void Log(const param_type
& p
, std::string
* l
);
63 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2d
> {
64 typedef gfx::Vector2d param_type
;
65 static void Write(Message
* m
, const param_type
& p
);
66 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
67 static void Log(const param_type
& p
, std::string
* l
);
71 struct GFX_IPC_EXPORT ParamTraits
<gfx::Vector2dF
> {
72 typedef gfx::Vector2dF param_type
;
73 static void Write(Message
* m
, const param_type
& p
);
74 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
75 static void Log(const param_type
& p
, std::string
* l
);
79 struct GFX_IPC_EXPORT ParamTraits
<gfx::Rect
> {
80 typedef gfx::Rect param_type
;
81 static void Write(Message
* m
, const param_type
& p
);
82 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
83 static void Log(const param_type
& p
, std::string
* l
);
87 struct GFX_IPC_EXPORT ParamTraits
<gfx::RectF
> {
88 typedef gfx::RectF param_type
;
89 static void Write(Message
* m
, const param_type
& p
);
90 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
91 static void Log(const param_type
& p
, std::string
* l
);
95 struct GFX_IPC_EXPORT ParamTraits
<SkBitmap
> {
96 typedef SkBitmap param_type
;
97 static void Write(Message
* m
, const param_type
& p
);
99 // Note: This function expects parameter |r| to be of type &SkBitmap since
100 // r->SetConfig() and r->SetPixels() are called.
101 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
103 static void Log(const param_type
& p
, std::string
* l
);
107 struct GFX_IPC_EXPORT ParamTraits
<gfx::Range
> {
108 typedef gfx::Range param_type
;
109 static void Write(Message
* m
, const param_type
& p
);
110 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
111 static void Log(const param_type
& p
, std::string
* l
);
116 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_