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

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

Issue 10915293: Simplify tracing of gpu memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nitfix Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/common/gpu/gpu_memory_manager.h" 5 #include "content/common/gpu/gpu_memory_manager.h"
6 6
7 #if defined(ENABLE_GPU) 7 #if defined(ENABLE_GPU)
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 DCHECK(bytes_allocated_current_ >= delta); 142 DCHECK(bytes_allocated_current_ >= delta);
143 bytes_allocated_current_ -= delta; 143 bytes_allocated_current_ -= delta;
144 } else { 144 } else {
145 size_t delta = new_size - old_size; 145 size_t delta = new_size - old_size;
146 bytes_allocated_current_ += delta; 146 bytes_allocated_current_ += delta;
147 if (bytes_allocated_current_ > bytes_allocated_historical_max_) { 147 if (bytes_allocated_current_ > bytes_allocated_historical_max_) {
148 bytes_allocated_historical_max_ = bytes_allocated_current_; 148 bytes_allocated_historical_max_ = bytes_allocated_current_;
149 } 149 }
150 } 150 }
151 if (new_size != old_size) { 151 if (new_size != old_size) {
152 TRACE_COUNTER_ID1("GpuMemoryManager", 152 TRACE_COUNTER1("gpu",
153 "GpuMemoryUsage", 153 "GpuMemoryUsage",
154 this, 154 bytes_allocated_current_);
155 bytes_allocated_current_);
156 } 155 }
157 } 156 }
158 157
159 void GpuMemoryManager::AddTrackingGroup( 158 void GpuMemoryManager::AddTrackingGroup(
160 GpuMemoryTrackingGroup* tracking_group) { 159 GpuMemoryTrackingGroup* tracking_group) {
161 tracking_groups_.insert(tracking_group); 160 tracking_groups_.insert(tracking_group);
162 } 161 }
163 162
164 void GpuMemoryManager::RemoveTrackingGroup( 163 void GpuMemoryManager::RemoveTrackingGroup(
165 GpuMemoryTrackingGroup* tracking_group) { 164 GpuMemoryTrackingGroup* tracking_group) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 false); 338 false);
340 339
341 AssignMemoryAllocations( 340 AssignMemoryAllocations(
342 &stub_memory_stats_for_last_manage_, 341 &stub_memory_stats_for_last_manage_,
343 stubs_without_surface_hibernated, 342 stubs_without_surface_hibernated,
344 GpuMemoryAllocation(0, GpuMemoryAllocation::kHasNoBuffers), 343 GpuMemoryAllocation(0, GpuMemoryAllocation::kHasNoBuffers),
345 false); 344 false);
346 } 345 }
347 346
348 #endif 347 #endif
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698