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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10854076: Add GPU memory tab to the task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow only one outstanding vidmem refresh Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
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) {
ccameron 2012/08/09 20:55:39 Note that this records the first renderer's PID an
+ gpu_memory_manager_tracking_group_ = new GpuMemoryTrackingGroup(
+ channel->renderer_pid(),
+ 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);
}
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),
true);
}
if (surface_id != 0)

Powered by Google App Engine
This is Rietveld 408576698