Fix search results being clipped in app list.
[chromium-blink-merge.git] / ui / gfx / ipc / gfx_param_traits.h
blob933596110c31d63dd27cca3824583f0b9a26f376
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_
8 #include <string>
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"
14 class SkBitmap;
16 namespace gfx {
17 class Point;
18 class PointF;
19 class Range;
20 class Rect;
21 class RectF;
22 class Size;
23 class SizeF;
24 class Vector2d;
25 class Vector2dF;
26 } // namespace gfx
28 namespace IPC {
30 template <>
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);
38 template <>
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);
46 template <>
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);
54 template <>
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);
62 template <>
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);
70 template <>
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);
78 template <>
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);
86 template <>
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);
94 template <>
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);
106 template <>
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);
114 } // namespace IPC
116 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_