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

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

Issue 2717963002: ui: Add gfx::BufferUsage::SCANOUT_CPU_READ_WRITE. (Closed)
Patch Set: SCANOUT_CPU_READ_WRITE as valid shm usage Created 3 years, 9 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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool force_native_gpu_read_write_formats = 63 bool force_native_gpu_read_write_formats =
64 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 64 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
65 switches::kUseGL) != 65 switches::kUseGL) !=
66 gl::GetGLImplementationName(gl::GetSoftwareGLImplementation()); 66 gl::GetGLImplementationName(gl::GetSoftwareGLImplementation());
67 if (force_native_gpu_read_write_formats) { 67 if (force_native_gpu_read_write_formats) {
68 const gfx::BufferFormat kGPUReadWriteFormats[] = { 68 const gfx::BufferFormat kGPUReadWriteFormats[] = {
69 gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888, 69 gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888,
70 gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::BGRA_8888, 70 gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::BGRA_8888,
71 gfx::BufferFormat::BGRX_8888, gfx::BufferFormat::UYVY_422, 71 gfx::BufferFormat::BGRX_8888, gfx::BufferFormat::UYVY_422,
72 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR}; 72 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR};
73 const gfx::BufferUsage kGPUReadWriteUsages[] = {gfx::BufferUsage::GPU_READ, 73 const gfx::BufferUsage kGPUReadWriteUsages[] = {
74 gfx::BufferUsage::SCANOUT}; 74 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT,
75 gfx::BufferUsage::SCANOUT_CPU_READ_WRITE};
75 for (auto format : kGPUReadWriteFormats) { 76 for (auto format : kGPUReadWriteFormats) {
76 for (auto usage : kGPUReadWriteUsages) { 77 for (auto usage : kGPUReadWriteUsages) {
77 if (IsNativeGpuMemoryBufferConfigurationSupported(format, usage)) 78 if (IsNativeGpuMemoryBufferConfigurationSupported(format, usage))
78 configurations.insert(std::make_pair(format, usage)); 79 configurations.insert(std::make_pair(format, usage));
79 } 80 }
80 } 81 }
81 } 82 }
82 #endif // defined(USE_OZONE) || defined(OS_MACOSX) 83 #endif // defined(USE_OZONE) || defined(OS_MACOSX)
83 84
84 return configurations; 85 return configurations;
(...skipping 22 matching lines...) Expand all
107 break; 108 break;
108 } 109 }
109 NOTREACHED(); 110 NOTREACHED();
110 return GL_TEXTURE_2D; 111 return GL_TEXTURE_2D;
111 #else // defined(USE_OZONE) || defined(OS_MACOSX) 112 #else // defined(USE_OZONE) || defined(OS_MACOSX)
112 return GL_TEXTURE_2D; 113 return GL_TEXTURE_2D;
113 #endif 114 #endif
114 } 115 }
115 116
116 } // namespace gpu 117 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_memory_buffer_support.cc ('k') | gpu/ipc/service/gpu_memory_buffer_factory_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698