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/osd_plane.h" | |
7 #include "chromecast/public/osd_plane_shlib.h" | |
8 #include "chromecast/public/osd_surface.h" | |
9 #include "chromecast/public/rect.h" | |
10 #include "chromecast/public/size.h" | |
11 | |
12 namespace chromecast { | |
13 namespace { | |
14 | |
15 // Default no-op OsdSurface implementation | |
16 class OsdSurfaceDefault : public OsdSurface { | |
17 public: | |
18 OsdSurfaceDefault(const Size& size) : size_(size) {} | |
19 | |
20 void Blit(OsdSurface* src_surface, | |
byungchul
2015/04/27 16:55:03
// OsdSurface implementation:
halliwell
2015/04/27 21:30:42
Done.
| |
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_; | |
gunsch
2015/04/27 16:40:27
nit: DISALLOW_COPY_AND_ASSIGN
halliwell
2015/04/27 21:30:42
Done.
| |
36 }; | |
37 | |
38 // Default no-op OsdPlane implementation | |
39 class OsdPlaneDefault : public OsdPlane { | |
40 public: | |
41 OsdPlaneDefault() : size_(0, 0) {} | |
42 | |
43 OsdSurface* CreateSurface(const Size& size) override { | |
byungchul
2015/04/27 16:55:03
// OsdPlane implementation:
halliwell
2015/04/27 21:30:42
Done.
| |
44 return new OsdSurfaceDefault(size); | |
45 } | |
46 void SetClipRectangle(const Rect& rect) override { | |
47 size_ = Size(rect.width, rect.height); | |
48 } | |
49 OsdSurface* GetBackBuffer() override { | |
50 if (!back_buffer_) { | |
51 back_buffer_.reset(new OsdSurfaceDefault(size_)); | |
52 } | |
byungchul
2015/04/27 16:55:03
remove {}
halliwell
2015/04/27 21:30:42
Done.
| |
53 return back_buffer_.get(); | |
54 } | |
55 | |
56 void Flip() override {} | |
57 | |
58 private: | |
59 scoped_ptr<OsdSurface> back_buffer_; | |
60 Size size_; | |
byungchul
2015/04/27 16:55:03
DISALLOW_...
halliwell
2015/04/27 21:30:41
Done.
| |
61 }; | |
62 | |
63 } // namespace | |
64 | |
65 OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) { | |
66 return new OsdPlaneDefault; | |
67 } | |
68 | |
69 } // namespace chromecast | |
OLD | NEW |