summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2013-02-12 11:53:47 +0000
committerKristian Høgsberg <krh@bitplanet.net>2013-02-14 13:40:52 -0500
commit9f3dd1518347ef1e37300fe2c4b9bf4668ec5a06 (patch)
tree06cb08e372061d3787ce03f50d98ff19ea71e941
parent566b46467f91b27d3c43029839ffc28a9754bdd8 (diff)
shell: Bypass fullscreen scaling if surface width and height match output
If our surface has width and height set to the same dimensions as the output then we can bypassing the scale factor calculation and addition of the transformation. The use case that led to this optimisation is the playback of video using gstreamer-vaapi with the "scale" method. The video is the same dimensions as the output (1080p.)
-rw-r--r--src/shell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shell.c b/src/shell.c
index 72d2a73..6b0f574 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1672,6 +1672,13 @@ shell_configure_fullscreen(struct shell_surface *shsurf)
center_on_output(surface, shsurf->fullscreen_output);
break;
case WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE:
+ /* 1:1 mapping between surface and output dimensions */
+ if (output->width == surface->geometry.width &&
+ output->height == surface->geometry.height) {
+ weston_surface_set_position(surface, output->x, output->y);
+ break;
+ }
+
matrix = &shsurf->fullscreen.transform.matrix;
weston_matrix_init(matrix);