OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVICE_MEMORY_TRACKING_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 kManaged | 23 kManaged |
24 }; | 24 }; |
25 | 25 |
26 virtual void TrackMemoryAllocatedChange(size_t old_size, | 26 virtual void TrackMemoryAllocatedChange(size_t old_size, |
27 size_t new_size, | 27 size_t new_size, |
28 Pool pool) = 0; | 28 Pool pool) = 0; |
29 | 29 |
30 // Ensure a certain amount of GPU memory is free. Returns true on success. | 30 // Ensure a certain amount of GPU memory is free. Returns true on success. |
31 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) = 0; | 31 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) = 0; |
32 | 32 |
| 33 // Id which identifies the GPU client for whom memory is being allocated. |
| 34 virtual uint64_t ClientTracingId() = 0; |
| 35 |
33 protected: | 36 protected: |
34 friend class base::RefCounted<MemoryTracker>; | 37 friend class base::RefCounted<MemoryTracker>; |
35 MemoryTracker() {} | 38 MemoryTracker() {} |
36 virtual ~MemoryTracker() {}; | 39 virtual ~MemoryTracker() {}; |
37 | 40 |
38 private: | 41 private: |
39 DISALLOW_COPY_AND_ASSIGN(MemoryTracker); | 42 DISALLOW_COPY_AND_ASSIGN(MemoryTracker); |
40 }; | 43 }; |
41 | 44 |
42 // A MemoryTypeTracker tracks the use of a particular type of memory (buffer, | 45 // A MemoryTypeTracker tracks the use of a particular type of memory (buffer, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 size_t mem_represented_; | 106 size_t mem_represented_; |
104 size_t mem_represented_at_last_update_; | 107 size_t mem_represented_at_last_update_; |
105 | 108 |
106 DISALLOW_COPY_AND_ASSIGN(MemoryTypeTracker); | 109 DISALLOW_COPY_AND_ASSIGN(MemoryTypeTracker); |
107 }; | 110 }; |
108 | 111 |
109 } // namespace gles2 | 112 } // namespace gles2 |
110 } // namespace gpu | 113 } // namespace gpu |
111 | 114 |
112 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ | 115 #endif // GPU_COMMAND_BUFFER_SERVICE_MEMORY_TRACKING_H_ |
OLD | NEW |