| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| 6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
| 11 #include "ipc/param_traits_macros.h" | 11 #include "ipc/param_traits_macros.h" |
| 12 #include "ui/gfx/buffer_types.h" | 12 #include "ui/gfx/buffer_types.h" |
| 13 #include "ui/gfx/ipc/gfx_ipc_export.h" | 13 #include "ui/gfx/ipc/gfx_ipc_export.h" |
| 14 #include "ui/gfx/ipc/gfx_param_traits_macros.h" | 14 #include "ui/gfx/ipc/gfx_param_traits_macros.h" |
| 15 | 15 |
| 16 #if defined(OS_MACOSX) && !defined(OS_IOS) | 16 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 17 #include "ui/gfx/mac/io_surface.h" | 17 #include "ui/gfx/mac/io_surface.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 class SkBitmap; | |
| 21 | |
| 22 namespace gfx { | 20 namespace gfx { |
| 23 class Point; | 21 class Point; |
| 24 class PointF; | 22 class PointF; |
| 25 class Point3F; | 23 class Point3F; |
| 26 class Range; | 24 class Range; |
| 27 class Rect; | 25 class Rect; |
| 28 class RectF; | 26 class RectF; |
| 29 class ScrollOffset; | 27 class ScrollOffset; |
| 30 class Size; | 28 class Size; |
| 31 class SizeF; | 29 class SizeF; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 typedef gfx::RectF param_type; | 120 typedef gfx::RectF param_type; |
| 123 static void GetSize(base::PickleSizer* s, const param_type& p); | 121 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 124 static void Write(base::Pickle* m, const param_type& p); | 122 static void Write(base::Pickle* m, const param_type& p); |
| 125 static bool Read(const base::Pickle* m, | 123 static bool Read(const base::Pickle* m, |
| 126 base::PickleIterator* iter, | 124 base::PickleIterator* iter, |
| 127 param_type* r); | 125 param_type* r); |
| 128 static void Log(const param_type& p, std::string* l); | 126 static void Log(const param_type& p, std::string* l); |
| 129 }; | 127 }; |
| 130 | 128 |
| 131 template <> | 129 template <> |
| 132 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { | |
| 133 typedef SkBitmap param_type; | |
| 134 static void Write(base::Pickle* m, const param_type& p); | |
| 135 | |
| 136 // Note: This function expects parameter |r| to be of type &SkBitmap since | |
| 137 // r->SetConfig() and r->SetPixels() are called. | |
| 138 static bool Read(const base::Pickle* m, | |
| 139 base::PickleIterator* iter, | |
| 140 param_type* r); | |
| 141 | |
| 142 static void Log(const param_type& p, std::string* l); | |
| 143 }; | |
| 144 | |
| 145 template <> | |
| 146 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { | 130 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { |
| 147 typedef gfx::Range param_type; | 131 typedef gfx::Range param_type; |
| 148 static void Write(base::Pickle* m, const param_type& p); | 132 static void Write(base::Pickle* m, const param_type& p); |
| 149 static bool Read(const base::Pickle* m, | 133 static bool Read(const base::Pickle* m, |
| 150 base::PickleIterator* iter, | 134 base::PickleIterator* iter, |
| 151 param_type* r); | 135 param_type* r); |
| 152 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
| 153 }; | 137 }; |
| 154 | 138 |
| 155 template <> | 139 template <> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 174 static bool Read(const base::Pickle* m, | 158 static bool Read(const base::Pickle* m, |
| 175 base::PickleIterator* iter, | 159 base::PickleIterator* iter, |
| 176 param_type* r); | 160 param_type* r); |
| 177 static void Log(const param_type& p, std::string* l); | 161 static void Log(const param_type& p, std::string* l); |
| 178 }; | 162 }; |
| 179 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 163 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 180 | 164 |
| 181 } // namespace IPC | 165 } // namespace IPC |
| 182 | 166 |
| 183 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 167 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
| OLD | NEW |