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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl.h

Issue 302603004: Plumb GpuMemoryBuffer allocation to GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 6 years, 6 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
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698