| 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 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 // Resources may be shared across processes and require a shared GUID to | 1965 // Resources may be shared across processes and require a shared GUID to |
| 1966 // prevent double counting the memory. | 1966 // prevent double counting the memory. |
| 1967 base::trace_event::MemoryAllocatorDumpGuid guid; | 1967 base::trace_event::MemoryAllocatorDumpGuid guid; |
| 1968 switch (resource.type) { | 1968 switch (resource.type) { |
| 1969 case RESOURCE_TYPE_GPU_MEMORY_BUFFER: | 1969 case RESOURCE_TYPE_GPU_MEMORY_BUFFER: |
| 1970 guid = gfx::GetGpuMemoryBufferGUIDForTracing( | 1970 guid = gfx::GetGpuMemoryBufferGUIDForTracing( |
| 1971 tracing_process_id, resource.gpu_memory_buffer->GetHandle().id); | 1971 tracing_process_id, resource.gpu_memory_buffer->GetHandle().id); |
| 1972 break; | 1972 break; |
| 1973 case RESOURCE_TYPE_GL_TEXTURE: | 1973 case RESOURCE_TYPE_GL_TEXTURE: |
| 1974 DCHECK(resource.gl_id); | 1974 DCHECK(resource.gl_id); |
| 1975 guid = gfx::GetGLTextureClientGUIDForTracing( | 1975 guid = gl::GetGLTextureClientGUIDForTracing( |
| 1976 compositor_context_provider_->ContextSupport() | 1976 compositor_context_provider_->ContextSupport() |
| 1977 ->ShareGroupTracingGUID(), | 1977 ->ShareGroupTracingGUID(), |
| 1978 resource.gl_id); | 1978 resource.gl_id); |
| 1979 break; | 1979 break; |
| 1980 case RESOURCE_TYPE_BITMAP: | 1980 case RESOURCE_TYPE_BITMAP: |
| 1981 DCHECK(resource.has_shared_bitmap_id); | 1981 DCHECK(resource.has_shared_bitmap_id); |
| 1982 guid = GetSharedBitmapGUIDForTracing(resource.shared_bitmap_id); | 1982 guid = GetSharedBitmapGUIDForTracing(resource.shared_bitmap_id); |
| 1983 break; | 1983 break; |
| 1984 } | 1984 } |
| 1985 | 1985 |
| 1986 DCHECK(!guid.empty()); | 1986 DCHECK(!guid.empty()); |
| 1987 | 1987 |
| 1988 const int kImportance = 2; | 1988 const int kImportance = 2; |
| 1989 pmd->CreateSharedGlobalAllocatorDump(guid); | 1989 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 1990 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1990 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 return true; | 1993 return true; |
| 1994 } | 1994 } |
| 1995 | 1995 |
| 1996 } // namespace cc | 1996 } // namespace cc |
| OLD | NEW |