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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 size += gpu_channel_manager()->gpu_memory_manager()->GetTrackerMemoryUsage( | 859 size += gpu_channel_manager()->gpu_memory_manager()->GetTrackerMemoryUsage( |
860 tracker); | 860 tracker); |
861 } | 861 } |
862 | 862 |
863 return size; | 863 return size; |
864 } | 864 } |
865 | 865 |
866 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( | 866 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( |
867 const gfx::GpuMemoryBufferHandle& handle, | 867 const gfx::GpuMemoryBufferHandle& handle, |
868 const gfx::Size& size, | 868 const gfx::Size& size, |
869 gfx::GpuMemoryBuffer::Format format, | 869 gfx::BufferFormat format, |
870 uint32 internalformat) { | 870 uint32 internalformat) { |
871 switch (handle.type) { | 871 switch (handle.type) { |
872 case gfx::SHARED_MEMORY_BUFFER: { | 872 case gfx::SHARED_MEMORY_BUFFER: { |
873 scoped_refptr<gfx::GLImageSharedMemory> image( | 873 scoped_refptr<gfx::GLImageSharedMemory> image( |
874 new gfx::GLImageSharedMemory(size, internalformat)); | 874 new gfx::GLImageSharedMemory(size, internalformat)); |
875 if (!image->Initialize(handle, format)) | 875 if (!image->Initialize(handle, format)) |
876 return scoped_refptr<gfx::GLImage>(); | 876 return scoped_refptr<gfx::GLImage>(); |
877 | 877 |
878 return image; | 878 return image; |
879 } | 879 } |
(...skipping 26 matching lines...) Expand all Loading... |
906 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str())); | 906 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str())); |
907 | 907 |
908 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 908 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
909 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 909 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
910 GetMemoryUsage()); | 910 GetMemoryUsage()); |
911 | 911 |
912 return true; | 912 return true; |
913 } | 913 } |
914 | 914 |
915 } // namespace content | 915 } // namespace content |
OLD | NEW |