| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/gpu/browser_gpu_memory_buffer_manager.h" | 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 {gfx::BufferFormat::R_8, gfx::BufferUsage::MAP}, | 111 {gfx::BufferFormat::R_8, gfx::BufferUsage::MAP}, |
| 112 {gfx::BufferFormat::R_8, gfx::BufferUsage::PERSISTENT_MAP}, | 112 {gfx::BufferFormat::R_8, gfx::BufferUsage::PERSISTENT_MAP}, |
| 113 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::MAP}, | 113 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::MAP}, |
| 114 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::PERSISTENT_MAP}, | 114 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::PERSISTENT_MAP}, |
| 115 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::MAP}, | 115 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::MAP}, |
| 116 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::PERSISTENT_MAP}, | 116 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::PERSISTENT_MAP}, |
| 117 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP}, | 117 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP}, |
| 118 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP}, | 118 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP}, |
| 119 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::MAP}, | 119 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::MAP}, |
| 120 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::PERSISTENT_MAP}, | 120 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::PERSISTENT_MAP}, |
| 121 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::MAP}, |
| 122 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::PERSISTENT_MAP}, |
| 121 }; | 123 }; |
| 122 for (auto& configuration : kNativeConfigurations) { | 124 for (auto& configuration : kNativeConfigurations) { |
| 123 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) | 125 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) |
| 124 configurations.push_back(configuration); | 126 configurations.push_back(configuration); |
| 125 } | 127 } |
| 126 } | 128 } |
| 127 | 129 |
| 128 #if defined(USE_OZONE) || defined(OS_MACOSX) | 130 #if defined(USE_OZONE) || defined(OS_MACOSX) |
| 129 const GpuMemoryBufferFactory::Configuration kScanoutConfigurations[] = { | 131 const GpuMemoryBufferFactory::Configuration kScanoutConfigurations[] = { |
| 130 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, | 132 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, |
| 131 {gfx::BufferFormat::BGRX_8888, gfx::BufferUsage::SCANOUT}, | 133 {gfx::BufferFormat::BGRX_8888, gfx::BufferUsage::SCANOUT}, |
| 132 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::SCANOUT}, | 134 {gfx::BufferFormat::UYVY_422, gfx::BufferUsage::SCANOUT}, |
| 135 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::SCANOUT}, |
| 133 }; | 136 }; |
| 134 for (auto& configuration : kScanoutConfigurations) { | 137 for (auto& configuration : kScanoutConfigurations) { |
| 135 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) | 138 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) |
| 136 configurations.push_back(configuration); | 139 configurations.push_back(configuration); |
| 137 } | 140 } |
| 138 #endif | 141 #endif |
| 139 | 142 |
| 140 return configurations; | 143 return configurations; |
| 141 } | 144 } |
| 142 | 145 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 return gpu_client_tracing_id_; | 634 return gpu_client_tracing_id_; |
| 632 } | 635 } |
| 633 | 636 |
| 634 // In normal cases, |client_id| is a child process id, so we can perform | 637 // In normal cases, |client_id| is a child process id, so we can perform |
| 635 // the standard conversion. | 638 // the standard conversion. |
| 636 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( | 639 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( |
| 637 client_id); | 640 client_id); |
| 638 } | 641 } |
| 639 | 642 |
| 640 } // namespace content | 643 } // namespace content |
| OLD | NEW |