Commit f6e915cf authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

[fuchsia] Plumb content scaling override from Cast app config.

Adds a new field "force_content_dimensions" to the Cast
ApplicationConfig table. If the field is set, then the value is
passed to Frame::ForceContentDimensions() on application startup.

Bug: b/144361044,b/144725868
Change-Id: I895071e8236aaf0e55435b0c1ea5e6eef8008e46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029259
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737427}
parent 9d5530bd
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
library chromium.cast; library chromium.cast;
using fuchsia.ui.gfx;
using fuchsia.web; using fuchsia.web;
/// Describes the configuration under which a Cast application should run. /// Describes the configuration under which a Cast application should run.
...@@ -31,6 +32,9 @@ table ApplicationConfig { ...@@ -31,6 +32,9 @@ table ApplicationConfig {
/// The URL of the agent to handle this application. /// The URL of the agent to handle this application.
7: string agent_url; 7: string agent_url;
/// Simulates a different resolution for rendering.
8: fuchsia.ui.gfx.vec2 force_content_dimensions;
}; };
/// Service interface for working with application configurations. /// Service interface for working with application configurations.
......
...@@ -39,6 +39,7 @@ source_set("common") { ...@@ -39,6 +39,7 @@ source_set("common") {
"//fuchsia/base", "//fuchsia/base",
"//fuchsia/base:modular", "//fuchsia/base:modular",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-app", "//third_party/fuchsia-sdk/sdk:fuchsia-ui-app",
"//ui/gfx/geometry",
"//url", "//url",
] ]
public_deps = [ public_deps = [
......
...@@ -76,6 +76,11 @@ void CastComponent::StartComponent() { ...@@ -76,6 +76,11 @@ void CastComponent::StartComponent() {
kBindingsFailureExitCode, kBindingsFailureExitCode,
fuchsia::sys::TerminationReason::INTERNAL_ERROR)); fuchsia::sys::TerminationReason::INTERNAL_ERROR));
if (application_config_.has_force_content_dimensions()) {
frame()->ForceContentDimensions(std::make_unique<fuchsia::ui::gfx::vec2>(
application_config_.force_content_dimensions()));
}
application_controller_ = std::make_unique<ApplicationControllerImpl>( application_controller_ = std::make_unique<ApplicationControllerImpl>(
frame(), agent_manager_->ConnectToAgentService< frame(), agent_manager_->ConnectToAgentService<
chromium::cast::ApplicationControllerReceiver>( chromium::cast::ApplicationControllerReceiver>(
......
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