| 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 <memory> |
| 6 |
| 5 #include "base/macros.h" | 7 #include "base/macros.h" |
| 6 #include "base/memory/scoped_ptr.h" | |
| 7 #include "chromecast/public/graphics_types.h" | 8 #include "chromecast/public/graphics_types.h" |
| 8 #include "chromecast/public/osd_plane.h" | 9 #include "chromecast/public/osd_plane.h" |
| 9 #include "chromecast/public/osd_plane_shlib.h" | 10 #include "chromecast/public/osd_plane_shlib.h" |
| 10 #include "chromecast/public/osd_surface.h" | 11 #include "chromecast/public/osd_surface.h" |
| 11 | 12 |
| 12 namespace chromecast { | 13 namespace chromecast { |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 // Default no-op OsdSurface implementation | 16 // Default no-op OsdSurface implementation |
| 16 class OsdSurfaceDefault : public OsdSurface { | 17 class OsdSurfaceDefault : public OsdSurface { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 53 } |
| 53 OsdSurface* GetBackBuffer() override { | 54 OsdSurface* GetBackBuffer() override { |
| 54 if (!back_buffer_) | 55 if (!back_buffer_) |
| 55 back_buffer_.reset(new OsdSurfaceDefault(size_)); | 56 back_buffer_.reset(new OsdSurfaceDefault(size_)); |
| 56 return back_buffer_.get(); | 57 return back_buffer_.get(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 void Flip() override {} | 60 void Flip() override {} |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 scoped_ptr<OsdSurface> back_buffer_; | 63 std::unique_ptr<OsdSurface> back_buffer_; |
| 63 Size size_; | 64 Size size_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault); | 66 DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace | 69 } // namespace |
| 69 | 70 |
| 70 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { | 71 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { |
| 71 return new OsdPlaneDefault; | 72 return new OsdPlaneDefault; |
| 72 } | 73 } |
| 73 | 74 |
| 74 } // namespace chromecast | 75 } // namespace chromecast |
| OLD | NEW |