summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Krupo <harish.krupo.kps@intel.com>2018-12-11 13:59:07 +0530
committerDaniel Stone <daniel@fooishbar.org>2019-11-25 21:54:40 +0000
commit3623e46dc555ea9df34ff259530af64f0d9f0645 (patch)
treeff16a2493649e80509eb95194e8b93441b3150dc
parent7bcbab1f2fd53987809a98d212b90fc6b99d71cc (diff)
downloadweston-3623e46dc555ea9df34ff259530af64f0d9f0645.tar.gz
desktop-shell: Set 1x1 buffers for solid-color backgrounds
When we are going to set a solid color for the background, use a 1x1 buffer and set the viewport to the full size. This avoids un-necessary allocation of buffer memory. Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
-rw-r--r--clients/desktop-shell.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index efadb49c..1d75ad1c 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -849,6 +849,12 @@ background_configure(void *data,
return;
}
+ if (!background->image) {
+ widget_set_viewport_destination(background->widget, width, height);
+ width = 1;
+ height = 1;
+ }
+
widget_schedule_resize(background->widget, width, height);
}