Removed unused icon resources from app_list.
[chromium-blink-merge.git] / ui / gfx / ipc / gfx_param_traits.h
blob2a8ef440e1ba4e73cc9dad80a7cacdc4cb3bd842
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 Rect;
20 class RectF;
21 class Size;
22 class SizeF;
23 class Vector2d;
24 class Vector2dF;
25 } // namespace gfx
27 namespace IPC {
29 template <>
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);
37 template <>
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);
45 template <>
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);
53 template <>
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);
61 template <>
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);
69 template <>
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);
77 template <>
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);
85 template <>
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);
93 template <>
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);
105 } // namespace IPC
107 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_