OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/gfx/gpu_memory_buffer.h" | 10 #include "ui/gfx/gpu_memory_buffer.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 unsigned internalformat, | 26 unsigned internalformat, |
27 unsigned usage); | 27 unsigned usage); |
28 | 28 |
29 // Allocates a GPU memory buffer with |size| and |internalformat| for |usage| | 29 // Allocates a GPU memory buffer with |size| and |internalformat| for |usage| |
30 // by |child_process|. The |handle| returned can be used by the | 30 // by |child_process|. The |handle| returned can be used by the |
31 // |child_process| to create an instance of this class. | 31 // |child_process| to create an instance of this class. |
32 static void AllocateForChildProcess(const gfx::Size& size, | 32 static void AllocateForChildProcess(const gfx::Size& size, |
33 unsigned internalformat, | 33 unsigned internalformat, |
34 unsigned usage, | 34 unsigned usage, |
35 base::ProcessHandle child_process, | 35 base::ProcessHandle child_process, |
| 36 int child_id, |
36 const AllocationCallback& callback); | 37 const AllocationCallback& callback); |
37 | 38 |
38 // Creates an instance from the given |handle|. |size| and |internalformat| | 39 // Creates an instance from the given |handle|. |size| and |internalformat| |
39 // should match what was used to allocate the |handle|. | 40 // should match what was used to allocate the |handle|. |
40 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | 41 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
41 gfx::GpuMemoryBufferHandle handle, | 42 gfx::GpuMemoryBufferHandle handle, |
42 const gfx::Size& size, | 43 const gfx::Size& size, |
43 unsigned internalformat); | 44 unsigned internalformat); |
44 | 45 |
45 // Returns true if |internalformat| is a format recognized by this base class. | 46 // Returns true if |internalformat| is a format recognized by this base class. |
(...skipping 15 matching lines...) Expand all Loading... |
61 const gfx::Size size_; | 62 const gfx::Size size_; |
62 const unsigned internalformat_; | 63 const unsigned internalformat_; |
63 bool mapped_; | 64 bool mapped_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); | 66 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace content | 69 } // namespace content |
69 | 70 |
70 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ | 71 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ |
OLD | NEW |