OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" | 5 #include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // ClientNativePixmapFactory: | 52 // ClientNativePixmapFactory: |
53 bool IsConfigurationSupported(gfx::BufferFormat format, | 53 bool IsConfigurationSupported(gfx::BufferFormat format, |
54 gfx::BufferUsage usage) const override { | 54 gfx::BufferUsage usage) const override { |
55 switch (usage) { | 55 switch (usage) { |
56 case gfx::BufferUsage::GPU_READ: | 56 case gfx::BufferUsage::GPU_READ: |
57 return format == gfx::BufferFormat::BGR_565 || | 57 return format == gfx::BufferFormat::BGR_565 || |
58 format == gfx::BufferFormat::RGBA_8888 || | 58 format == gfx::BufferFormat::RGBA_8888 || |
59 format == gfx::BufferFormat::RGBX_8888 || | 59 format == gfx::BufferFormat::RGBX_8888 || |
60 format == gfx::BufferFormat::BGRA_8888 || | 60 format == gfx::BufferFormat::BGRA_8888 || |
61 format == gfx::BufferFormat::BGRX_8888 || | 61 format == gfx::BufferFormat::BGRX_8888 || |
| 62 #if defined(ARCH_CPU_X86_FAMILY) |
| 63 // Currently only Intel driver (i.e. minigbm and Mesa) supports |
| 64 // YUYV_422. crbug.com/683347 |
| 65 format == gfx::BufferFormat::YUYV_422 || |
| 66 #endif |
62 format == gfx::BufferFormat::YVU_420; | 67 format == gfx::BufferFormat::YVU_420; |
63 case gfx::BufferUsage::SCANOUT: | 68 case gfx::BufferUsage::SCANOUT: |
64 return format == gfx::BufferFormat::BGRX_8888 || | 69 return format == gfx::BufferFormat::BGRX_8888 || |
65 format == gfx::BufferFormat::RGBX_8888; | 70 format == gfx::BufferFormat::RGBX_8888; |
66 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE: | 71 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE: |
67 return format == gfx::BufferFormat::BGRX_8888 || | 72 return format == gfx::BufferFormat::BGRX_8888 || |
68 format == gfx::BufferFormat::BGRA_8888 || | 73 format == gfx::BufferFormat::BGRA_8888 || |
69 format == gfx::BufferFormat::RGBX_8888 || | 74 format == gfx::BufferFormat::RGBX_8888 || |
70 format == gfx::BufferFormat::RGBA_8888; | 75 format == gfx::BufferFormat::RGBA_8888; |
71 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 76 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
72 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { | 77 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { |
73 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
74 return | 79 return |
75 #if defined(ARCH_CPU_X86_FAMILY) | 80 #if defined(ARCH_CPU_X86_FAMILY) |
76 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8 | 81 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8 |
77 // and RG_88. crbug.com/356871 | 82 // and RG_88. crbug.com/356871 |
78 format == gfx::BufferFormat::R_8 || | 83 format == gfx::BufferFormat::R_8 || |
79 format == gfx::BufferFormat::RG_88 || | 84 format == gfx::BufferFormat::RG_88 || |
| 85 format == gfx::BufferFormat::YUYV_422 || |
80 #endif | 86 #endif |
81 format == gfx::BufferFormat::BGRA_8888; | 87 format == gfx::BufferFormat::BGRA_8888; |
82 #else | 88 #else |
83 return false; | 89 return false; |
84 #endif | 90 #endif |
85 } | 91 } |
86 } | 92 } |
87 NOTREACHED(); | 93 NOTREACHED(); |
88 return false; | 94 return false; |
89 } | 95 } |
(...skipping 24 matching lines...) Expand all Loading... |
114 } | 120 } |
115 | 121 |
116 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryDmabuf); | 122 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryDmabuf); |
117 }; | 123 }; |
118 | 124 |
119 ClientNativePixmapFactory* CreateClientNativePixmapFactoryDmabuf() { | 125 ClientNativePixmapFactory* CreateClientNativePixmapFactoryDmabuf() { |
120 return new ClientNativePixmapFactoryDmabuf(); | 126 return new ClientNativePixmapFactoryDmabuf(); |
121 } | 127 } |
122 | 128 |
123 } // namespace gfx | 129 } // namespace gfx |
OLD | NEW |