OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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 #ifndef CHROMECAST_PUBLIC_OSD_SURFACE_H_ | |
6 #define CHROMECAST_PUBLIC_OSD_SURFACE_H_ | |
7 | |
8 namespace chromecast { | |
9 | |
10 struct Rect; | |
11 struct Size; | |
12 | |
13 // Provides simple API (copy bitmap, blit, composite and fill) for drawing | |
14 // OSD graphics on OsdPlane. Hardware-specific implementation should be | |
15 // instantiated by OsdPlane. | |
16 class OsdSurface { | |
17 public: | |
18 struct Point { | |
19 Point(int arg_x, int arg_y) : x(arg_x), y(arg_y) {} | |
byungchul
2015/04/27 21:42:14
a blank line
halliwell
2015/04/27 22:17:33
Done.
| |
20 const int x; | |
21 const int y; | |
22 }; | |
23 | |
24 virtual ~OsdSurface() {} | |
25 | |
26 // Blits(fast copy) bitmap from a surface. Copies |src_rect| area of surface | |
27 // |dst_point| of this surface. | |
28 virtual void Blit(OsdSurface* src_surface, | |
29 const Rect& src_rect, | |
30 const Point& dst_point) = 0; | |
31 | |
32 // Composites ARGB values of |src_surface| on top of this surface. It is NOT | |
33 // copy. Used when displaying OSD images on same plane. | |
34 virtual void Composite(OsdSurface* src_surface, | |
35 const Rect& src_rect, | |
36 const Point& dst_point) = 0; | |
37 | |
38 // Copies |damage_rect| area of src bitmap into |dst_point| of this surface. | |
39 // It is similar to Blit() except that it accepts arbitrary bitmap pointer | |
40 // instead of surface. | |
41 virtual void CopyBitmap(char* src_bitmap, | |
42 const Rect& src_rect, | |
43 const Rect& damage_rect, | |
44 const Point& dst_point) = 0; | |
45 | |
46 // Fills |rect| area of surface with |argb| value. | |
47 virtual void Fill(const Rect& rect, int argb) = 0; | |
48 | |
49 // Returns the dimensions of the surface. | |
50 virtual const Size& size() const = 0; | |
51 }; | |
52 | |
53 } // namespace chromecast | |
54 | |
55 #endif // CHROMECAST_PUBLIC_OSD_SURFACE_H_ | |
OLD | NEW |