| 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 "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 "ui/gfx/native_pixmap_handle_ozone.h" | 10 #include "ui/gfx/native_pixmap_handle_ozone.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 scoped_ptr<ClientNativePixmap> ImportFromHandle( | 56 scoped_ptr<ClientNativePixmap> ImportFromHandle( |
| 57 const gfx::NativePixmapHandle& handle, | 57 const gfx::NativePixmapHandle& handle, |
| 58 const gfx::Size& size, | 58 const gfx::Size& size, |
| 59 gfx::BufferUsage usage) override { | 59 gfx::BufferUsage usage) override { |
| 60 base::ScopedFD scoped_fd(handle.fd.fd); | 60 base::ScopedFD scoped_fd(handle.fd.fd); |
| 61 | 61 |
| 62 switch (usage) { | 62 switch (usage) { |
| 63 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 63 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
| 64 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: | 64 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: |
| 65 return ClientNativePixmapDmaBuf::ImportFromDmabuf( | 65 return ClientNativePixmapDmaBuf::ImportFromDmabuf( |
| 66 scoped_fd.get(), size, handle.stride); | 66 scoped_fd.release(), size, handle.stride); |
| 67 case gfx::BufferUsage::GPU_READ: | 67 case gfx::BufferUsage::GPU_READ: |
| 68 case gfx::BufferUsage::SCANOUT: | 68 case gfx::BufferUsage::SCANOUT: |
| 69 return make_scoped_ptr<ClientNativePixmapGbm>( | 69 return make_scoped_ptr<ClientNativePixmapGbm>( |
| 70 new ClientNativePixmapGbm); | 70 new ClientNativePixmapGbm); |
| 71 } | 71 } |
| 72 NOTREACHED(); | 72 NOTREACHED(); |
| 73 return nullptr; | 73 return nullptr; |
| 74 } | 74 } |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 76 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 79 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
| 80 return new ClientNativePixmapFactoryGbm(); | 80 return new ClientNativePixmapFactoryGbm(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace ui | 83 } // namespace ui |
| OLD | NEW |