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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 11516014: Track managed memory usage in the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve against HEAD Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 // made current before calling methods on the surface. 913 // made current before calling methods on the surface.
912 if (!surface_ || !MakeCurrent()) 914 if (!surface_ || !MakeCurrent())
913 return; 915 return;
914 surface_->SetFrontbufferAllocation( 916 surface_->SetFrontbufferAllocation(
915 allocation.browser_allocation.suggest_have_frontbuffer); 917 allocation.browser_allocation.suggest_have_frontbuffer);
916 } 918 }
917 919
918 } // namespace content 920 } // namespace content
919 921
920 #endif // defined(ENABLE_GPU) 922 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_manager.h » ('j') | content/common/gpu/gpu_memory_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698