cogl-atlas: Increase the default minimum texture size

When initially creating a texture it would start with a minimum size
of 256x256. This increases the size so that it would try to match 1MB
of memory.
This commit is contained in:
Neil Roberts 2010-08-06 11:44:39 +01:00
parent d03fbf9f64
commit e609a658a4

View File

@ -498,9 +498,21 @@ _cogl_atlas_reserve_space (CoglAtlas *atlas,
} }
else else
{ {
/* Start with an initial size of 256x256 */ /* At least on Intel hardware, the texture size will be rounded
map_width = 256; up to at least 1MB so we might as well try to aim for that as
map_height = 256; an initial minimum size. If the format is only 1 byte per
pixel we can use 1024x1024, otherwise we'll assume it will
take 4 bytes per pixel and use 512x512. */
if (_cogl_get_format_bpp (atlas->texture_format) == 1)
{
map_width = 1024;
map_height = 1024;
}
else
{
map_width = 512;
map_height = 512;
}
} }
new_map = _cogl_atlas_create_map (map_width, map_height, new_map = _cogl_atlas_create_map (map_width, map_height,