| 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 CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "gpu/command_buffer/service/memory_tracking.h" | 11 #include "gpu/command_buffer/service/memory_tracking.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class GpuMemoryManager; | 15 class GpuMemoryManager; |
| 16 | 16 |
| 17 // All decoders in a context group point to a single GpuMemoryTrackingGroup, | 17 // All decoders in a context group point to a single GpuMemoryTrackingGroup, |
| 18 // which tracks GPU resource consumption for the entire context group. | 18 // which tracks GPU resource consumption for the entire context group. |
| 19 class CONTENT_EXPORT GpuMemoryTrackingGroup { | 19 class CONTENT_EXPORT GpuMemoryTrackingGroup { |
| 20 public: | 20 public: |
| 21 ~GpuMemoryTrackingGroup(); | 21 ~GpuMemoryTrackingGroup(); |
| 22 void TrackMemoryAllocatedChange( | 22 void TrackMemoryAllocatedChange( |
| 23 size_t old_size, | 23 size_t old_size, |
| 24 size_t new_size, | 24 size_t new_size, |
| 25 gpu::gles2::MemoryTracker::Pool tracking_pool); | 25 gpu::gles2::MemoryTracker::Pool tracking_pool); |
| 26 bool EnsureGPUMemoryAvailable(size_t size_needed); |
| 26 base::ProcessId GetPid() const { | 27 base::ProcessId GetPid() const { |
| 27 return pid_; | 28 return pid_; |
| 28 } | 29 } |
| 29 size_t GetSize() const { | 30 size_t GetSize() const { |
| 30 return size_; | 31 return size_; |
| 31 } | 32 } |
| 32 gpu::gles2::MemoryTracker* GetMemoryTracker() const { | 33 gpu::gles2::MemoryTracker* GetMemoryTracker() const { |
| 33 return memory_tracker_; | 34 return memory_tracker_; |
| 34 } | 35 } |
| 35 | 36 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 47 // non-surface clients should be hibernated. | 48 // non-surface clients should be hibernated. |
| 48 bool hibernated_; | 49 bool hibernated_; |
| 49 | 50 |
| 50 gpu::gles2::MemoryTracker* memory_tracker_; | 51 gpu::gles2::MemoryTracker* memory_tracker_; |
| 51 GpuMemoryManager* memory_manager_; | 52 GpuMemoryManager* memory_manager_; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace content | 55 } // namespace content |
| 55 | 56 |
| 56 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 57 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| OLD | NEW |