util: single call to util_format_description in fill_rect
authorKeith Whitwell <keithw@vmware.com>
Wed, 21 Sep 2011 17:14:04 +0000 (11:14 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Sep 2011 14:26:35 +0000 (08:26 -0600)
src/gallium/auxiliary/util/u_rect.c

index 56fcfac..59bebbc 100644 (file)
@@ -97,11 +97,12 @@ util_fill_rect(ubyte * dst,
                unsigned height,
                union util_color *uc)
 {
+   const struct util_format_description *desc = util_format_description(format);
    unsigned i, j;
    unsigned width_size;
-   int blocksize = util_format_get_blocksize(format);
-   int blockwidth = util_format_get_blockwidth(format);
-   int blockheight = util_format_get_blockheight(format);
+   int blocksize = desc->block.bits / 8;
+   int blockwidth = desc->block.width;
+   int blockheight = desc->block.height;
 
    assert(blocksize > 0);
    assert(blockwidth > 0);