| 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 30 matching lines...) Expand all Loading... |
| 41 switch (usage) { | 41 switch (usage) { |
| 42 case gfx::BufferUsage::GPU_READ: | 42 case gfx::BufferUsage::GPU_READ: |
| 43 case gfx::BufferUsage::SCANOUT: | 43 case gfx::BufferUsage::SCANOUT: |
| 44 return format == gfx::BufferFormat::RGBA_8888 || | 44 return format == gfx::BufferFormat::RGBA_8888 || |
| 45 format == gfx::BufferFormat::RGBX_8888 || | 45 format == gfx::BufferFormat::RGBX_8888 || |
| 46 format == gfx::BufferFormat::BGRA_8888 || | 46 format == gfx::BufferFormat::BGRA_8888 || |
| 47 format == gfx::BufferFormat::BGRX_8888; | 47 format == gfx::BufferFormat::BGRX_8888; |
| 48 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: | 48 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: |
| 49 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { | 49 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: { |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
| 51 return format == gfx::BufferFormat::BGRA_8888; | 51 return format == gfx::BufferFormat::R_8 || |
| 52 format == gfx::BufferFormat::BGRA_8888; |
| 52 #else | 53 #else |
| 53 return false; | 54 return false; |
| 54 #endif | 55 #endif |
| 55 } | 56 } |
| 56 } | 57 } |
| 57 NOTREACHED(); | 58 NOTREACHED(); |
| 58 return false; | 59 return false; |
| 59 } | 60 } |
| 60 scoped_ptr<ClientNativePixmap> ImportFromHandle( | 61 scoped_ptr<ClientNativePixmap> ImportFromHandle( |
| 61 const gfx::NativePixmapHandle& handle, | 62 const gfx::NativePixmapHandle& handle, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 83 } | 84 } |
| 84 | 85 |
| 85 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); | 86 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { | 89 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { |
| 89 return new ClientNativePixmapFactoryGbm(); | 90 return new ClientNativePixmapFactoryGbm(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace ui | 93 } // namespace ui |
| OLD | NEW |