Commit 2f3cca90 authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

ozone: scenic: Scale entity so that texture size can be fixed at 1x1

This will allow the GPU process to avoid worrying about the display scale
when setting up its Scenic resources.

Bug: 861853
Test: run_content_shell --ozone-platform=scenic --disable-gpu --enable-vulkan

Change-Id: I19571bd55ccbc004c42230ec7aba98dcd5370d11
Reviewed-on: https://chromium-review.googlesource.com/c/1342815Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609431}
parent a4e1f023
...@@ -191,14 +191,16 @@ void ScenicWindow::UpdateSize() { ...@@ -191,14 +191,16 @@ void ScenicWindow::UpdateSize() {
screen->OnWindowBoundsChanged(window_id_, size_rect); screen->OnWindowBoundsChanged(window_id_, size_rect);
// Set node shape to rectangle that matches size of the view. // Set node shape to rectangle that matches size of the view.
scenic::Rectangle rect(&scenic_session_, size_dips_.width(), scenic::Rectangle rect(&scenic_session_, 1.f, 1.f);
size_dips_.height());
shape_node_.SetShape(rect); shape_node_.SetShape(rect);
// Translate the node by half of the view dimensions to put it in the center // Translate the node by half of the view dimensions to put it in the center
// of the view. // of the view.
shape_node_.SetTranslation(size_dips_.width() / 2.0, node_.SetTranslation(size_dips_.width() / 2.0, size_dips_.height() / 2.0,
size_dips_.height() / 2.0, 0.f); 0.f);
// Scale the node so that surface rect can always be 1x1.
node_.SetScale(size_dips_.width(), size_dips_.height(), 1.f);
// This is necessary when using vulkan because ImagePipes are presented // This is necessary when using vulkan because ImagePipes are presented
// separately and we need to make sure our sizes change is committed. // separately and we need to make sure our sizes change is committed.
......
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