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_PLANE_H_ |
| 6 #define CHROMECAST_PUBLIC_OSD_PLANE_H_ |
| 7 |
| 8 namespace chromecast { |
| 9 |
| 10 class OsdSurface; |
| 11 struct Rect; |
| 12 struct Size; |
| 13 |
| 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() {} |
| 19 |
| 20 // Creates a surface for offscreen drawing. |
| 21 virtual OsdSurface* CreateSurface(const Size& size) = 0; |
| 22 |
| 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; |
| 29 |
| 30 // Gets the current back buffer surface. Valid until next call to Flip or |
| 31 // SetClipRectangle. |
| 32 virtual OsdSurface* GetBackBuffer() = 0; |
| 33 |
| 34 // Presents current back buffer to screen. |
| 35 virtual void Flip() = 0; |
| 36 }; |
| 37 |
| 38 } // namespace chromecast |
| 39 |
| 40 #endif // CHROMECAST_PUBLIC_OSD_PLANE_H |
OLD | NEW |