Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: ui/gfx/ipc/gfx_param_traits.h

Issue 1648533002: [mojo] Get rid of Skia type converters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native-arrays
Patch Set: fix ios gyp; proper pickle sizing Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> { 103 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> {
104 typedef gfx::RectF param_type; 104 typedef gfx::RectF param_type;
105 static void Write(Message* m, const param_type& p); 105 static void Write(Message* m, const param_type& p);
106 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 106 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
107 static void Log(const param_type& p, std::string* l); 107 static void Log(const param_type& p, std::string* l);
108 }; 108 };
109 109
110 template <> 110 template <>
111 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { 111 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> {
112 typedef SkBitmap param_type; 112 typedef SkBitmap param_type;
113 static void Write(Message* m, const param_type& p); 113 static size_t GetSize(const param_type& p);
114 static void Write(base::Pickle* m, const param_type& p);
114 115
115 // Note: This function expects parameter |r| to be of type &SkBitmap since 116 // Note: This function expects parameter |r| to be of type &SkBitmap since
116 // r->SetConfig() and r->SetPixels() are called. 117 // r->SetConfig() and r->SetPixels() are called.
117 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 118 static bool Read(const base::Pickle* m,
119 base::PickleIterator* iter,
120 param_type* r);
118 121
119 static void Log(const param_type& p, std::string* l); 122 static void Log(const param_type& p, std::string* l);
120 }; 123 };
121 124
122 template <> 125 template <>
123 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> { 126 struct GFX_IPC_EXPORT ParamTraits<gfx::Range> {
124 typedef gfx::Range param_type; 127 typedef gfx::Range param_type;
125 static void Write(Message* m, const param_type& p); 128 static void Write(Message* m, const param_type& p);
126 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 129 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
127 static void Log(const param_type& p, std::string* l); 130 static void Log(const param_type& p, std::string* l);
(...skipping 17 matching lines...) Expand all
145 // called once for a given message, otherwise the singular right will be 148 // called once for a given message, otherwise the singular right will be
146 // managed and released by two objects. 149 // managed and released by two objects.
147 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 150 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
148 static void Log(const param_type& p, std::string* l); 151 static void Log(const param_type& p, std::string* l);
149 }; 152 };
150 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 153 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
151 154
152 } // namespace IPC 155 } // namespace IPC
153 156
154 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ 157 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698