diff options
author | louis <louis.braun@gmx.de> | 2013-09-29 12:03:45 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-09-29 12:03:45 +0200 |
commit | acce422dcfe6bb57818f062b3a6e2db99b4cb2d3 (patch) | |
tree | 33d129161784818b95890a656c7a802f1118bfed /rssreader.c | |
parent | 9a0778bbdf309018a635229bd0523b3435388978 (diff) | |
download | skin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.gz skin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.bz2 |
Added Cache for images and fonts
Diffstat (limited to 'rssreader.c')
-rw-r--r-- | rssreader.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/rssreader.c b/rssreader.c index dc42452..44a4c5a 100644 --- a/rssreader.c +++ b/rssreader.c @@ -262,7 +262,8 @@ void cRssReader::debugRSS(void) { } -cRssStandaloneTicker::cRssStandaloneTicker(void) { +cRssStandaloneTicker::cRssStandaloneTicker(cImageCache *imgCache) { + this->imgCache = imgCache; osdLeft = cOsd::OsdLeft(); osdWidth = cOsd::OsdWidth(); osdHeight = config.rssFeedHeightStandalone * cOsd::OsdHeight() / 100; @@ -302,23 +303,21 @@ void cRssStandaloneTicker::SetFeed(std::string feedName) { int feedNameLength = font->Width(feedName.c_str()); labelWidth = 2 + osdHeight + 2 + feedNameLength + 6; pixmapFeed->Fill(Theme.Color(clrRSSFeedBorder)); - cImageLoader imgLoader; if (config.doBlending) { - imgLoader.DrawBackground(Theme.Color(clrRSSFeedHeaderBack), Theme.Color(clrRSSFeedHeaderBackBlend), labelWidth, osdHeight - 4); - pixmapFeed->DrawImage(cPoint(2,2), imgLoader.GetImage()); - imgLoader.DrawBackground(Theme.Color(clrRSSFeedBack), Theme.Color(clrRSSFeedBackBlend), osdWidth - labelWidth - 2, osdHeight - 4); - pixmapFeed->DrawImage(cPoint(labelWidth,2), imgLoader.GetImage()); + cImage imgBack = imgCache->GetBackground(Theme.Color(clrRSSFeedHeaderBack), Theme.Color(clrRSSFeedHeaderBackBlend), labelWidth, osdHeight - 4); + pixmapFeed->DrawImage(cPoint(2,2), imgBack); + cImage imgBack2 = imgCache->GetBackground(Theme.Color(clrRSSFeedBack), Theme.Color(clrRSSFeedBackBlend), osdWidth - labelWidth - 2, osdHeight - 4); + pixmapFeed->DrawImage(cPoint(labelWidth,2), imgBack2); } else { pixmapFeed->DrawRectangle(cRect(2, 2, labelWidth, osdHeight - 4), Theme.Color(clrRSSFeedHeaderBack)); pixmapFeed->DrawRectangle(cRect(labelWidth, 2, osdWidth - labelWidth - 2, osdHeight - 4), Theme.Color(clrRSSFeedBack)); } pixmapFeed->DrawText(cPoint(osdHeight + 2, (osdHeight - font->Height()) / 2), feedName.c_str(), Theme.Color(clrRSSFeedHeaderText), clrTransparent, font); pixmapIcon->Fill(clrTransparent); - if (imgLoader.LoadIcon("skinIcons/rss", osdHeight-4)) { - cImage icon = imgLoader.GetImage(); - pixmapIcon->DrawImage(cPoint(2,2), icon); - } + cImage *imgIcon = imgCache->GetSkinIcon("skinIcons/rssStandalone", osdHeight-4, osdHeight-4); + if (imgIcon) + pixmapIcon->DrawImage(cPoint(2,2), *imgIcon); osd->Flush(); } |