| 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 "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" // nogncheck | 8 #include "ui/ozone/public/client_native_pixmap_factory.h" // nogncheck |
| 9 | 9 |
| 10 #if defined(USE_VGEM_MAP) | 10 #if defined(USE_VGEM_MAP) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 ClientNativePixmapFactoryGbm() {} | 35 ClientNativePixmapFactoryGbm() {} |
| 36 ~ClientNativePixmapFactoryGbm() override {} | 36 ~ClientNativePixmapFactoryGbm() override {} |
| 37 | 37 |
| 38 // ClientNativePixmapFactory: | 38 // ClientNativePixmapFactory: |
| 39 void Initialize(base::ScopedFD device_fd) override { | 39 void Initialize(base::ScopedFD device_fd) override { |
| 40 #if defined(USE_VGEM_MAP) | 40 #if defined(USE_VGEM_MAP) |
| 41 // It's called in IO thread. We rely on clients for thread-safety. | 41 // It's called in IO thread. We rely on clients for thread-safety. |
| 42 // Switching to an IPC message filter ensures thread-safety. | 42 // Switching to an IPC message filter ensures thread-safety. |
| 43 DCHECK_LT(vgem_fd_.get(), 0); | 43 DCHECK_LT(vgem_fd_.get(), 0); |
| 44 vgem_fd_ = device_fd.Pass(); | 44 vgem_fd_ = std::move(device_fd); |
| 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::BGRA_8888 || | 53 format == gfx::BufferFormat::BGRA_8888 || |
| 54 format == gfx::BufferFormat::BGRX_8888; | 54 format == gfx::BufferFormat::BGRX_8888; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 99 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 102 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
| 103 return new ClientNativePixmapFactoryGbm(); | 103 return new ClientNativePixmapFactoryGbm(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace ui | 106 } // namespace ui |
| OLD | NEW |