texture-tower: Fix error case in meta-texture-tower

If we for some reason have an error trying to allocate the framebuffer,
we'll still mark the tower as revalidated. Move the validation to the
end of the actual revalidation code to solve this.
This commit is contained in:
Jasper St. Pierre 2014-08-08 17:29:26 -04:00
parent b284126d3b
commit e320b06aaa

View File

@ -378,8 +378,8 @@ texture_tower_create_texture (MetaTextureTower *tower,
} }
static void static void
texture_tower_revalidate_fbo (MetaTextureTower *tower, texture_tower_revalidate (MetaTextureTower *tower,
int level) int level)
{ {
CoglTexture *source_texture = tower->textures[level - 1]; CoglTexture *source_texture = tower->textures[level - 1];
int source_texture_width = cogl_texture_get_width (source_texture); int source_texture_width = cogl_texture_get_width (source_texture);
@ -425,13 +425,6 @@ texture_tower_revalidate_fbo (MetaTextureTower *tower,
(2. * invalid->y2) / source_texture_height); (2. * invalid->y2) / source_texture_height);
cogl_object_unref (pipeline); cogl_object_unref (pipeline);
}
static void
texture_tower_revalidate (MetaTextureTower *tower,
int level)
{
texture_tower_revalidate_fbo (tower, level);
tower->invalid[level].x1 = tower->invalid[level].x2 = 0; tower->invalid[level].x1 = tower->invalid[level].x2 = 0;
tower->invalid[level].y1 = tower->invalid[level].y2 = 0; tower->invalid[level].y1 = tower->invalid[level].y2 = 0;