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 /timers.c | |
parent | 9a0778bbdf309018a635229bd0523b3435388978 (diff) | |
download | skin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.gz skin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.bz2 |
Added Cache for images and fonts
Diffstat (limited to 'timers.c')
-rw-r--r-- | timers.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -1,15 +1,17 @@ #include "timers.h" -cNopacityTimer::cNopacityTimer(cOsd *osd, const cTimer *timer, const cFont *font, const cFont *fontLarge) { +cNopacityTimer::cNopacityTimer(cOsd *osd, cImageCache *imgCache, const cTimer *timer, const cFont *font, const cFont *fontLarge) { this->osd = osd; + this->imgCache = imgCache; this->timer = timer; this->font = font; this->fontLarge = fontLarge; isTimerConflict = false; } -cNopacityTimer::cNopacityTimer(cOsd *osd, int numConflicts, const cFont *font, const cFont *fontLarge) { +cNopacityTimer::cNopacityTimer(cOsd *osd, cImageCache *imgCache, int numConflicts, const cFont *font, const cFont *fontLarge) { this->osd = osd; + this->imgCache = imgCache; this->numConflicts = numConflicts; this->font = font; this->fontLarge = fontLarge; @@ -113,14 +115,13 @@ void cNopacityTimer::CreatePixmaps(int x) { void cNopacityTimer::Render(void) { pixmapBackground->Fill(clrBlack); - cImageLoader imgLoader; tColor clrFontBack = (config.doBlending)?clrTransparent:Theme.Color(clrTimersBack); if (isTimerConflict) { pixmapLogo->Fill(clrTransparent); pixmap->Fill(Theme.Color(clrDiskAlert)); if (config.doBlending) { - imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2); - pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage()); + cImage imgBack = imgCache->GetBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2); + pixmap->DrawImage(cPoint(1,1), imgBack); } else { pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrDiskAlert)); clrFontBack = Theme.Color(clrDiskAlert); @@ -140,8 +141,8 @@ void cNopacityTimer::Render(void) { if (timer->Recording()) { pixmap->Fill(Theme.Color(clrDiskAlert)); if (config.doBlending) { - imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2); - pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage()); + cImage imgBack = imgCache->GetBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2); + pixmap->DrawImage(cPoint(1,1), imgBack); } else { pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrDiskAlert)); clrFontBack = Theme.Color(clrDiskAlert); @@ -149,8 +150,8 @@ void cNopacityTimer::Render(void) { } else { pixmap->Fill(Theme.Color(clrMenuBorder)); if (config.doBlending) { - imgLoader.DrawBackground(Theme.Color(clrTimersBack), Theme.Color(clrTimersBackBlend), width-2, height-2); - pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage()); + cImage imgBack = imgCache->GetBackground(Theme.Color(clrTimersBack), Theme.Color(clrTimersBackBlend), width-2, height-2); + pixmap->DrawImage(cPoint(1,1), imgBack); } else { pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrTimersBack)); } |