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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 switch (usage) { | 42 switch (usage) { |
43 case gfx::BufferUsage::GPU_READ: | 43 case gfx::BufferUsage::GPU_READ: |
44 case gfx::BufferUsage::SCANOUT: | 44 case gfx::BufferUsage::SCANOUT: |
45 return format == gfx::BufferFormat::RGBA_8888 || | 45 return 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 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 49 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
50 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { | 50 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { |
51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
52 return format == gfx::BufferFormat::BGRA_8888; | 52 return |
53 #if defined(ARCH_CPU_X86_FAMILY) | |
reveman
2016/05/05 09:29:24
what does it take to not have this ifdef? ie. what
dshwang
2016/05/05 12:22:13
gbm bo creation fails on ARM device.
ARM has to s
| |
54 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8. | |
55 // crbug.com/356871 | |
56 format == gfx::BufferFormat::R_8 || | |
57 #endif | |
58 format == gfx::BufferFormat::BGRA_8888; | |
53 #else | 59 #else |
54 return false; | 60 return false; |
55 #endif | 61 #endif |
56 } | 62 } |
57 } | 63 } |
58 NOTREACHED(); | 64 NOTREACHED(); |
59 return false; | 65 return false; |
60 } | 66 } |
61 std::unique_ptr<ClientNativePixmap> ImportFromHandle( | 67 std::unique_ptr<ClientNativePixmap> ImportFromHandle( |
62 const gfx::NativePixmapHandle& handle, | 68 const gfx::NativePixmapHandle& handle, |
(...skipping 21 matching lines...) Expand all Loading... | |
84 } | 90 } |
85 | 91 |
86 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 92 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
87 }; | 93 }; |
88 | 94 |
89 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 95 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
90 return new ClientNativePixmapFactoryGbm(); | 96 return new ClientNativePixmapFactoryGbm(); |
91 } | 97 } |
92 | 98 |
93 } // namespace ui | 99 } // namespace ui |
OLD | NEW |