| 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> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chromecast/public/graphics_types.h" | 8 #include "chromecast/public/graphics_types.h" |
| 9 #include "chromecast/public/osd_plane.h" | 9 #include "chromecast/public/osd_plane.h" |
| 10 #include "chromecast/public/osd_plane_shlib.h" | 10 #include "chromecast/public/osd_plane_shlib.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Default no-op OsdPlane implementation | 42 // Default no-op OsdPlane implementation |
| 43 class OsdPlaneDefault : public OsdPlane { | 43 class OsdPlaneDefault : public OsdPlane { |
| 44 public: | 44 public: |
| 45 OsdPlaneDefault() : size_(0, 0) {} | 45 OsdPlaneDefault() : size_(0, 0) {} |
| 46 | 46 |
| 47 // OsdPlane implementation: | 47 // OsdPlane implementation: |
| 48 OsdSurface* CreateSurface(const Size& size) override { | 48 OsdSurface* CreateSurface(const Size& size) override { |
| 49 return new OsdSurfaceDefault(size); | 49 return new OsdSurfaceDefault(size); |
| 50 } | 50 } |
| 51 void SetClipRectangle(const Rect& rect) override { | 51 void SetClipRectangle(const Rect& rect, |
| 52 const Size& screen_res, |
| 53 float output_scale) override { |
| 52 size_ = Size(rect.width, rect.height); | 54 size_ = Size(rect.width, rect.height); |
| 53 } | 55 } |
| 54 OsdSurface* GetBackBuffer() override { | 56 OsdSurface* GetBackBuffer() override { |
| 55 if (!back_buffer_) | 57 if (!back_buffer_) |
| 56 back_buffer_.reset(new OsdSurfaceDefault(size_)); | 58 back_buffer_.reset(new OsdSurfaceDefault(size_)); |
| 57 return back_buffer_.get(); | 59 return back_buffer_.get(); |
| 58 } | 60 } |
| 59 | 61 |
| 60 void Flip() override {} | 62 void Flip() override {} |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 std::unique_ptr<OsdSurface> back_buffer_; | 65 std::unique_ptr<OsdSurface> back_buffer_; |
| 64 Size size_; | 66 Size size_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault); | 68 DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace | 71 } // namespace |
| 70 | 72 |
| 71 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { | 73 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { |
| 72 return new OsdPlaneDefault; | 74 return new OsdPlaneDefault; |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace chromecast | 77 } // namespace chromecast |
| OLD | NEW |