cogl_pipeline_equal: Fix the comparison for layer texture equality

Before commit 49898d43 CoglPipeline would compare whether a pipeline
layer's texture is equal by fetching the underlying GL handle. I
changed that so that it would only compare the CoglHandles because
that commit removes the GL handle texture overrides and sliced
textures instead log the underlying primitive texture. However I
forgot that the primitives don't always use
_cogl_texture_foreach_sub_texture_in_region when the quad fits within
the single texture so it won't use a texture override. This meant that
atlas textures and sub textures get logged with the atlas handle so
the comparison still needs to be done using the GL handles. It might
be nice to add a CoglTexture virtual to get the underlying primitive
texture instead to avoid having the pipeline poke around with GL
handles.
This commit is contained in:
Neil Roberts 2010-11-26 15:23:15 +00:00
parent b424bd7512
commit 21e47d4280

View File

@ -2718,7 +2718,14 @@ static gboolean
_cogl_pipeline_layer_texture_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1)
{
return authority0->texture == authority1->texture;
GLuint gl_handle0, gl_handle1;
GLenum gl_target0, gl_target1;
cogl_texture_get_gl_texture (authority0->texture, &gl_handle0, &gl_target0);
cogl_texture_get_gl_texture (authority1->texture, &gl_handle1, &gl_target1);
return (gl_handle0 == gl_handle1 &&
gl_target0 == gl_target1);
}
/* Determine the mask of differences between two layers.