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

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

Issue 2039813002: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension Created 4 years, 5 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
« no previous file with comments | « ui/ozone/platform/cast/surface_factory_cast.cc ('k') | ui/ozone/platform/drm/gpu/drm_thread.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 <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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 gfx::BufferUsage usage) override { 73 gfx::BufferUsage usage) override {
74 DCHECK(!handle.fds.empty()); 74 DCHECK(!handle.fds.empty());
75 base::ScopedFD scoped_fd(handle.fds[0].fd); 75 base::ScopedFD scoped_fd(handle.fds[0].fd);
76 switch (usage) { 76 switch (usage) {
77 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 77 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
78 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 78 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
79 #if defined(OS_CHROMEOS) 79 #if defined(OS_CHROMEOS)
80 // TODO(dcastagna): Add support for pixmaps with multiple FDs for non 80 // TODO(dcastagna): Add support for pixmaps with multiple FDs for non
81 // scanout buffers. 81 // scanout buffers.
82 return ClientNativePixmapDmaBuf::ImportFromDmabuf( 82 return ClientNativePixmapDmaBuf::ImportFromDmabuf(
83 scoped_fd.release(), size, handle.strides_and_offsets[0].first); 83 scoped_fd.release(), size, handle.planes[0].stride);
84 #else 84 #else
85 NOTREACHED(); 85 NOTREACHED();
86 return nullptr; 86 return nullptr;
87 #endif 87 #endif
88 case gfx::BufferUsage::GPU_READ: 88 case gfx::BufferUsage::GPU_READ:
89 case gfx::BufferUsage::SCANOUT: 89 case gfx::BufferUsage::SCANOUT:
90 return base::WrapUnique(new ClientNativePixmapGbm); 90 return base::WrapUnique(new ClientNativePixmapGbm);
91 } 91 }
92 NOTREACHED(); 92 NOTREACHED();
93 return nullptr; 93 return nullptr;
94 } 94 }
95 95
96 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); 96 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm);
97 }; 97 };
98 98
99 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { 99 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() {
100 return new ClientNativePixmapFactoryGbm(); 100 return new ClientNativePixmapFactoryGbm();
101 } 101 }
102 102
103 } // namespace ui 103 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/cast/surface_factory_cast.cc ('k') | ui/ozone/platform/drm/gpu/drm_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698