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

Side by Side Diff: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc

Issue 2648633005: cros: Support YUYV format for GPU memory buffer video frames
Patch Set: Created 3 years, 11 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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // ClientNativePixmapFactory: 46 // ClientNativePixmapFactory:
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 return format == gfx::BufferFormat::BGR_565 || 51 return format == gfx::BufferFormat::BGR_565 ||
52 format == gfx::BufferFormat::RGBA_8888 || 52 format == gfx::BufferFormat::RGBA_8888 ||
53 format == gfx::BufferFormat::RGBX_8888 || 53 format == gfx::BufferFormat::RGBX_8888 ||
54 format == gfx::BufferFormat::BGRA_8888 || 54 format == gfx::BufferFormat::BGRA_8888 ||
55 format == gfx::BufferFormat::BGRX_8888 || 55 format == gfx::BufferFormat::BGRX_8888 ||
56 format == gfx::BufferFormat::YVU_420; 56 format == gfx::BufferFormat::YVU_420 ||
57 format == gfx::BufferFormat::YUYV_422;
57 case gfx::BufferUsage::SCANOUT: 58 case gfx::BufferUsage::SCANOUT:
58 return format == gfx::BufferFormat::BGRX_8888 || 59 return format == gfx::BufferFormat::BGRX_8888 ||
59 format == gfx::BufferFormat::RGBX_8888; 60 format == gfx::BufferFormat::RGBX_8888 ||
61 format == gfx::BufferFormat::YUYV_422;
60 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 62 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
61 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { 63 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: {
62 #if defined(OS_CHROMEOS) 64 #if defined(OS_CHROMEOS)
63 return 65 return
64 #if defined(ARCH_CPU_X86_FAMILY) 66 #if defined(ARCH_CPU_X86_FAMILY)
65 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8 67 // Currently only Intel driver (i.e. minigbm and Mesa) supports R_8
66 // and RG_88. crbug.com/356871 68 // and RG_88. crbug.com/356871
67 format == gfx::BufferFormat::R_8 || 69 format == gfx::BufferFormat::R_8 ||
68 format == gfx::BufferFormat::RG_88 || 70 format == gfx::BufferFormat::RG_88 ||
71 format == gfx::BufferFormat::YUYV_422 ||
69 #endif 72 #endif
70 format == gfx::BufferFormat::BGRA_8888; 73 format == gfx::BufferFormat::BGRA_8888;
71 #else 74 #else
72 return false; 75 return false;
73 #endif 76 #endif
74 } 77 }
75 } 78 }
76 NOTREACHED(); 79 NOTREACHED();
77 return false; 80 return false;
78 } 81 }
(...skipping 23 matching lines...) Expand all
102 } 105 }
103 106
104 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); 107 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm);
105 }; 108 };
106 109
107 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { 110 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() {
108 return new ClientNativePixmapFactoryGbm(); 111 return new ClientNativePixmapFactoryGbm();
109 } 112 }
110 113
111 } // namespace ui 114 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698