summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-09-29 12:03:45 +0200
committerlouis <louis.braun@gmx.de>2013-09-29 12:03:45 +0200
commitacce422dcfe6bb57818f062b3a6e2db99b4cb2d3 (patch)
tree33d129161784818b95890a656c7a802f1118bfed /timers.c
parent9a0778bbdf309018a635229bd0523b3435388978 (diff)
downloadskin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.gz
skin-nopacity-acce422dcfe6bb57818f062b3a6e2db99b4cb2d3.tar.bz2
Added Cache for images and fonts
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/timers.c b/timers.c
index e2627de..81f9377 100644
--- a/timers.c
+++ b/timers.c
@@ -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));
}