| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #if defined(USE_OZONE) || defined(OS_MACOSX) | 103 #if defined(USE_OZONE) || defined(OS_MACOSX) |
| 104 // Disable native buffers only when using Mesa. | 104 // Disable native buffers only when using Mesa. |
| 105 bool force_native_gpu_read_write_formats = | 105 bool force_native_gpu_read_write_formats = |
| 106 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 106 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 107 switches::kUseGL) != gl::kGLImplementationOSMesaName; | 107 switches::kUseGL) != gl::kGLImplementationOSMesaName; |
| 108 #else | 108 #else |
| 109 bool force_native_gpu_read_write_formats = false; | 109 bool force_native_gpu_read_write_formats = false; |
| 110 #endif | 110 #endif |
| 111 if (force_native_gpu_read_write_formats) { | 111 if (force_native_gpu_read_write_formats) { |
| 112 const gfx::BufferFormat kGPUReadWriteFormats[] = { | 112 const gfx::BufferFormat kGPUReadWriteFormats[] = { |
| 113 gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888, | 113 gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888, |
| 114 gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::BGRA_8888, | 114 gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::BGRA_8888, |
| 115 gfx::BufferFormat::BGRX_8888, gfx::BufferFormat::UYVY_422, | 115 gfx::BufferFormat::BGRX_8888, gfx::BufferFormat::UYVY_422, |
| 116 gfx::BufferFormat::YUV_420_BIPLANAR}; | 116 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR}; |
| 117 const gfx::BufferUsage kGPUReadWriteUsages[] = { | 117 const gfx::BufferUsage kGPUReadWriteUsages[] = { |
| 118 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT}; | 118 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT}; |
| 119 for (auto& format : kGPUReadWriteFormats) { | 119 for (auto& format : kGPUReadWriteFormats) { |
| 120 for (auto& usage : kGPUReadWriteUsages) { | 120 for (auto& usage : kGPUReadWriteUsages) { |
| 121 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(format, usage)) | 121 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(format, usage)) |
| 122 configurations.insert(std::make_pair(format, usage)); | 122 configurations.insert(std::make_pair(format, usage)); |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 format(format), | 739 format(format), |
| 740 usage(usage), | 740 usage(usage), |
| 741 gpu_host_id(gpu_host_id) {} | 741 gpu_host_id(gpu_host_id) {} |
| 742 | 742 |
| 743 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = | 743 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = |
| 744 default; | 744 default; |
| 745 | 745 |
| 746 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} | 746 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} |
| 747 | 747 |
| 748 } // namespace content | 748 } // namespace content |
| OLD | NEW |