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

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

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no ozone Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "gles2_impl_export.h" 10 #include "gles2_impl_export.h"
11 11 #include "ui/gfx/gpu_memory_buffer.h"
12 namespace gfx {
13 class GpuMemoryBuffer;
14 }
15 12
16 namespace gpu { 13 namespace gpu {
17 class GpuControl; 14 class GpuControl;
18 15
19 namespace gles2 { 16 namespace gles2 {
20 17
21 // Tracks GPU memory buffer objects on the client side. 18 // Tracks GPU memory buffer objects on the client side.
22 class GLES2_IMPL_EXPORT GpuMemoryBufferTracker { 19 class GLES2_IMPL_EXPORT GpuMemoryBufferTracker {
23 public: 20 public:
24 explicit GpuMemoryBufferTracker(GpuControl* gpu_control); 21 explicit GpuMemoryBufferTracker(GpuControl* gpu_control);
25 virtual ~GpuMemoryBufferTracker(); 22 virtual ~GpuMemoryBufferTracker();
26 23
27 int32 CreateBuffer(size_t width, size_t height, int32 internalformat); 24 int32 CreateBuffer(size_t width,
25 size_t height,
26 int32 internalformat,
27 gfx::GpuMemoryBuffer::Usage usage);
28 gfx::GpuMemoryBuffer* GetBuffer(int32 image_id); 28 gfx::GpuMemoryBuffer* GetBuffer(int32 image_id);
29 void RemoveBuffer(int32 image_id); 29 void RemoveBuffer(int32 image_id);
30 30
31 private: 31 private:
32 typedef base::hash_map<int32, gfx::GpuMemoryBuffer*> BufferMap; 32 typedef base::hash_map<int32, gfx::GpuMemoryBuffer*> BufferMap;
33 BufferMap buffers_; 33 BufferMap buffers_;
34 GpuControl* gpu_control_; 34 GpuControl* gpu_control_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferTracker); 36 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferTracker);
37 }; 37 };
38 38
39 } // namespace gles2 39 } // namespace gles2
40 } // namespace gpu 40 } // namespace gpu
41 41
42 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_ 42 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698