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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.h

Issue 604903005: content: Move IOSurface backed GpuMemoryBuffer allocation to GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include CoreFoundation.h Created 6 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
7
8 #include <IOSurface/IOSurfaceAPI.h>
9
10 #include "base/containers/hash_tables.h"
11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/memory/ref_counted.h"
13 #include "ui/gfx/geometry/size.h"
14 #include "ui/gfx/gpu_memory_buffer.h"
15
16 namespace gfx {
17 class GLImage;
18 }
19
20 namespace content {
21
22 class GpuMemoryBufferFactoryIOSurface {
23 public:
24 GpuMemoryBufferFactoryIOSurface();
25 ~GpuMemoryBufferFactoryIOSurface();
26
27 // Creates a IOSurface backed GPU memory buffer with |size| and
28 // |internalformat|. A valid handle is returned on success.
29 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
30 const gfx::GpuMemoryBufferId& id,
31 const gfx::Size& size,
32 unsigned internalformat);
33
34 // Destroy a previously created GPU memory buffer.
35 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id);
36
37 // Creates a GLImage instance for a GPU memory buffer.
38 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
39 const gfx::GpuMemoryBufferId& id,
40 const gfx::Size& size,
41 unsigned internalformat);
42
43 private:
44 typedef std::pair<int, int> IOSurfaceMapKey;
45 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>>
46 IOSurfaceMap;
47 IOSurfaceMap io_surfaces_;
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_mac.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698