Lines Matching refs:srf
342 struct xa_surface *srf;
353 srf = calloc(1, sizeof(*srf));
354 if (!srf)
357 template = &srf->template;
375 srf->tex = xa->screen->resource_from_handle(xa->screen, template, whandle,
378 srf->tex = xa->screen->resource_create(xa->screen, template);
379 if (!srf->tex)
382 srf->refcount = 1;
383 srf->xa = xa;
384 srf->flags = flags;
385 srf->fdesc = fdesc;
387 return srf;
389 free(srf);
439 xa_surface_redefine(struct xa_surface *srf,
448 struct pipe_resource *template = &srf->template;
451 struct xa_tracker *xa = srf->xa;
465 xa_flags_compat(srf->flags, new_flags))
510 0, 0, 0, 0, srf->tex, 0, &src_box);
514 pipe_resource_reference(&srf->tex, texture);
516 srf->fdesc = fdesc;
517 srf->flags = new_flags;
523 xa_surface_ref(struct xa_surface *srf)
525 if (srf == NULL) {
528 srf->refcount++;
529 return srf;
533 xa_surface_unref(struct xa_surface *srf)
535 if (srf == NULL || --srf->refcount) {
538 pipe_resource_reference(&srf->tex, NULL);
539 free(srf);
551 xa_surface_handle(struct xa_surface *srf,
557 struct pipe_screen *screen = srf->xa->screen;
562 res = screen->resource_get_handle(screen, srf->xa->default_ctx->pipe,
563 srf->tex, &whandle,
575 xa_surface_format(const struct xa_surface *srf)
577 return srf->fdesc.xa_format;