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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |