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

Side by Side Diff: gpu/command_buffer/client/gpu_memory_buffer_tracker_in_process.h

Issue 14456004: GPU client side changes for GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@glapi
Patch Set: Rollback decoder changes Created 7 years, 7 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 (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_CLIENT_GPU_MEMORY_BUFFER_TRACKER_IN_PROCESS_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_IN_PROCESS_H_
7
8 #include <GLES2/gl2.h>
9
10 #include "../client/gpu_memory_buffer_tracker.h"
11 #include "../client/hash_tables.h"
12 /* #include "../common/gles2_cmd_format.h" */
13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h"
15 #include "gles2_impl_export.h"
16
17 namespace gpu {
18 class GpuMemoryBuffer;
19
20 namespace gles2 {
21 class GpuMemoryBufferFactory;
22
23 // Tracks GPU memory buffer objects for client side of command buffer.
24 class GLES2_IMPL_EXPORT GpuMemoryBufferTrackerInProcess
25 : public GpuMemoryBufferTracker {
26 public:
27 // Ownership of |factory| remains with caller.
28 explicit GpuMemoryBufferTrackerInProcess(GpuMemoryBufferFactory* factory);
29 virtual ~GpuMemoryBufferTrackerInProcess();
30
31 // Methods from GpuMemoryBufferTracker
32 virtual GLuint CreateBuffer(GLsizei width, GLsizei height) OVERRIDE;
33 virtual GpuMemoryBuffer* GetBuffer(GLuint image_id) OVERRIDE;
34 virtual void RemoveBuffer(GLuint image_id) OVERRIDE;
35
36 private:
37 typedef gpu::hash_map<GLuint, GpuMemoryBuffer*> BufferMap;
38 BufferMap buffers_;
39 GpuMemoryBufferFactory* factory_; // weak
40
41 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferTrackerInProcess);
42 };
43
44 } // namespace gles2
45 } // namespace gpu
46
47 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_IN_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698