| 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/cast/client_native_pixmap_factory_cast.h" | 5 #include "ui/ozone/platform/cast/client_native_pixmap_factory_cast.h" | 
| 6 | 6 | 
| 7 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 8 #include "ui/gfx/buffer_types.h" | 8 #include "ui/gfx/buffer_types.h" | 
| 9 #include "ui/ozone/public/client_native_pixmap.h" | 9 #include "ui/ozone/public/client_native_pixmap.h" | 
| 10 #include "ui/ozone/public/client_native_pixmap_factory.h" | 10 #include "ui/ozone/public/client_native_pixmap_factory.h" | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 22     NOTREACHED(); | 22     NOTREACHED(); | 
| 23     return nullptr; | 23     return nullptr; | 
| 24   } | 24   } | 
| 25   void Unmap() override { NOTREACHED(); } | 25   void Unmap() override { NOTREACHED(); } | 
| 26   void GetStride(int* stride) const override { NOTREACHED(); } | 26   void GetStride(int* stride) const override { NOTREACHED(); } | 
| 27 }; | 27 }; | 
| 28 | 28 | 
| 29 class ClientNativePixmapFactoryCast : public ClientNativePixmapFactory { | 29 class ClientNativePixmapFactoryCast : public ClientNativePixmapFactory { | 
| 30  public: | 30  public: | 
| 31   // ClientNativePixmapFactoryCast implementation: | 31   // ClientNativePixmapFactoryCast implementation: | 
| 32   void Initialize(base::ScopedFD device_fd) override {} |  | 
| 33 |  | 
| 34   bool IsConfigurationSupported(gfx::BufferFormat format, | 32   bool IsConfigurationSupported(gfx::BufferFormat format, | 
| 35                                 gfx::BufferUsage usage) const override { | 33                                 gfx::BufferUsage usage) const override { | 
| 36     return format == gfx::BufferFormat::RGBA_8888 && | 34     return format == gfx::BufferFormat::RGBA_8888 && | 
| 37            usage == gfx::BufferUsage::SCANOUT; | 35            usage == gfx::BufferUsage::SCANOUT; | 
| 38   } | 36   } | 
| 39 | 37 | 
| 40   scoped_ptr<ClientNativePixmap> ImportFromHandle( | 38   scoped_ptr<ClientNativePixmap> ImportFromHandle( | 
| 41       const gfx::NativePixmapHandle& handle, | 39       const gfx::NativePixmapHandle& handle, | 
| 42       const gfx::Size& size, | 40       const gfx::Size& size, | 
| 43       gfx::BufferUsage usage) override { | 41       gfx::BufferUsage usage) override { | 
| 44     return make_scoped_ptr(new ClientNativePixmapCast()); | 42     return make_scoped_ptr(new ClientNativePixmapCast()); | 
| 45   } | 43   } | 
| 46 }; | 44 }; | 
| 47 | 45 | 
| 48 }  // namespace | 46 }  // namespace | 
| 49 | 47 | 
| 50 ClientNativePixmapFactory* CreateClientNativePixmapFactoryCast() { | 48 ClientNativePixmapFactory* CreateClientNativePixmapFactoryCast() { | 
| 51   return new ClientNativePixmapFactoryCast(); | 49   return new ClientNativePixmapFactoryCast(); | 
| 52 } | 50 } | 
| 53 | 51 | 
| 54 }  // namespace ui | 52 }  // namespace ui | 
| OLD | NEW | 
|---|