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

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 1262333005: [tracing] Introduce MemoryDumpArgs to enable light and heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | media/filters/vpx_video_decoder.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 "gpu/command_buffer/service/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 : texture_state_(texture_state), 2035 : texture_state_(texture_state),
2036 begin_time_(base::TimeTicks::Now()) { 2036 begin_time_(base::TimeTicks::Now()) {
2037 } 2037 }
2038 2038
2039 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { 2039 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
2040 texture_state_->texture_upload_count++; 2040 texture_state_->texture_upload_count++;
2041 texture_state_->total_texture_upload_time += 2041 texture_state_->total_texture_upload_time +=
2042 base::TimeTicks::Now() - begin_time_; 2042 base::TimeTicks::Now() - begin_time_;
2043 } 2043 }
2044 2044
2045 bool TextureManager::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { 2045 bool TextureManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
2046 base::trace_event::ProcessMemoryDump* pmd) {
2046 for (const auto& resource : textures_) { 2047 for (const auto& resource : textures_) {
2047 // Only dump memory info for textures actually owned by this TextureManager. 2048 // Only dump memory info for textures actually owned by this TextureManager.
2048 DumpTextureRef(pmd, resource.second.get()); 2049 DumpTextureRef(pmd, resource.second.get());
2049 } 2050 }
2050 2051
2051 // Also dump TextureManager internal textures, if allocated. 2052 // Also dump TextureManager internal textures, if allocated.
2052 for (int i = 0; i < kNumDefaultTextures; i++) { 2053 for (int i = 0; i < kNumDefaultTextures; i++) {
2053 if (default_textures_[i]) { 2054 if (default_textures_[i]) {
2054 DumpTextureRef(pmd, default_textures_[i].get()); 2055 DumpTextureRef(pmd, default_textures_[i].get());
2055 } 2056 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 // The link to the memory tracking |client_id| is given a higher importance 2099 // The link to the memory tracking |client_id| is given a higher importance
2099 // than other refs. 2100 // than other refs.
2100 if (ref == ref->texture()->memory_tracking_ref_) 2101 if (ref == ref->texture()->memory_tracking_ref_)
2101 importance = 2; 2102 importance = 2;
2102 2103
2103 pmd->AddOwnershipEdge(client_guid, service_guid, importance); 2104 pmd->AddOwnershipEdge(client_guid, service_guid, importance);
2104 } 2105 }
2105 2106
2106 } // namespace gles2 2107 } // namespace gles2
2107 } // namespace gpu 2108 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | media/filters/vpx_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698