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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // ContextGroup's memory type managers and the GpuMemoryManager class. | 46 // ContextGroup's memory type managers and the GpuMemoryManager class. |
47 class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker { | 47 class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker { |
48 public: | 48 public: |
49 GpuCommandBufferMemoryTracker(GpuChannel* channel) { | 49 GpuCommandBufferMemoryTracker(GpuChannel* channel) { |
50 gpu_memory_manager_tracking_group_ = new GpuMemoryTrackingGroup( | 50 gpu_memory_manager_tracking_group_ = new GpuMemoryTrackingGroup( |
51 channel->renderer_pid(), | 51 channel->renderer_pid(), |
52 this, | 52 this, |
53 channel->gpu_channel_manager()->gpu_memory_manager()); | 53 channel->gpu_channel_manager()->gpu_memory_manager()); |
54 } | 54 } |
55 | 55 |
56 void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) { | 56 void TrackMemoryAllocatedChange(size_t old_size, |
| 57 size_t new_size, |
| 58 gpu::gles2::MemoryTracker::Pool pool) { |
57 gpu_memory_manager_tracking_group_->TrackMemoryAllocatedChange( | 59 gpu_memory_manager_tracking_group_->TrackMemoryAllocatedChange( |
58 old_size, new_size); | 60 old_size, new_size, pool); |
59 } | 61 } |
60 | 62 |
61 private: | 63 private: |
62 ~GpuCommandBufferMemoryTracker() { | 64 ~GpuCommandBufferMemoryTracker() { |
63 delete gpu_memory_manager_tracking_group_; | 65 delete gpu_memory_manager_tracking_group_; |
64 } | 66 } |
65 GpuMemoryTrackingGroup* gpu_memory_manager_tracking_group_; | 67 GpuMemoryTrackingGroup* gpu_memory_manager_tracking_group_; |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferMemoryTracker); | 69 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferMemoryTracker); |
68 }; | 70 }; |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 // made current before calling methods on the surface. | 915 // made current before calling methods on the surface. |
914 if (!surface_ || !MakeCurrent()) | 916 if (!surface_ || !MakeCurrent()) |
915 return; | 917 return; |
916 surface_->SetFrontbufferAllocation( | 918 surface_->SetFrontbufferAllocation( |
917 allocation.browser_allocation.suggest_have_frontbuffer); | 919 allocation.browser_allocation.suggest_have_frontbuffer); |
918 } | 920 } |
919 | 921 |
920 } // namespace content | 922 } // namespace content |
921 | 923 |
922 #endif // defined(ENABLE_GPU) | 924 #endif // defined(ENABLE_GPU) |
OLD | NEW |