gl: use _cairo_gl_operand_copy to fix unblanced reference count

Use _cairo_gl_operand_copy to do the operand copy instead of by
something like *operand = surface->operand.

This would fix a crash introduced by operator-source test case, which
forgot to do reference while copying operand but did dereference while
destroying surface at combine_clip_as_traps().

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
[ickle: drop the extra reference for the owned surface]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Yuanhan Liu 2012-05-30 15:13:46 +08:00 committed by Chris Wilson
parent f3ae830207
commit 9340fcd965

View file

@ -223,7 +223,7 @@ _cairo_gl_subsurface_operand_init (cairo_gl_operand_t *operand,
* (unnormalized src -> unnormalized src) to
* (unnormalized dst -> unnormalized src)
*/
*operand = surface->operand;
_cairo_gl_operand_copy(operand, &surface->operand);
attributes = &operand->texture.attributes;
attributes->matrix = src->base.matrix;
@ -270,7 +270,7 @@ _cairo_gl_surface_operand_init (cairo_gl_operand_t *operand,
if (unlikely (status))
return status;
*operand = surface->operand;
_cairo_gl_operand_copy(operand, &surface->operand);
attributes = &operand->texture.attributes;
cairo_matrix_multiply (&attributes->matrix,