summaryrefslogtreecommitdiff
path: root/src/gl-renderer.c
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2013-11-19 15:22:05 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-11-19 13:11:25 -0800
commit895b1fdcb2a4423fc1de281d9eb0df9b618e9a7a (patch)
treee2273c0e83d44c074642dbdddc9150d99263166f /src/gl-renderer.c
parent65796816b951f11541311c2624e28f0881fec61d (diff)
downloadweston-895b1fdcb2a4423fc1de281d9eb0df9b618e9a7a.tar.gz
gl-renderer: Attach buffer during surface state creation if possible
When a renderer switch happens, it is possible that when the surface state is created, a buffer for the given surface is already available. In that case, run the attach routine so that the pixel contents are properly set. Otherwise, it would only be set when a new attach request is made for that surface. Also, change the drm backend so that it keeps the buffer reference in the weston_surface when running with the pixman renderer. The pixman renderer keeps a reference to it anyway, so it is never released early. This makes the renderer transition seamless, without leaving a black screen as before.
Diffstat (limited to 'src/gl-renderer.c')
-rw-r--r--src/gl-renderer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index 5e1b3961..218fca40 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -883,7 +883,8 @@ gl_renderer_flush_damage(struct weston_surface *surface)
if (!texture_used)
return;
- if (!pixman_region32_not_empty(&gs->texture_damage))
+ if (!pixman_region32_not_empty(&gs->texture_damage) &&
+ !gs->needs_full_upload)
goto done;
switch (wl_shm_buffer_get_format(buffer->shm_buffer)) {
@@ -1240,6 +1241,11 @@ gl_renderer_create_surface(struct weston_surface *surface)
wl_signal_add(&gr->destroy_signal,
&gs->renderer_destroy_listener);
+ if (surface->buffer_ref.buffer) {
+ gl_renderer_attach(surface, surface->buffer_ref.buffer);
+ gl_renderer_flush_damage(surface);
+ }
+
return 0;
}