Logo Search packages:      
Sourcecode: fbdesk version File versions  Download package

Pixmap FbTk::ImageControl::searchCache ( unsigned int  width,
unsigned int  height,
unsigned long  texture_type,
const FbTk::Color color,
const FbTk::Color color_to 
) const [private]

Search cache for a specific pixmap

Returns:
None if no cache was found

Definition at line 150 of file ImageControl.cc.

References FbTk::Color::pixel().

Referenced by renderImage().

                                                                                           {
    CacheList::iterator it = cache.begin();
    CacheList::iterator it_end = cache.end();
    for (; it != it_end; ++it) {
        if (((*it)->width == width) &&
            ((*it)->height == height) &&
            ((*it)->texture == texture_type) &&
            ((*it)->pixel1 == color.pixel())) {
            if (texture_type & FbTk::Texture::GRADIENT) {
                if ((*it)->pixel2 == color_to.pixel()) {
                    (*it)->count++;
                    return (*it)->pixmap;
                }
            } else {
                (*it)->count++;
                return (*it)->pixmap;
            }
        }
    }

    return None;
}


Generated by  Doxygen 1.6.0   Back to index