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

Side by Side Diff: ui/gfx/mac/io_surface_manager.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/mac/io_surface.cc ('k') | ui/gfx/mac/io_surface_manager.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 CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_
6 #define CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_
7
8 #include <IOSurface/IOSurface.h>
9
10 #include "ui/gfx/buffer_types.h"
11 #include "ui/gfx/generic_shared_memory_id.h"
12 #include "ui/gfx/geometry/size.h"
13 #include "ui/gfx/gfx_export.h"
14
15 namespace gfx {
16
17 using IOSurfaceId = GenericSharedMemoryId;
18
19 // This interface provides a mechanism for different processes to securely
20 // share IOSurfaces. A process can register an IOSurface for use in another
21 // process and the client ID provided with registration determines the process
22 // that can acquire a reference to the IOSurface.
23 class GFX_EXPORT IOSurfaceManager {
24 public:
25 static IOSurfaceManager* GetInstance();
26 static void SetInstance(IOSurfaceManager* instance);
27
28 // Helper function to create an IOSurface with a specified size and format.
29 static IOSurfaceRef CreateIOSurface(const Size& size, BufferFormat format);
30
31 // Register an IO surface for use in another process.
32 virtual bool RegisterIOSurface(IOSurfaceId io_surface_id,
33 int client_id,
34 IOSurfaceRef io_surface) = 0;
35
36 // Unregister an IO surface previously registered for use in another
37 // process.
38 virtual void UnregisterIOSurface(IOSurfaceId io_surface_id,
39 int client_id) = 0;
40
41 // Acquire IO surface reference for a registered IO surface.
42 virtual IOSurfaceRef AcquireIOSurface(IOSurfaceId io_surface_id) = 0;
43
44 protected:
45 virtual ~IOSurfaceManager() {}
46 };
47
48 } // namespace content
49
50 #endif // CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/gfx/mac/io_surface.cc ('k') | ui/gfx/mac/io_surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698