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

Unified Diff: ui/gfx/ipc/gfx_param_traits.cc

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, 11 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 side-by-side diff with in-line comments
Download patch
« skia/public/interfaces/bitmap.mojom ('K') | « ui/gfx/ipc/gfx_param_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/ipc/gfx_param_traits.cc
diff --git a/ui/gfx/ipc/gfx_param_traits.cc b/ui/gfx/ipc/gfx_param_traits.cc
index a49e1da95980c0d1406080cf28ecfb2a52b49622..907231d2652e3b15a450b7cff61e37db6adb607b 100644
--- a/ui/gfx/ipc/gfx_param_traits.cc
+++ b/ui/gfx/ipc/gfx_param_traits.cc
@@ -256,7 +256,11 @@ void ParamTraits<gfx::RectF>::Log(const gfx::RectF& p, std::string* l) {
p.width(), p.height()));
}
-void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) {
+size_t ParamTraits<SkBitmap>::GetSize(const SkBitmap& p) {
Ken Rockot(use gerrit already) 2016/02/01 17:57:01 NOTE to tsepez@: Defining a GetSize() trait is a p
Tom Sepez 2016/02/01 18:31:58 I prefer the first approach, I wouldn't be fond of
+ return sizeof(int32_t) * 2 + sizeof(SkBitmap_Data) + p.getSize();
jam 2016/02/01 17:53:48 I'd expect this to match the Write method below, w
+}
+
+void ParamTraits<SkBitmap>::Write(base::Pickle* m, const SkBitmap& p) {
size_t fixed_size = sizeof(SkBitmap_Data);
SkBitmap_Data bmp_data;
bmp_data.InitSkBitmapDataForTransfer(p);
@@ -268,7 +272,7 @@ void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) {
static_cast<int>(pixel_size));
}
-bool ParamTraits<SkBitmap>::Read(const Message* m,
+bool ParamTraits<SkBitmap>::Read(const base::Pickle* m,
base::PickleIterator* iter,
SkBitmap* r) {
const char* fixed_data;
« skia/public/interfaces/bitmap.mojom ('K') | « ui/gfx/ipc/gfx_param_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698