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/ozone/platform/drm/client_native_pixmap_factory_gbm.h" | 5 #include "ui/ozone/platform/drm/client_native_pixmap_factory_gbm.h" |
6 | 6 |
7 #include "ui/gfx/native_pixmap_handle_ozone.h" | 7 #include "ui/gfx/native_pixmap_handle_ozone.h" |
8 #include "ui/ozone/public/client_native_pixmap_factory.h" | 8 #include "ui/ozone/public/client_native_pixmap_factory.h" |
9 | 9 |
10 #if defined(USE_VGEM_MAP) | 10 #if defined(USE_VGEM_MAP) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 DCHECK_LT(vgem_fd_.get(), 0); | 43 DCHECK_LT(vgem_fd_.get(), 0); |
44 vgem_fd_ = device_fd.Pass(); | 44 vgem_fd_ = device_fd.Pass(); |
45 #endif | 45 #endif |
46 } | 46 } |
47 bool IsConfigurationSupported(gfx::BufferFormat format, | 47 bool IsConfigurationSupported(gfx::BufferFormat format, |
48 gfx::BufferUsage usage) const override { | 48 gfx::BufferUsage usage) const override { |
49 switch (usage) { | 49 switch (usage) { |
50 case gfx::BufferUsage::GPU_READ: | 50 case gfx::BufferUsage::GPU_READ: |
51 case gfx::BufferUsage::SCANOUT: | 51 case gfx::BufferUsage::SCANOUT: |
52 return format == gfx::BufferFormat::RGBA_8888 || | 52 return format == gfx::BufferFormat::RGBA_8888 || |
| 53 format == gfx::BufferFormat::RGBX_8888 || |
53 format == gfx::BufferFormat::BGRA_8888 || | 54 format == gfx::BufferFormat::BGRA_8888 || |
54 format == gfx::BufferFormat::BGRX_8888; | 55 format == gfx::BufferFormat::BGRX_8888; |
55 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 56 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
56 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { | 57 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { |
57 #if defined(USE_VGEM_MAP) | 58 #if defined(USE_VGEM_MAP) |
58 return vgem_fd_.is_valid() && format == gfx::BufferFormat::BGRA_8888; | 59 return vgem_fd_.is_valid() && format == gfx::BufferFormat::BGRA_8888; |
59 #else | 60 #else |
60 return false; | 61 return false; |
61 #endif | 62 #endif |
62 } | 63 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 #endif | 98 #endif |
98 | 99 |
99 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 100 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
100 }; | 101 }; |
101 | 102 |
102 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 103 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
103 return new ClientNativePixmapFactoryGbm(); | 104 return new ClientNativePixmapFactoryGbm(); |
104 } | 105 } |
105 | 106 |
106 } // namespace ui | 107 } // namespace ui |
OLD | NEW |