OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 bool ResourceProvider::IsGLContextLost() const { | 2104 bool ResourceProvider::IsGLContextLost() const { |
2105 return ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR; | 2105 return ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR; |
2106 } | 2106 } |
2107 | 2107 |
2108 bool ResourceProvider::OnMemoryDump( | 2108 bool ResourceProvider::OnMemoryDump( |
2109 const base::trace_event::MemoryDumpArgs& args, | 2109 const base::trace_event::MemoryDumpArgs& args, |
2110 base::trace_event::ProcessMemoryDump* pmd) { | 2110 base::trace_event::ProcessMemoryDump* pmd) { |
2111 DCHECK(thread_checker_.CalledOnValidThread()); | 2111 DCHECK(thread_checker_.CalledOnValidThread()); |
2112 | 2112 |
2113 const uint64_t tracing_process_id = | 2113 const uint64_t tracing_process_id = |
2114 base::trace_event::MemoryDumpManager::GetInstance() | 2114 base::trace_event::MemoryDumpManager::GetInstance()->tracing_process_id(); |
2115 ->GetTracingProcessId(); | |
2116 | 2115 |
2117 for (const auto& resource_entry : resources_) { | 2116 for (const auto& resource_entry : resources_) { |
2118 const auto& resource = resource_entry.second; | 2117 const auto& resource = resource_entry.second; |
2119 | 2118 |
2120 bool backing_memory_allocated = false; | 2119 bool backing_memory_allocated = false; |
2121 switch (resource.type) { | 2120 switch (resource.type) { |
2122 case RESOURCE_TYPE_GPU_MEMORY_BUFFER: | 2121 case RESOURCE_TYPE_GPU_MEMORY_BUFFER: |
2123 backing_memory_allocated = !!resource.gpu_memory_buffer; | 2122 backing_memory_allocated = !!resource.gpu_memory_buffer; |
2124 break; | 2123 break; |
2125 case RESOURCE_TYPE_GL_TEXTURE: | 2124 case RESOURCE_TYPE_GL_TEXTURE: |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 | 2173 |
2175 const int kImportance = 2; | 2174 const int kImportance = 2; |
2176 pmd->CreateSharedGlobalAllocatorDump(guid); | 2175 pmd->CreateSharedGlobalAllocatorDump(guid); |
2177 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2176 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
2178 } | 2177 } |
2179 | 2178 |
2180 return true; | 2179 return true; |
2181 } | 2180 } |
2182 | 2181 |
2183 } // namespace cc | 2182 } // namespace cc |
OLD | NEW |