Index: content/common/gpu/gpu_command_buffer_stub.cc |
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
index 15302bfaed2392f492ffb44c96bb6e8e1ed60add..52fdda0b9057f402eac5f51810d5afe142b157b7 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -38,15 +38,22 @@ namespace { |
// ContextGroup's memory type managers and the GpuMemoryManager class. |
class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker { |
public: |
- GpuCommandBufferMemoryTracker(GpuMemoryManager* gpu_memory_manager) |
- : gpu_memory_manager_(gpu_memory_manager) {} |
+ GpuCommandBufferMemoryTracker(GpuChannel* channel) { |
+ gpu_memory_manager_tracking_group_ = new GpuMemoryTrackingGroup( |
+ channel->renderer_pid(), |
greggman
2012/08/10 01:23:26
style: indent 4 spaces when splitting statement
ccameron
2012/08/10 18:13:38
Done.
|
+ channel->gpu_channel_manager()->gpu_memory_manager()); |
+ } |
+ |
void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) { |
- gpu_memory_manager_->TrackMemoryAllocatedChange(old_size, new_size); |
+ gpu_memory_manager_tracking_group_->TrackMemoryAllocatedChange( |
+ old_size, new_size); |
greggman
2012/08/10 01:23:26
style: indent 4 from previous line
ccameron
2012/08/10 18:13:38
Done.
|
} |
private: |
- ~GpuCommandBufferMemoryTracker() {} |
- GpuMemoryManager* gpu_memory_manager_; |
+ ~GpuCommandBufferMemoryTracker() { |
+ delete gpu_memory_manager_tracking_group_; |
+ } |
+ GpuMemoryTrackingGroup* gpu_memory_manager_tracking_group_; |
DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferMemoryTracker); |
}; |
@@ -123,8 +130,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( |
} else { |
context_group_ = new gpu::gles2::ContextGroup( |
mailbox_manager, |
- new GpuCommandBufferMemoryTracker( |
- channel->gpu_channel_manager()->gpu_memory_manager()), |
+ new GpuCommandBufferMemoryTracker(channel), |
greggman
2012/08/10 01:23:26
style: indent 4 from first line of this group (pre
ccameron
2012/08/10 18:13:38
Done.
|
true); |
} |
if (surface_id != 0) |