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

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

Issue 1408123005: Android Webview IPC-based sync compositing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win compile Created 5 years, 1 month 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
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/gfx/ipc/gfx_param_traits.h" 5 #include "ui/gfx/ipc/gfx_param_traits.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "ui/gfx/geometry/point3_f.h" 10 #include "ui/gfx/geometry/point3_f.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/geometry/rect_f.h" 12 #include "ui/gfx/geometry/rect_f.h"
13 #include "ui/gfx/geometry/scroll_offset.h"
13 #include "ui/gfx/range/range.h" 14 #include "ui/gfx/range/range.h"
14 15
15 namespace { 16 namespace {
16 17
17 struct SkBitmap_Data { 18 struct SkBitmap_Data {
18 // The color type for the bitmap (bits per pixel, etc). 19 // The color type for the bitmap (bits per pixel, etc).
19 SkColorType fColorType; 20 SkColorType fColorType;
20 21
21 // The alpha type for the bitmap (opaque, premul, unpremul). 22 // The alpha type for the bitmap (opaque, premul, unpremul).
22 SkAlphaType fAlphaType; 23 SkAlphaType fAlphaType;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 return false; 303 return false;
303 r->set_start(start); 304 r->set_start(start);
304 r->set_end(end); 305 r->set_end(end);
305 return true; 306 return true;
306 } 307 }
307 308
308 void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) { 309 void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) {
309 l->append(base::StringPrintf("(%" PRIuS ", %" PRIuS ")", r.start(), r.end())); 310 l->append(base::StringPrintf("(%" PRIuS ", %" PRIuS ")", r.start(), r.end()));
310 } 311 }
311 312
313 void ParamTraits<gfx::ScrollOffset>::Write(Message* m, const param_type& p) {
314 m->WriteDouble(p.x());
315 m->WriteDouble(p.y());
316 }
317
318 bool ParamTraits<gfx::ScrollOffset>::Read(const Message* m,
319 base::PickleIterator* iter,
320 param_type* r) {
321 double x = 0.f;
322 double y = 0.f;
323 if (!iter->ReadDouble(&x))
324 return false;
325 if (!iter->ReadDouble(&y))
326 return false;
327 r->set_x(x);
328 r->set_y(y);
329 return true;
330 }
331
332 void ParamTraits<gfx::ScrollOffset>::Log(const param_type& p, std::string* l) {
333 l->append("(");
334 LogParam(p.x(), l);
335 l->append(", ");
336 LogParam(p.y(), l);
337 l->append(")");
338 }
339
312 } // namespace IPC 340 } // namespace IPC
313 341
314 // Generate param traits write methods. 342 // Generate param traits write methods.
315 #include "ipc/param_traits_write_macros.h" 343 #include "ipc/param_traits_write_macros.h"
316 namespace IPC { 344 namespace IPC {
317 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 345 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
318 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 346 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
319 } // namespace IPC 347 } // namespace IPC
320 348
321 // Generate param traits read methods. 349 // Generate param traits read methods.
322 #include "ipc/param_traits_read_macros.h" 350 #include "ipc/param_traits_read_macros.h"
323 namespace IPC { 351 namespace IPC {
324 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 352 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
325 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 353 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
326 } // namespace IPC 354 } // namespace IPC
327 355
328 // Generate param traits log methods. 356 // Generate param traits log methods.
329 #include "ipc/param_traits_log_macros.h" 357 #include "ipc/param_traits_log_macros.h"
330 namespace IPC { 358 namespace IPC {
331 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 359 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
332 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 360 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
333 } // namespace IPC 361 } // namespace IPC
OLDNEW
« no previous file with comments | « 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