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 "base/memory/ptr_util.h" |
8 #include "ui/gfx/buffer_types.h" | 9 #include "ui/gfx/buffer_types.h" |
9 #include "ui/ozone/public/client_native_pixmap.h" | 10 #include "ui/ozone/public/client_native_pixmap.h" |
10 #include "ui/ozone/public/client_native_pixmap_factory.h" | 11 #include "ui/ozone/public/client_native_pixmap_factory.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 namespace { | 14 namespace { |
14 | 15 |
15 // Dummy ClientNativePixmap implementation for Cast ozone. | 16 // Dummy ClientNativePixmap implementation for Cast ozone. |
16 // Our NativePixmaps are just used to plumb an overlay frame through, | 17 // Our NativePixmaps are just used to plumb an overlay frame through, |
17 // so they get instantiated, but not used. | 18 // so they get instantiated, but not used. |
(...skipping 10 matching lines...) Expand all Loading... |
28 | 29 |
29 class ClientNativePixmapFactoryCast : public ClientNativePixmapFactory { | 30 class ClientNativePixmapFactoryCast : public ClientNativePixmapFactory { |
30 public: | 31 public: |
31 // ClientNativePixmapFactoryCast implementation: | 32 // ClientNativePixmapFactoryCast implementation: |
32 bool IsConfigurationSupported(gfx::BufferFormat format, | 33 bool IsConfigurationSupported(gfx::BufferFormat format, |
33 gfx::BufferUsage usage) const override { | 34 gfx::BufferUsage usage) const override { |
34 return format == gfx::BufferFormat::RGBA_8888 && | 35 return format == gfx::BufferFormat::RGBA_8888 && |
35 usage == gfx::BufferUsage::SCANOUT; | 36 usage == gfx::BufferUsage::SCANOUT; |
36 } | 37 } |
37 | 38 |
38 scoped_ptr<ClientNativePixmap> ImportFromHandle( | 39 std::unique_ptr<ClientNativePixmap> ImportFromHandle( |
39 const gfx::NativePixmapHandle& handle, | 40 const gfx::NativePixmapHandle& handle, |
40 const gfx::Size& size, | 41 const gfx::Size& size, |
41 gfx::BufferUsage usage) override { | 42 gfx::BufferUsage usage) override { |
42 return make_scoped_ptr(new ClientNativePixmapCast()); | 43 return base::WrapUnique(new ClientNativePixmapCast()); |
43 } | 44 } |
44 }; | 45 }; |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
48 ClientNativePixmapFactory* CreateClientNativePixmapFactoryCast() { | 49 ClientNativePixmapFactory* CreateClientNativePixmapFactoryCast() { |
49 return new ClientNativePixmapFactoryCast(); | 50 return new ClientNativePixmapFactoryCast(); |
50 } | 51 } |
51 | 52 |
52 } // namespace ui | 53 } // namespace ui |
OLD | NEW |