| 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 #include "content/common/gpu/gpu_memory_manager.h" | 5 #include "content/common/gpu/gpu_memory_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 const GpuMemoryTrackingGroup* tracking_group = i->second; | 414 const GpuMemoryTrackingGroup* tracking_group = i->second; |
| 415 video_memory_usage_stats->process_map[ | 415 video_memory_usage_stats->process_map[ |
| 416 tracking_group->GetPid()].video_memory += tracking_group->GetSize(); | 416 tracking_group->GetPid()].video_memory += tracking_group->GetSize(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 // Assign the total across all processes in the GPU process | 419 // Assign the total across all processes in the GPU process |
| 420 video_memory_usage_stats->process_map[ | 420 video_memory_usage_stats->process_map[ |
| 421 base::GetCurrentProcId()].video_memory = GetCurrentUsage(); | 421 base::GetCurrentProcId()].video_memory = GetCurrentUsage(); |
| 422 video_memory_usage_stats->process_map[ | 422 video_memory_usage_stats->process_map[ |
| 423 base::GetCurrentProcId()].has_duplicates = true; | 423 base::GetCurrentProcId()].has_duplicates = true; |
| 424 |
| 425 video_memory_usage_stats->bytes_allocated = GetCurrentUsage(); |
| 426 video_memory_usage_stats->bytes_allocated_historical_max = |
| 427 bytes_allocated_historical_max_; |
| 424 } | 428 } |
| 425 | 429 |
| 426 void GpuMemoryManager::SetWindowCount(uint32 window_count) { | 430 void GpuMemoryManager::SetWindowCount(uint32 window_count) { |
| 427 bool should_schedule_manage = !window_count_has_been_received_ || | 431 bool should_schedule_manage = !window_count_has_been_received_ || |
| 428 (window_count != window_count_); | 432 (window_count != window_count_); |
| 429 window_count_has_been_received_ = true; | 433 window_count_has_been_received_ = true; |
| 430 window_count_ = window_count; | 434 window_count_ = window_count; |
| 431 if (should_schedule_manage) | 435 if (should_schedule_manage) |
| 432 ScheduleManage(true); | 436 ScheduleManage(true); |
| 433 } | 437 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 697 |
| 694 void GpuMemoryManager::RemoveClientFromList( | 698 void GpuMemoryManager::RemoveClientFromList( |
| 695 GpuMemoryManagerClientState* client_state) { | 699 GpuMemoryManagerClientState* client_state) { |
| 696 DCHECK(client_state->list_iterator_valid_); | 700 DCHECK(client_state->list_iterator_valid_); |
| 697 ClientStateList* client_list = GetClientList(client_state); | 701 ClientStateList* client_list = GetClientList(client_state); |
| 698 client_list->erase(client_state->list_iterator_); | 702 client_list->erase(client_state->list_iterator_); |
| 699 client_state->list_iterator_valid_ = false; | 703 client_state->list_iterator_valid_ = false; |
| 700 } | 704 } |
| 701 | 705 |
| 702 } // namespace content | 706 } // namespace content |
| OLD | NEW |