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

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

Issue 1483633002: ozone: support gfx::BufferFormat::RGBX_8888 as a native pixmap format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gl_image_ozone_native_pixmap also, which gl_unittests check Created 5 years 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
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.cc ('k') | ui/ozone/platform/drm/common/drm_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.cc ('k') | ui/ozone/platform/drm/common/drm_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698