On Mon, Sep 13, 2010 at 11:52 AM, Chia-I Wu <olva...@gmail.com> wrote: >> +static boolean >> +vg_context_get_resource_for_egl_image(struct st_context_iface *stctxi, >> + struct st_context_resource *stres) >> +{ >> + struct vg_context *ctx; >> + struct vg_image *img; >> + struct pipe_sampler_view *sampler_view; >> + >> + ctx = (struct vg_context *) stctxi; >> + if (!ctx) >> + return FALSE; > This check could be replaced by an assertion. Calling stctxi's method > without passing stctxi is a bug elsewhere. >> + >> + img = (struct vg_image *)stres->resource; > A check on stres->type and res->resource (!= VG_INVALID_HANDLE) would > be good before the assignment. >> + if (!img) >> + return FALSE; It should also return FALSE when img is a child image. >> + sampler_view = img->sampler_view; >> + if (!sampler_view) >> + return FALSE; >> + >> + stres->texture = sampler_view->texture; > It should be > > stres->texture = NULL; > pipe_resource_reference(&stres->texture, sampler_view->texture); > > stres->texture is caller owned. >> + >> + return TRUE; >> +}
-- o...@lunarg.com _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev