Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Side by Side Diff: gpu/ipc/host/gpu_memory_buffer_support.cc

Issue 2786103003: Add half-float IOSurface GpuMemoryBuffer support (Closed)
Patch Set: Review feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/common/gpu_memory_buffer_support.cc ('k') | gpu/ipc/in_process_command_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "gpu/ipc/host/gpu_memory_buffer_support.h" 5 #include "gpu/ipc/host/gpu_memory_buffer_support.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
(...skipping 20 matching lines...) Expand all
31 switches::kEnableNativeGpuMemoryBuffers); 31 switches::kEnableNativeGpuMemoryBuffers);
32 #endif 32 #endif
33 } 33 }
34 34
35 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() { 35 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
36 GpuMemoryBufferConfigurationSet configurations; 36 GpuMemoryBufferConfigurationSet configurations;
37 37
38 #if defined(USE_OZONE) || defined(OS_MACOSX) 38 #if defined(USE_OZONE) || defined(OS_MACOSX)
39 if (AreNativeGpuMemoryBuffersEnabled()) { 39 if (AreNativeGpuMemoryBuffersEnabled()) {
40 const gfx::BufferFormat kNativeFormats[] = { 40 const gfx::BufferFormat kNativeFormats[] = {
41 gfx::BufferFormat::R_8, 41 gfx::BufferFormat::R_8, gfx::BufferFormat::RG_88,
42 gfx::BufferFormat::RG_88, 42 gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_4444,
43 gfx::BufferFormat::BGR_565, 43 gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGRA_8888,
44 gfx::BufferFormat::RGBA_4444, 44 gfx::BufferFormat::RGBA_F16, gfx::BufferFormat::UYVY_422,
45 gfx::BufferFormat::RGBA_8888, 45 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR};
46 gfx::BufferFormat::BGRA_8888,
47 gfx::BufferFormat::UYVY_422,
48 gfx::BufferFormat::YVU_420,
49 gfx::BufferFormat::YUV_420_BIPLANAR};
50 const gfx::BufferUsage kNativeUsages[] = { 46 const gfx::BufferUsage kNativeUsages[] = {
51 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT, 47 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT,
52 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, 48 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
53 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; 49 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT};
54 for (auto format : kNativeFormats) { 50 for (auto format : kNativeFormats) {
55 for (auto usage : kNativeUsages) { 51 for (auto usage : kNativeUsages) {
56 if (IsNativeGpuMemoryBufferConfigurationSupported(format, usage)) 52 if (IsNativeGpuMemoryBufferConfigurationSupported(format, usage))
57 configurations.insert(std::make_pair(format, usage)); 53 configurations.insert(std::make_pair(format, usage));
58 } 54 }
59 } 55 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 break; 104 break;
109 } 105 }
110 NOTREACHED(); 106 NOTREACHED();
111 return GL_TEXTURE_2D; 107 return GL_TEXTURE_2D;
112 #else // defined(USE_OZONE) || defined(OS_MACOSX) 108 #else // defined(USE_OZONE) || defined(OS_MACOSX)
113 return GL_TEXTURE_2D; 109 return GL_TEXTURE_2D;
114 #endif 110 #endif
115 } 111 }
116 112
117 } // namespace gpu 113 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_memory_buffer_support.cc ('k') | gpu/ipc/in_process_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698