Lines Matching refs:surface

148    struct wayland_surface *surface = data;
153 if (!surface->pending_resource)
156 pipe_resource_reference(&surface->pending_resource, NULL);
164 wayland_window_surface_handle_resize(struct wayland_surface *surface)
166 struct wayland_display *display = surface->display;
171 front_resource = resource_surface_get_single_resource(surface->rsurf,
173 if (resource_surface_set_size(surface->rsurf,
174 surface->win->width, surface->win->height)) {
176 if (surface->pending_resource)
182 surface->pending_resource = front_resource;
186 wl_callback_add_listener(callback, &release_buffer_listener, surface);
191 if (surface->buffer[i])
192 wl_buffer_destroy(surface->buffer[i]);
193 surface->buffer[i] = NULL;
196 surface->dx = surface->win->dx;
197 surface->dy = surface->win->dy;
207 struct wayland_surface *surface = wayland_surface(nsurf);
209 if (surface->type == WL_WINDOW_SURFACE)
210 wayland_window_surface_handle_resize(surface);
212 if (!resource_surface_add_resources(surface->rsurf, attachment_mask |
213 surface->attachment_mask))
217 resource_surface_get_resources(surface->rsurf, textures, attachment_mask);
220 *seq_num = surface->sequence_number;
222 resource_surface_get_size(surface->rsurf, (uint *) width, (uint *) height);
230 struct wayland_surface *surface = data;
232 surface->frame_callback = NULL;
254 struct wayland_surface *surface = wayland_surface(nsurf);
255 struct wayland_display *display = surface->display;
258 while (surface->frame_callback && ret != -1)
263 surface->frame_callback = wl_surface_frame(surface->win->surface);
264 wl_callback_add_listener(surface->frame_callback, &frame_listener, surface);
265 wl_proxy_set_queue((struct wl_proxy *) surface->frame_callback,
268 if (surface->type == WL_WINDOW_SURFACE) {
269 resource_surface_swap_buffers(surface->rsurf,
273 wayland_buffers_swap(surface->buffer, WL_BUFFER_FRONT, WL_BUFFER_BACK);
275 if (surface->buffer[WL_BUFFER_FRONT] == NULL)
276 surface->buffer[WL_BUFFER_FRONT] =
277 display->create_buffer(display, surface,
280 wl_surface_attach(surface->win->surface, surface->buffer[WL_BUFFER_FRONT],
281 surface->dx, surface->dy);
283 resource_surface_get_size(surface->rsurf,
284 (uint *) &surface->win->attached_width,
285 (uint *) &surface->win->attached_height);
286 surface->dx = 0;
287 surface->dy = 0;
290 surface->sequence_number++;
292 &surface->base,
293 surface->sequence_number);
302 struct wayland_surface *surface = wayland_surface(nsurf);
310 if (surface->premultiplied_alpha != ctrl->premultiplied_alpha) {
314 if (surface->buffer[buffer]) {
315 wl_buffer_destroy(surface->buffer[buffer]);
316 surface->buffer[buffer] = NULL;
320 surface->premultiplied_alpha = ctrl->premultiplied_alpha;
335 if (surface->type == WL_WINDOW_SURFACE) {
336 resource_surface_get_size(surface->rsurf, &width, &height);
337 wl_surface_damage(surface->win->surface, 0, 0, width, height);
338 wl_surface_commit(surface->win->surface);
353 struct wayland_surface *surface = wayland_surface(nsurf);
357 if (surface->buffer[buffer])
358 wl_buffer_destroy(surface->buffer[buffer]);
361 if (surface->frame_callback)
362 wl_callback_destroy(surface->frame_callback);
364 resource_surface_destroy(surface->rsurf);
365 FREE(surface);
376 struct wayland_surface *surface;
380 surface = CALLOC_STRUCT(wayland_surface);
381 if (!surface)
384 surface->display = display;
385 surface->color_format = config->base.color_format;
387 surface->win = (struct wl_egl_window *) win;
389 surface->pending_resource = NULL;
390 surface->frame_callback = NULL;
391 surface->type = WL_WINDOW_SURFACE;
393 surface->buffer[WL_BUFFER_FRONT] = NULL;
394 surface->buffer[WL_BUFFER_BACK] = NULL;
395 surface->attachment_mask = (1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
398 surface->rsurf = resource_surface_create(display->base.screen,
399 surface->color_format, bind);
401 if (!surface->rsurf) {
402 FREE(surface);
406 surface->base.destroy = wayland_surface_destroy;
407 surface->base.present = wayland_surface_present;
408 surface->base.validate = wayland_surface_validate;
409 surface->base.wait = wayland_surface_wait;
411 return &surface->base;