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

Side by Side Diff: gpu/command_buffer/service/gpu_control_service.h

Issue 20017005: gpu: Refactor GpuMemoryBuffer framework for multi-process support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_
7
8 #include <map>
9
10 #include "base/memory/linked_ptr.h"
11 #include "gpu/command_buffer/common/gpu_control.h"
12 #include "ui/gfx/gpu_memory_buffer.h"
13
14 namespace gpu {
15 class GpuMemoryBufferFactory;
16 class GpuMemoryBufferManagerInterface;
17
18 class GPU_EXPORT GpuControlService : public GpuControl {
19 public:
20 GpuControlService(GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager,
21 GpuMemoryBufferFactory* gpu_memory_buffer_factory);
22 virtual ~GpuControlService();
23
24 // Overridden from GpuControl:
25 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
26 size_t width,
27 size_t height,
28 unsigned internalformat,
29 int32* id) OVERRIDE;
30 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
31
32 // Register an existing gpu memory buffer and get an ID that can be used
33 // to identify it in the command buffer.
34 bool RegisterGpuMemoryBuffer(int32 id,
35 gfx::GpuMemoryBufferHandle buffer,
36 size_t width,
37 size_t height,
38 unsigned internalformat);
39
40 private:
41 GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager_;
42 GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
43 typedef std::map<int32, linked_ptr<gfx::GpuMemoryBuffer> > GpuMemoryBufferMap;
44 GpuMemoryBufferMap gpu_memory_buffers_;
45
46 DISALLOW_COPY_AND_ASSIGN(GpuControlService);
47 };
48
49 } // namespace gpu
50
51 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/gpu_control_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698