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 <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 30 matching lines...) Expand all Loading... |
41 gfx::BufferUsage usage) const override { | 41 gfx::BufferUsage usage) const override { |
42 switch (usage) { | 42 switch (usage) { |
43 case gfx::BufferUsage::GPU_READ: | 43 case gfx::BufferUsage::GPU_READ: |
44 return format == gfx::BufferFormat::BGR_565 || | 44 return format == gfx::BufferFormat::BGR_565 || |
45 format == gfx::BufferFormat::RGBA_8888 || | 45 format == gfx::BufferFormat::RGBA_8888 || |
46 format == gfx::BufferFormat::RGBX_8888 || | 46 format == gfx::BufferFormat::RGBX_8888 || |
47 format == gfx::BufferFormat::BGRA_8888 || | 47 format == gfx::BufferFormat::BGRA_8888 || |
48 format == gfx::BufferFormat::BGRX_8888 || | 48 format == gfx::BufferFormat::BGRX_8888 || |
49 format == gfx::BufferFormat::YVU_420; | 49 format == gfx::BufferFormat::YVU_420; |
50 case gfx::BufferUsage::SCANOUT: | 50 case gfx::BufferUsage::SCANOUT: |
51 return format == gfx::BufferFormat::BGRX_8888; | 51 return format == gfx::BufferFormat::BGRX_8888 || |
| 52 format == gfx::BufferFormat::RGBX_8888; |
52 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 53 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
53 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { | 54 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { |
54 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
55 return | 56 return |
56 #if defined(ARCH_CPU_X86_FAMILY) | 57 #if defined(ARCH_CPU_X86_FAMILY) |
57 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8. | 58 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8. |
58 // crbug.com/356871 | 59 // crbug.com/356871 |
59 format == gfx::BufferFormat::R_8 || | 60 format == gfx::BufferFormat::R_8 || |
60 #endif | 61 #endif |
61 format == gfx::BufferFormat::BGRA_8888; | 62 format == gfx::BufferFormat::BGRA_8888; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 95 } |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 97 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
97 }; | 98 }; |
98 | 99 |
99 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 100 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
100 return new ClientNativePixmapFactoryGbm(); | 101 return new ClientNativePixmapFactoryGbm(); |
101 } | 102 } |
102 | 103 |
103 } // namespace ui | 104 } // namespace ui |
OLD | NEW |