diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-05-11 00:13:26 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-05-11 00:13:26 +0000 |
| commit | b887d75af86b430552cc28ea5e37bf58bd557d4b (patch) | |
| tree | f9107dd0824ec984a88fd9332806ef15400aa203 /lib/gdi/gpixmap.cpp | |
| parent | b21236226ec3c6a49d3594ac0ccad20906228238 (diff) | |
| download | enigma2-b887d75af86b430552cc28ea5e37bf58bd557d4b.tar.gz enigma2-b887d75af86b430552cc28ea5e37bf58bd557d4b.zip | |
use rgb values whenever possible
Diffstat (limited to 'lib/gdi/gpixmap.cpp')
| -rw-r--r-- | lib/gdi/gpixmap.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp index 3ebd9a02..c3d2cc31 100644 --- a/lib/gdi/gpixmap.cpp +++ b/lib/gdi/gpixmap.cpp @@ -175,6 +175,38 @@ void gPixmap::fill(const gRegion ®ion, const gColor &color) } } +void gPixmap::fill(const gRegion ®ion, const gRGB &color) +{ + unsigned int i; + for (i=0; i<region.rects.size(); ++i) + { + const eRect &area = region.rects[i]; + if ((area.height()<=0) || (area.width()<=0)) + continue; + + if (surface->bpp == 32) + { + __u32 col; + + col = color.argb(); + col^=0xFF000000; + + if (surface->data_phys && gAccel::getInstance()) + if (!gAccel::getInstance()->fill(surface, area, col)) + continue; + + for (int y=area.top(); y<area.bottom(); y++) + { + __u32 *dst=(__u32*)(((__u8*)surface->data)+y*surface->stride+area.left()*surface->bypp); + int x=area.width(); + while (x--) + *dst++=col; + } + } else + eWarning("couldn't rgbfill %d bpp", surface->bpp); + } +} + void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag) { for (unsigned int i=0; i<clip.rects.size(); ++i) |
