Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/memory/scoped_ptr.h" | |
| 6 #include "chromecast/public/graphics_types.h" | |
| 7 #include "chromecast/public/osd_plane.h" | |
| 8 #include "chromecast/public/osd_plane_shlib.h" | |
| 9 #include "chromecast/public/osd_surface.h" | |
| 10 | |
| 11 namespace chromecast { | |
| 12 namespace { | |
| 13 | |
| 14 // Default no-op OsdSurface implementation | |
| 15 class OsdSurfaceDefault : public OsdSurface { | |
| 16 public: | |
| 17 OsdSurfaceDefault(const Size& size) : size_(size) {} | |
| 18 | |
| 19 // OsdSurface implementation: | |
| 20 void Blit(OsdSurface* src_surface, | |
| 21 const Rect& src_rect, | |
| 22 const Point& dst_point) override {} | |
| 23 void Composite(OsdSurface* src_surface, | |
| 24 const Rect& src_rect, | |
| 25 const Point& dst_point) override {} | |
| 26 void CopyBitmap(char* src_bitmap, | |
| 27 const Rect& src_rect, | |
| 28 const Rect& damage_rect, | |
| 29 const Point& dst_point) override {} | |
| 30 void Fill(const Rect& rect, int argb) override {} | |
| 31 | |
| 32 const Size& size() const override { return size_; } | |
| 33 | |
| 34 private: | |
| 35 Size size_; | |
|
byungchul
2015/04/27 21:42:14
const
halliwell
2015/04/27 22:17:33
Done.
| |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(OsdSurfaceDefault); | |
| 38 }; | |
| 39 | |
| 40 // Default no-op OsdPlane implementation | |
| 41 class OsdPlaneDefault : public OsdPlane { | |
| 42 public: | |
| 43 OsdPlaneDefault() : size_(0, 0) {} | |
| 44 | |
| 45 // OsdPlane implementation: | |
| 46 OsdSurface* CreateSurface(const Size& size) override { | |
| 47 return new OsdSurfaceDefault(size); | |
| 48 } | |
| 49 void SetClipRectangle(const Rect& rect) override { | |
| 50 size_ = Size(rect.width, rect.height); | |
| 51 } | |
| 52 OsdSurface* GetBackBuffer() override { | |
| 53 if (!back_buffer_) | |
| 54 back_buffer_.reset(new OsdSurfaceDefault(size_)); | |
| 55 return back_buffer_.get(); | |
| 56 } | |
| 57 | |
| 58 void Flip() override {} | |
| 59 | |
| 60 private: | |
| 61 scoped_ptr<OsdSurface> back_buffer_; | |
| 62 Size size_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault); | |
| 65 }; | |
| 66 | |
| 67 } // namespace | |
| 68 | |
| 69 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { | |
| 70 return new OsdPlaneDefault; | |
| 71 } | |
| 72 | |
| 73 } // namespace chromecast | |
| OLD | NEW |