Commit 229ca25f authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

EXO: Add support for transform to fullscreen client

Allows the fullscreen client to be executed with a custom transform.
(Valid values are 0, 90, 180, 270). This means the client will
allocate buffers in the native display space (useful for overlay
support). The transform hint is used to inform the compositor of
the correct rendering orientation of the client surface.

Bug: None
Test: wayland_fullscreen_client --transform="90"
Change-Id: I6be91c8f6d3a027466581f680c186614fcbd25d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631728
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664377}
parent 5616ad6a
......@@ -118,7 +118,8 @@ void FullscreenClient::Paint(const wl_callback_listener& frame_listener) {
wl_surface_set_buffer_scale(surface_.get(), scale_);
wl_surface_set_buffer_transform(surface_.get(), transform_);
wl_surface_damage(surface_.get(), 0, 0, size_.width(), size_.height());
wl_surface_damage(surface_.get(), 0, 0, surface_size_.width(),
surface_size_.height());
wl_surface_attach(surface_.get(), buffer->buffer.get(), 0, 0);
// Set up the frame callback.
......@@ -156,6 +157,19 @@ void FullscreenClient::HandleMode(void* data,
return;
size_.SetSize(width, height);
switch (transform_) {
case WL_OUTPUT_TRANSFORM_NORMAL:
case WL_OUTPUT_TRANSFORM_180:
surface_size_.SetSize(width, height);
break;
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_270:
surface_size_.SetSize(height, width);
break;
default:
NOTREACHED();
break;
}
std::unique_ptr<wl_region> opaque_region(static_cast<wl_region*>(
wl_compositor_create_region(globals_.compositor.get())));
......
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