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

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

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.h ('k') | ui/gfx/mac/io_surface.h » ('j') | 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/gfx/geometry/point3_f.h" 13 #include "ui/gfx/geometry/point3_f.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/rect_f.h" 15 #include "ui/gfx/geometry/rect_f.h"
16 #include "ui/gfx/geometry/scroll_offset.h" 16 #include "ui/gfx/geometry/scroll_offset.h"
17 #include "ui/gfx/range/range.h" 17 #include "ui/gfx/range/range.h"
18 18
19 #if defined(OS_MACOSX)
20 #include "ipc/mach_port_mac.h"
21 #endif
22
19 namespace { 23 namespace {
20 24
21 struct SkBitmap_Data { 25 struct SkBitmap_Data {
22 // The color type for the bitmap (bits per pixel, etc). 26 // The color type for the bitmap (bits per pixel, etc).
23 SkColorType fColorType; 27 SkColorType fColorType;
24 28
25 // The alpha type for the bitmap (opaque, premul, unpremul). 29 // The alpha type for the bitmap (opaque, premul, unpremul).
26 SkAlphaType fAlphaType; 30 SkAlphaType fAlphaType;
27 31
28 // The width of the bitmap in pixels. 32 // The width of the bitmap in pixels.
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 337 }
334 338
335 void ParamTraits<gfx::ScrollOffset>::Log(const param_type& p, std::string* l) { 339 void ParamTraits<gfx::ScrollOffset>::Log(const param_type& p, std::string* l) {
336 l->append("("); 340 l->append("(");
337 LogParam(p.x(), l); 341 LogParam(p.x(), l);
338 l->append(", "); 342 l->append(", ");
339 LogParam(p.y(), l); 343 LogParam(p.y(), l);
340 l->append(")"); 344 l->append(")");
341 } 345 }
342 346
347 #if defined(OS_MACOSX) && !defined(OS_IOS)
348 void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Write(
349 Message* m,
350 const param_type p) {
351 MachPortMac mach_port_mac(p.get());
352 ParamTraits<MachPortMac>::Write(m, mach_port_mac);
353 }
354
355 bool ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Read(
356 const Message* m,
357 base::PickleIterator* iter,
358 param_type* r) {
359 MachPortMac mach_port_mac;
360 if (!ParamTraits<MachPortMac>::Read(m, iter, &mach_port_mac))
361 return false;
362 r->reset(mach_port_mac.get_mach_port());
363 return true;
364 }
365
366 void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Log(
367 const param_type& p,
368 std::string* l) {
369 l->append("IOSurface Mach send right: ");
370 LogParam(p.get(), l);
371 }
372 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
373
343 } // namespace IPC 374 } // namespace IPC
344 375
345 // Generate param traits write methods. 376 // Generate param traits write methods.
346 #include "ipc/param_traits_write_macros.h" 377 #include "ipc/param_traits_write_macros.h"
347 namespace IPC { 378 namespace IPC {
348 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 379 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
349 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 380 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
350 } // namespace IPC 381 } // namespace IPC
351 382
352 // Generate param traits read methods. 383 // Generate param traits read methods.
353 #include "ipc/param_traits_read_macros.h" 384 #include "ipc/param_traits_read_macros.h"
354 namespace IPC { 385 namespace IPC {
355 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 386 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
356 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 387 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
357 } // namespace IPC 388 } // namespace IPC
358 389
359 // Generate param traits log methods. 390 // Generate param traits log methods.
360 #include "ipc/param_traits_log_macros.h" 391 #include "ipc/param_traits_log_macros.h"
361 namespace IPC { 392 namespace IPC {
362 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ 393 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_
363 #include "ui/gfx/ipc/gfx_param_traits_macros.h" 394 #include "ui/gfx/ipc/gfx_param_traits_macros.h"
364 } // namespace IPC 395 } // namespace IPC
OLDNEW
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.h ('k') | ui/gfx/mac/io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698