1
0
Fork 0
mutter-performance-source/clutter/cogl
Neil Roberts 7e112472b5 cogl-texture-2d-sliced: Use the smallest possible waste
When picking a size for the last slice in a texture, Cogl would always
pick the biggest power of two size that doesn't create too much
waste and is less than or equal to the previous slice size. However
this can end up creating a texture that is bigger than needed if there
is a smaller power of two.

For example, if the maximum waste is 127 (the current default) and we
try to create a texture that is 257 pixels wide it will decide that
the next power of two (512) is too much waste (255) so it will create
the first slice at 256 pixels wide. Then we only have 1 pixel left to
allocate but Cogl would pick the next smaller size that has a small
enough waste which is 128. But of course 1 is already a power of two
so that's redundantly oversized by 127.

This patch fixes it so that whenever it finds a size that would be big
enough, instead of using exactly that it picks the next power of two
up from the size we need to fill.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2355
2010-10-11 14:40:04 +01:00
..
cogl cogl-texture-2d-sliced: Use the smallest possible waste 2010-10-11 14:40:04 +01:00
doc cogl: improves header and coding style consistency 2010-02-12 14:05:00 +00:00
pango Replace cogl_color_set_from_* with cogl_color_init_from_* 2010-09-03 16:58:47 +01:00
Makefile.am [cogl] move clutter/pango to clutter/cogl/pango 2009-10-16 18:58:51 +01:00