Add ICU message format support
[chromium-blink-merge.git] / chromecast / public / osd_plane.h
blobd689cba5440afa206d594137d66bc24361ee4b34
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.
5 #ifndef CHROMECAST_PUBLIC_OSD_PLANE_H_
6 #define CHROMECAST_PUBLIC_OSD_PLANE_H_
8 namespace chromecast {
10 class OsdSurface;
11 struct Rect;
12 struct Size;
14 // Abstract graphics plane for OSD, to be implemented in platform-specific way.
15 // Platform must composite this plane on top of main (GL-based) graphics plane.
16 class OsdPlane {
17 public:
18 virtual ~OsdPlane() {}
20 // Creates a surface for offscreen drawing.
21 virtual OsdSurface* CreateSurface(const Size& size) = 0;
23 // Sets a clip rectangle, client should call before drawing to back buffer
24 // to specify the area they intend to draw on. Platforms may reduce memory
25 // usage by only allocating back buffer to cover this area. Areas outside
26 // clip rectangle must display as fully transparent. In particular, setting
27 // an empty clip rectangle and calling Flip should clear the plane.
28 virtual void SetClipRectangle(const Rect& rect) = 0;
30 // Gets the current back buffer surface. Valid until next call to Flip or
31 // SetClipRectangle.
32 virtual OsdSurface* GetBackBuffer() = 0;
34 // Presents current back buffer to screen.
35 virtual void Flip() = 0;
38 } // namespace chromecast
40 #endif // CHROMECAST_PUBLIC_OSD_PLANE_H