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

Side by Side Diff: components/exo/display.cc

Issue 1745943003: exo: Add support for linux_dmabuf interface to wayland bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-protocols-linux-dmabuf
Patch Set: Prime -> LinuxDMABuf Created 4 years, 9 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 | « components/exo/display.h ('k') | components/exo/display_unittest.cc » ('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 "components/exo/display.h" 5 #include "components/exo/display.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 size_t size) { 42 size_t size) {
43 TRACE_EVENT1("exo", "Display::CreateSharedMemory", "size", size); 43 TRACE_EVENT1("exo", "Display::CreateSharedMemory", "size", size);
44 44
45 if (!base::SharedMemory::IsHandleValid(handle)) 45 if (!base::SharedMemory::IsHandleValid(handle))
46 return nullptr; 46 return nullptr;
47 47
48 return make_scoped_ptr(new SharedMemory(handle)); 48 return make_scoped_ptr(new SharedMemory(handle));
49 } 49 }
50 50
51 #if defined(USE_OZONE) 51 #if defined(USE_OZONE)
52 scoped_ptr<Buffer> Display::CreatePrimeBuffer(base::ScopedFD fd, 52 scoped_ptr<Buffer> Display::CreateLinuxDMABufBuffer(base::ScopedFD fd,
53 const gfx::Size& size, 53 const gfx::Size& size,
54 gfx::BufferFormat format, 54 gfx::BufferFormat format,
55 int stride) { 55 int stride) {
56 TRACE_EVENT1("exo", "Display::CreatePrimeBuffer", "size", size.ToString()); 56 TRACE_EVENT1("exo", "Display::CreateLinuxDMABufBuffer", "size",
57 size.ToString());
57 58
58 gfx::GpuMemoryBufferHandle handle; 59 gfx::GpuMemoryBufferHandle handle;
59 handle.type = gfx::OZONE_NATIVE_PIXMAP; 60 handle.type = gfx::OZONE_NATIVE_PIXMAP;
60 handle.native_pixmap_handle.fd = base::FileDescriptor(std::move(fd)); 61 handle.native_pixmap_handle.fd = base::FileDescriptor(std::move(fd));
61 handle.native_pixmap_handle.stride = stride; 62 handle.native_pixmap_handle.stride = stride;
62 63
63 scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer = 64 scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
64 aura::Env::GetInstance() 65 aura::Env::GetInstance()
65 ->context_factory() 66 ->context_factory()
66 ->GetGpuMemoryBufferManager() 67 ->GetGpuMemoryBufferManager()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 if (surface->HasSurfaceDelegate()) { 106 if (surface->HasSurfaceDelegate()) {
106 DLOG(ERROR) << "Surface has already been assigned a role"; 107 DLOG(ERROR) << "Surface has already been assigned a role";
107 return nullptr; 108 return nullptr;
108 } 109 }
109 110
110 return make_scoped_ptr(new SubSurface(surface, parent)); 111 return make_scoped_ptr(new SubSurface(surface, parent));
111 } 112 }
112 113
113 } // namespace exo 114 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/display.h ('k') | components/exo/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698