Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: chromecast/public/osd_plane.h

Issue 1104853002: Adds public API and loads Cast OSD plane implementation from shared lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some nits Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/public/graphics_types.h ('k') | chromecast/public/osd_plane_shlib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/public/osd_plane.h
diff --git a/chromecast/public/osd_plane.h b/chromecast/public/osd_plane.h
new file mode 100644
index 0000000000000000000000000000000000000000..d689cba5440afa206d594137d66bc24361ee4b34
--- /dev/null
+++ b/chromecast/public/osd_plane.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_PUBLIC_OSD_PLANE_H_
+#define CHROMECAST_PUBLIC_OSD_PLANE_H_
+
+namespace chromecast {
+
+class OsdSurface;
+struct Rect;
+struct Size;
+
+// Abstract graphics plane for OSD, to be implemented in platform-specific way.
+// Platform must composite this plane on top of main (GL-based) graphics plane.
+class OsdPlane {
+ public:
+ virtual ~OsdPlane() {}
+
+ // Creates a surface for offscreen drawing.
+ virtual OsdSurface* CreateSurface(const Size& size) = 0;
+
+ // Sets a clip rectangle, client should call before drawing to back buffer
+ // to specify the area they intend to draw on. Platforms may reduce memory
+ // usage by only allocating back buffer to cover this area. Areas outside
+ // clip rectangle must display as fully transparent. In particular, setting
+ // an empty clip rectangle and calling Flip should clear the plane.
+ virtual void SetClipRectangle(const Rect& rect) = 0;
+
+ // Gets the current back buffer surface. Valid until next call to Flip or
+ // SetClipRectangle.
+ virtual OsdSurface* GetBackBuffer() = 0;
+
+ // Presents current back buffer to screen.
+ virtual void Flip() = 0;
+};
+
+} // namespace chromecast
+
+#endif // CHROMECAST_PUBLIC_OSD_PLANE_H
« no previous file with comments | « chromecast/public/graphics_types.h ('k') | chromecast/public/osd_plane_shlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698