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

Side by Side Diff: content/child/child_gpu_memory_buffer_manager.h

Issue 2490503002: gpu: A common GpuMemoryBufferManager implemenetation for clients. (Closed)
Patch Set: tot merge Created 4 years, 1 month 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 | « no previous file | content/child/child_gpu_memory_buffer_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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_ 5 #ifndef CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_ 6 #define CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/child/thread_safe_sender.h" 11 #include "content/child/thread_safe_sender.h"
12 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 12 #include "gpu/ipc/client/client_gpu_memory_buffer_manager.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class ChildGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { 16 class ChildGpuMemoryBufferManager
17 : public gpu::ClientGpuMemoryBufferManager::Delegate {
17 public: 18 public:
18 explicit ChildGpuMemoryBufferManager(ThreadSafeSender* sender); 19 explicit ChildGpuMemoryBufferManager(ThreadSafeSender* sender);
19 ~ChildGpuMemoryBufferManager() override; 20 ~ChildGpuMemoryBufferManager() override;
20 21
21 // Overridden from gpu::GpuMemoryBufferManager: 22 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() {
22 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 23 return gpu_memory_buffer_manager_.get();
24 }
25
26 private:
27 // gpu::ClientGpuMemoryBufferManager::Delegate:
28 gfx::GpuMemoryBufferHandle GetSharedMemoryHandle(
23 const gfx::Size& size, 29 const gfx::Size& size,
24 gfx::BufferFormat format, 30 gfx::BufferFormat format,
25 gfx::BufferUsage usage, 31 gfx::BufferUsage usage) override;
26 gpu::SurfaceHandle surface_handle) override; 32 void DeletedGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
27 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( 33 const gpu::SyncToken& token) override;
28 const gfx::GpuMemoryBufferHandle& handle,
29 const gfx::Size& size,
30 gfx::BufferFormat format) override;
31 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
32 ClientBuffer buffer) override;
33 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
34 const gpu::SyncToken& sync_token) override;
35 34
36 private:
37 scoped_refptr<ThreadSafeSender> sender_; 35 scoped_refptr<ThreadSafeSender> sender_;
36 scoped_refptr<gpu::ClientGpuMemoryBufferManager> gpu_memory_buffer_manager_;
38 37
39 DISALLOW_COPY_AND_ASSIGN(ChildGpuMemoryBufferManager); 38 DISALLOW_COPY_AND_ASSIGN(ChildGpuMemoryBufferManager);
40 }; 39 };
41 40
42 } // namespace content 41 } // namespace content
43 42
44 #endif // CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_ 43 #endif // CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/child_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698