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

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

Issue 2213273002: ozone: Consolidate primary plane format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK(GL_RGBA, internal_format_); Created 4 years, 4 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/common/gpu_memory_buffer_support.h" 5 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(USE_OZONE) 10 #if defined(USE_OZONE)
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 bool IsNativeGpuMemoryBufferConfigurationSupported(gfx::BufferFormat format, 29 bool IsNativeGpuMemoryBufferConfigurationSupported(gfx::BufferFormat format,
30 gfx::BufferUsage usage) { 30 gfx::BufferUsage usage) {
31 #if defined(OS_MACOSX) 31 #if defined(OS_MACOSX)
32 switch (usage) { 32 switch (usage) {
33 case gfx::BufferUsage::GPU_READ: 33 case gfx::BufferUsage::GPU_READ:
34 case gfx::BufferUsage::SCANOUT: 34 case gfx::BufferUsage::SCANOUT:
35 return format == gfx::BufferFormat::BGRA_8888 || 35 return format == gfx::BufferFormat::BGRA_8888 ||
36 format == gfx::BufferFormat::RGBA_8888 || 36 format == gfx::BufferFormat::RGBA_8888 ||
37 format == gfx::BufferFormat::BGRX_8888; 37 format == gfx::BufferFormat::BGRX_8888 ||
38 format == gfx::BufferFormat::RGBX_8888;
38 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 39 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
39 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 40 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
40 return format == gfx::BufferFormat::R_8 || 41 return format == gfx::BufferFormat::R_8 ||
41 format == gfx::BufferFormat::BGRA_8888 || 42 format == gfx::BufferFormat::BGRA_8888 ||
42 format == gfx::BufferFormat::UYVY_422 || 43 format == gfx::BufferFormat::UYVY_422 ||
43 format == gfx::BufferFormat::YUV_420_BIPLANAR; 44 format == gfx::BufferFormat::YUV_420_BIPLANAR;
44 } 45 }
45 NOTREACHED(); 46 NOTREACHED();
46 return false; 47 return false;
47 #endif 48 #endif
(...skipping 18 matching lines...) Expand all
66 } 67 }
67 return ui::ClientNativePixmapFactory::GetInstance()->IsConfigurationSupported( 68 return ui::ClientNativePixmapFactory::GetInstance()->IsConfigurationSupported(
68 format, usage); 69 format, usage);
69 #endif 70 #endif
70 71
71 NOTREACHED(); 72 NOTREACHED();
72 return false; 73 return false;
73 } 74 }
74 75
75 } // namespace gpu 76 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698