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

Side by Side Diff: ui/gfx/mac/io_surface.h

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.cc ('k') | ui/gfx/mac/io_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_MAC_IO_SURFACE_H_
6 #define UI_GFX_MAC_IO_SURFACE_H_
7
8 #include <IOSurface/IOSurface.h>
9 #include <mach/mach.h>
10
11 #include "base/mac/scoped_cftyperef.h"
12 #include "ui/gfx/buffer_types.h"
13 #include "ui/gfx/generic_shared_memory_id.h"
14 #include "ui/gfx/geometry/size.h"
15 #include "ui/gfx/gfx_export.h"
16
17 namespace gfx {
18
19 namespace internal {
20
21 struct IOSurfaceMachPortTraits {
22 GFX_EXPORT static mach_port_t InvalidValue() { return MACH_PORT_NULL; }
23 GFX_EXPORT static mach_port_t Retain(mach_port_t);
24 GFX_EXPORT static void Release(mach_port_t);
25 };
26
27 } // namespace internal
28
29 using IOSurfaceId = GenericSharedMemoryId;
30
31 // Helper function to create an IOSurface with a specified size and format.
32 GFX_EXPORT IOSurfaceRef CreateIOSurface(const Size& size, BufferFormat format);
33
34 // A scoper for handling Mach port names that are send rights for IOSurfaces.
35 // This scoper is both copyable and assignable, which will increase the kernel
36 // reference count of the right. On destruction, the reference count is
37 // decremented.
38 using ScopedRefCountedIOSurfaceMachPort =
39 base::ScopedTypeRef<mach_port_t, internal::IOSurfaceMachPortTraits>;
40
41 } // namespace gfx
42
43 #endif // UI_GFX_MAC_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.cc ('k') | ui/gfx/mac/io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698