Commit 8da34222 authored by halliwell's avatar halliwell Committed by Commit bot

[Chromecast] Include output screen resolution in OSD rect info

Current OSD SetClipRect API is ambiguous, as it doesn't specify what
coordinate space the clip rect is in.  This is solved by passing the
OSD screen resolution.

Additionally, pass the output screen resolution through.  Some
implementations need this info in order to scale the OSD correctly.
They could probably get the screen res in vendor-specific ways but
it's more convenient to just plumb it through here.

BUG=internal b/30025430
TEST=manual OSD test on different screen resolutions

Review-Url: https://codereview.chromium.org/2184933003
Cr-Commit-Position: refs/heads/master@{#408187}
parent bd00db28
...@@ -48,7 +48,9 @@ class OsdPlaneDefault : public OsdPlane { ...@@ -48,7 +48,9 @@ class OsdPlaneDefault : public OsdPlane {
OsdSurface* CreateSurface(const Size& size) override { OsdSurface* CreateSurface(const Size& size) override {
return new OsdSurfaceDefault(size); return new OsdSurfaceDefault(size);
} }
void SetClipRectangle(const Rect& rect) override { void SetClipRectangle(const Rect& rect,
const Size& screen_res,
float output_scale) override {
size_ = Size(rect.width, rect.height); size_ = Size(rect.width, rect.height);
} }
OsdSurface* GetBackBuffer() override { OsdSurface* GetBackBuffer() override {
......
...@@ -25,7 +25,12 @@ class OsdPlane { ...@@ -25,7 +25,12 @@ class OsdPlane {
// usage by only allocating back buffer to cover this area. Areas outside // usage by only allocating back buffer to cover this area. Areas outside
// clip rectangle must display as fully transparent. In particular, setting // clip rectangle must display as fully transparent. In particular, setting
// an empty clip rectangle and calling Flip should clear the plane. // an empty clip rectangle and calling Flip should clear the plane.
virtual void SetClipRectangle(const Rect& rect) = 0; // |osd_res| gives the resolution of the full OSD plane, i.e. |rect| is
// a subrectangle of this area. |output_scale| specifies the current scaling
// from |osd_res| to output screen resolution.
virtual void SetClipRectangle(const Rect& rect,
const Size& osd_res,
float output_scale) = 0;
// Gets the current back buffer surface. Valid until next call to Flip or // Gets the current back buffer surface. Valid until next call to Flip or
// SetClipRectangle. // SetClipRectangle.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment