Subversion Repositories tpanel

Rev

Rev 165 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 165 Rev 167
Line 72... Line 72...
72
    MSG_DEBUG("Bitmap \"" << name << "\" was added.");
72
    MSG_DEBUG("Bitmap \"" << name << "\" was added.");
73
    _imgCache.unlock();
73
    _imgCache.unlock();
74
    return true;
74
    return true;
75
}
75
}
76
 
76
 
77
bool TImgCache::getBitmap(const string& name, SkBitmap *bm, _IMGCACHE_BMTYPE bmType)
77
bool TImgCache::getBitmap(const string& name, SkBitmap *bm, _IMGCACHE_BMTYPE bmType, int *width, int *height)
78
{
78
{
79
    DECL_TRACER("TImgCache::getBitmap(const string& name, _IMGCACHE_BMTYPE bmType)");
79
    DECL_TRACER("TImgCache::getBitmap(const string& name, _IMGCACHE_BMTYPE bmType, int *width, int *height)");
80
 
80
 
81
    if (mImgCache.size() == 0 || !bm)
81
    if (mImgCache.size() == 0 || !bm)
82
        return false;
82
        return false;
83
 
83
 
84
    vector<_IMGCACHE>::iterator iter;
84
    vector<_IMGCACHE>::iterator iter;
Line 86... Line 86...
86
    for (iter = mImgCache.begin(); iter != mImgCache.end(); ++iter)
86
    for (iter = mImgCache.begin(); iter != mImgCache.end(); ++iter)
87
    {
87
    {
88
        if (iter->name == name && iter->bmType == bmType)
88
        if (iter->name == name && iter->bmType == bmType)
89
        {
89
        {
90
            *bm = iter->bitmap;
90
            *bm = iter->bitmap;
-
 
91
 
-
 
92
            if (width && !iter->bitmap.empty())
-
 
93
                *width = iter->bitmap.info().width();
-
 
94
 
-
 
95
            if (height && !iter->bitmap.empty())
-
 
96
                *height = iter->bitmap.info().height();
-
 
97
 
91
            MSG_DEBUG("Bitmap \"" << iter->name << "\" was found.");
98
            MSG_DEBUG("Bitmap \"" << iter->name << "\" was found.");
92
            return true;
99
            return true;
93
        }
100
        }
94
    }
101
    }
95
 
102
 
-
 
103
    if (width)
-
 
104
        *width = 0;
-
 
105
 
-
 
106
    if (height)
-
 
107
        *height = 0;
-
 
108
 
96
    return false;
109
    return false;
97
}
110
}
98
 
111
 
99
bool TImgCache::delBitmap(const string& name, _IMGCACHE_BMTYPE bmType)
112
bool TImgCache::delBitmap(const string& name, _IMGCACHE_BMTYPE bmType)
100
{
113
{