Ticket #8975: EffectsStruct.diff

File EffectsStruct.diff, 37.6 KB (added by robertm, 14 years ago)

Patch

  • libs/libmythtv/videoout_vdpau.cpp

     
    10921092        if (m_pips.contains(pipplayer))
    10931093        {
    10941094            QRect rect = GetPIPRect(loc, pipplayer);
     1095            Effects fx = { 255 };
    10951096
    10961097            if (!m_pip_ready)
    10971098                m_render->DrawBitmap(0, m_pip_surface, NULL, NULL, 0, 0, 0, 0);
     
    11151116                                       QRect(QPoint(0,0), pipVideoDim),
    11161117                                       rect, rect);
    11171118            ok &= m_render->DrawBitmap(0, m_pip_surface, NULL, &rect,
    1118                                        255, 0, 0, 0, true);
     1119                                       &fx, 0, 0, 0, true);
    11191120
    11201121            if (pipActive)
    11211122            {
     
    11281129                                QSize(rect.width(), 10));
    11291130                QRect r = QRect(QPoint(rect.x() + rect.width(), rect.y() -10),
    11301131                                QSize(10, rect.height() + 20));
    1131                 m_render->DrawBitmap(0, m_pip_surface, NULL, &l, 255, 127);
    1132                 m_render->DrawBitmap(0, m_pip_surface, NULL, &t, 255, 127);
    1133                 m_render->DrawBitmap(0, m_pip_surface, NULL, &b, 255, 127);
    1134                 m_render->DrawBitmap(0, m_pip_surface, NULL, &r, 255, 127);
     1132                m_render->DrawBitmap(0, m_pip_surface, NULL, &l, &fx, 127);
     1133                m_render->DrawBitmap(0, m_pip_surface, NULL, &t, &fx, 127);
     1134                m_render->DrawBitmap(0, m_pip_surface, NULL, &b, &fx, 127);
     1135                m_render->DrawBitmap(0, m_pip_surface, NULL, &r, &fx, 127);
    11351136            }
    11361137
    11371138            m_pip_ready = ok;
  • libs/libmythtv/osd.cpp

     
    548548        {
    549549            if (it.value()->IsVisible())
    550550            {
    551                 it.value()->Draw(painter, 0, 0, 255, cliprect);
     551                Effects fx = { 255 };
     552                it.value()->Draw(painter, 0, 0, fx, cliprect);
    552553                it.value()->SetAlpha(255);
    553554                it.value()->ResetNeedsRedraw();
    554555            }
     
    628629        {
    629630            if (it.value()->NeedsRedraw())
    630631            {
     632                Effects fx = { 255 };
    631633                if (it.value()->IsVisible())
    632                     it.value()->Draw(painter, 0, 0, 255, cliprect);
     634                    it.value()->Draw(painter, 0, 0, fx, cliprect);
    633635                it.value()->SetAlpha(255);
    634636                it.value()->ResetNeedsRedraw();
    635637            }
  • libs/libmythui/mythpainter.cpp

     
    2626{
    2727}
    2828
    29 void MythPainter::DrawImage(int x, int y, MythImage *im, int alpha)
     29void MythPainter::DrawImage(int x, int y, MythImage *im, Effects fx)
    3030{
    3131    if (!im)
    3232    {
     
    3636    }
    3737    QRect dest = QRect(x, y, im->width(), im->height());
    3838    QRect src = im->rect();
    39     DrawImage(dest, im, src, alpha);
     39    DrawImage(dest, im, src, fx);
    4040}
    4141
    42 void MythPainter::DrawImage(const QPoint &topLeft, MythImage *im, int alpha)
     42void MythPainter::DrawImage(const QPoint &topLeft, MythImage *im, Effects fx)
    4343{
    44     DrawImage(topLeft.x(), topLeft.y(), im, alpha);
     44    DrawImage(topLeft.x(), topLeft.y(), im, fx);
    4545}
    4646
    4747// the following assume graphics hardware operates natively at 32bpp
  • libs/libmythui/mythpainter_qt.cpp

     
    109109}
    110110
    111111void MythQtPainter::DrawImage(const QRect &r, MythImage *im,
    112                               const QRect &src, int alpha)
     112                              const QRect &src, const Effects &fx)
    113113{
    114114    if (!painter)
    115115    {
     
    122122    if (qim->NeedsRegen())
    123123        qim->RegeneratePixmap();
    124124
    125     painter->setOpacity(static_cast<float>(alpha) / 255.0);
     125    painter->setOpacity(static_cast<float>(fx.alpha) / 255.0);
    126126    painter->drawPixmap(r.topLeft(), *(qim->GetPixmap()), src);
    127127    painter->setOpacity(1.0);
    128128}
    129129
    130130void MythQtPainter::DrawText(const QRect &r, const QString &msg,
    131131                             int flags, const MythFontProperties &font,
    132                              int alpha, const QRect &boundRect)
     132                             const Effects &fx, const QRect &boundRect)
    133133{
    134134    if (!painter)
    135135    {
     
    137137        return;
    138138    }
    139139
    140     (void)alpha;
     140    (void)fx.alpha;
    141141
    142     painter->setOpacity(static_cast<float>(alpha) / 255.0);
     142    painter->setOpacity(static_cast<float>(fx.alpha) / 255.0);
    143143   
    144144    painter->setFont(font.face());
    145145
     
    160160        painter->drawText(a, flags, msg);
    161161    }
    162162
    163     if (font.hasOutline() && alpha > 128)
     163    if (font.hasOutline() && fx.alpha > 128)
    164164    {
    165165        QColor outlineColor;
    166166        int outlineSize, outlineAlpha;
  • libs/libmythui/mythmainwindow.cpp

     
    696696            for (screenit = redrawList.begin(); screenit != redrawList.end();
    697697                 ++screenit)
    698698            {
    699                 (*screenit)->Draw(d->painter, 0, 0, 255, rects[i]);
     699                Effects fx = { 255 };
     700                (*screenit)->Draw(d->painter, 0, 0, fx, rects[i]);
    700701            }
    701702        }
    702703    }
  • libs/libmythui/mythpainter_qimage.cpp

     
    143143}
    144144
    145145void MythQImagePainter::DrawImage(const QRect &r, MythImage *im,
    146                                   const QRect &src, int alpha)
     146                                  const QRect &src, const Effects &fx)
    147147{
    148148    if (!painter)
    149149    {
    150150        VERBOSE(VB_IMPORTANT, "FATAL ERROR: DrawImage called with no painter");
    151151        return;
    152152    }
    153    
    154     (void)alpha;
    155153
     154    (void)fx.alpha;
     155
    156156    CheckPaintMode(QRect(r.topLeft(), src.size()));
    157     painter->setOpacity(static_cast<float>(alpha) / 255.0);
     157    painter->setOpacity(static_cast<float>(fx.alpha) / 255.0);
    158158    painter->drawImage(r.topLeft(), (QImage)(*im), src);
    159159    painter->setOpacity(1.0);
    160160}
    161161
    162162void MythQImagePainter::DrawText(const QRect &r, const QString &msg,
    163163                                 int flags, const MythFontProperties &font,
    164                                  int alpha, const QRect &boundRect)
     164                                 const Effects &fx, const QRect &boundRect)
    165165{
    166166    MythImage *im = GetImageFromString(msg, flags, r, font);
    167167    if (!im)
     
    202202        srcRect.setRect(x,y,width,height);
    203203    }
    204204
    205     DrawImage(destRect, im, srcRect, alpha);
     205    DrawImage(destRect, im, srcRect, fx);
    206206}
    207207
    208208void MythQImagePainter::DrawRect(const QRect &area, bool drawFill,
     
    237237{
    238238    MythImage *im = GetImageFromRect(area.size(), radius, drawFill, fillColor,
    239239                                     drawLine, lineWidth, lineColor);
     240    Effects fx = { 255 };
    240241    if (im)
    241         DrawImage(area, im, QRect(0, 0, area.width(), area.height()), 255);
     242        DrawImage(area, im, QRect(0, 0, area.width(), area.height()), fx);
    242243}
    243244
    244245MythImage* MythQImagePainter::GetImageFromRect(const QSize &size, int radius,
  • libs/libmythui/mythuishape.cpp

     
    7777 *  \copydoc MythUIType::DrawSelf()
    7878 */
    7979void MythUIShape::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    80                           int alphaMod, QRect clipRect)
     80                          Effects fx, QRect clipRect)
    8181{
    8282    QRect area = GetArea();
    8383    area.translate(xoffset, yoffset);
     
    101101            srcRect = m_cropRect.toQRect();
    102102        else
    103103            srcRect = m_image->rect();
    104         p->DrawImage(dest, m_image, srcRect, CalcAlpha(alphaMod));
     104        p->DrawImage(dest, m_image, srcRect, fx);
    105105    }
    106106}
    107107
  • libs/libmythui/mythpainter_yuva.cpp

     
    1616}
    1717
    1818void MythYUVAPainter::DrawImage(const QRect &dest, MythImage *im,
    19                                 const QRect &src, int alpha)
     19                                const QRect &src, const Effects &fx)
    2020{
    2121    if (im->format() != QImage::Format_ARGB32)
    2222    {
     
    2525    }
    2626
    2727    im->ConvertToYUV();
    28     MythQImagePainter::DrawImage(dest, im, src, alpha);
     28    MythQImagePainter::DrawImage(dest, im, src, fx);
    2929}
    3030
    3131void MythYUVAPainter::DrawText(const QRect &dest, const QString &msg, int flags,
    32                                const MythFontProperties &font, int alpha,
     32                               const MythFontProperties &font, const Effects &fx,
    3333                               const QRect &boundRect)
    3434{
    3535    MythFontProperties *converted = GetConvertedFont(font);
     
    3939        if (im)
    4040            im->SetToYUV();
    4141        MythQImagePainter::DrawText(dest, msg, flags, *converted,
    42                                     alpha, boundRect);
     42                                    fx, boundRect);
    4343    }
    4444}
    4545
  • libs/libmythui/mythpainter_ogl.h

     
    2828    virtual void End();
    2929
    3030    virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    31                            int alpha);
     31                           const Effects &fx);
    3232    virtual void DrawText(const QRect &dest, const QString &msg, int flags,
    33                           const MythFontProperties &font, int alpha,
     33                          const MythFontProperties &font, const Effects &fx,
    3434                          const QRect &boundRect);
    3535    virtual void DrawRect(const QRect &area,
    3636                          bool drawFill, const QColor &fillColor,
  • libs/libmythui/mythuibuttonlist.h

     
    172172                       WrapFlowing };
    173173
    174174    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    175                           int alphaMod, QRect clipRect);
     175                          Effects fx, QRect clipRect);
    176176    void Const();
    177177    virtual void Init();
    178178
  • libs/libmythui/mythuitype.cpp

     
    3737    m_Area = MythRect(0, 0, 0, 0);
    3838    m_MinArea = MythRect(0, 0, 0, 0);
    3939    m_NeedsRedraw = false;
    40     m_Alpha = 255;
     40    m_Effects = { 255 };
    4141    m_AlphaChangeMode = m_AlphaChange = m_AlphaMin = 0;
    4242    m_AlphaMax = 255;
    4343    m_Moving = false;
     
    376376    if (m_AlphaChangeMode == 0)
    377377        return;
    378378
    379     m_Alpha += m_AlphaChange;
     379    m_Effects.alpha += m_AlphaChange;
    380380
    381     if (m_Alpha > m_AlphaMax)
    382         m_Alpha = m_AlphaMax;
    383     if (m_Alpha < m_AlphaMin)
    384         m_Alpha = m_AlphaMin;
     381    if (m_Effects.alpha > m_AlphaMax)
     382        m_Effects.alpha = m_AlphaMax;
     383    if (m_Effects.alpha < m_AlphaMin)
     384        m_Effects.alpha = m_AlphaMin;
    385385
    386386    // Reached limits so change direction
    387     if (m_Alpha == m_AlphaMax || m_Alpha == m_AlphaMin)
     387    if (m_Effects.alpha == m_AlphaMax || m_Effects.alpha == m_AlphaMin)
    388388    {
    389389        if (m_AlphaChangeMode == 2)
    390390        {
     
    421421
    422422int MythUIType::CalcAlpha(int alphamod)
    423423{
    424     return (int)(m_Alpha * (alphamod / 255.0));
     424    return (int)(m_Effects.alpha * (alphamod / 255.0));
    425425}
    426426
    427 void MythUIType::DrawSelf(MythPainter *, int, int, int, QRect)
     427void MythUIType::DrawSelf(MythPainter *, int, int, Effects, QRect)
    428428{
    429429}
    430430
    431 void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod,
     431void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, Effects fx,
    432432                      QRect clipRect)
    433433{
    434434    m_DirtyRegion = QRegion(QRect(0,0,0,0));
     
    442442    if (!realArea.intersects(clipRect))
    443443        return;
    444444
    445     DrawSelf(p, xoffset, yoffset, alphaMod, clipRect);
     445    DrawSelf(p, xoffset, yoffset, fx, clipRect);
    446446
    447447    QList<MythUIType *>::Iterator it;
    448448    for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
    449449    {
    450450        (*it)->Draw(p, xoffset + m_Area.x(), yoffset + m_Area.y(),
    451                     CalcAlpha(alphaMod), clipRect);
     451                    fx, clipRect);
    452452    }
    453453}
    454454
     
    668668    m_AlphaMin = minalpha;
    669669    m_AlphaMax = maxalpha;
    670670
    671     if (m_Alpha > m_AlphaMax)
    672         m_Alpha = m_AlphaMax;
    673     if (m_Alpha < m_AlphaMin)
    674         m_Alpha = m_AlphaMin;
     671    if (m_Effects.alpha > m_AlphaMax)
     672        m_Effects.alpha = m_AlphaMax;
     673    if (m_Effects.alpha < m_AlphaMin)
     674        m_Effects.alpha = m_AlphaMin;
    675675}
    676676
    677677void MythUIType::SetAlpha(int newalpha)
    678678{
    679     if (m_Alpha == newalpha)
     679    if (m_Effects.alpha == newalpha)
    680680        return;
    681     m_Alpha = newalpha;
     681    m_Effects.alpha = newalpha;
    682682    SetRedraw();
    683683}
    684684
    685685int MythUIType::GetAlpha(void) const
    686686{
    687     return m_Alpha;
     687    return m_Effects.alpha;
    688688}
    689689
    690690/** \brief Key event handler
     
    811811    SetArea(base->m_Area);
    812812    m_MinArea = base->m_MinArea;
    813813    m_MinSize = base->m_MinSize;
    814     m_Alpha = base->m_Alpha;
     814    m_Effects = base->m_Effects;
    815815    m_AlphaChangeMode = base->m_AlphaChangeMode;
    816816    m_AlphaChange = base->m_AlphaChange;
    817817    m_AlphaMin = base->m_AlphaMin;
     
    863863    }
    864864    else if (element.tagName() == "alpha")
    865865    {
    866         m_Alpha = getFirstText(element).toInt();
     866        m_Effects.alpha = getFirstText(element).toInt();
    867867        m_AlphaChangeMode = 0;
    868868    }
    869869    else if (element.tagName() == "alphapulse")
    870870    {
    871871        m_AlphaChangeMode = 2;
    872872        m_AlphaMin = element.attribute("min", "0").toInt();
    873         m_Alpha = m_AlphaMax = element.attribute("max", "255").toInt();
     873        m_Effects.alpha = m_AlphaMax = element.attribute("max", "255").toInt();
    874874        if (m_AlphaMax > 255)
    875             m_Alpha = m_AlphaMax = 255;
     875            m_Effects.alpha = m_AlphaMax = 255;
    876876        if (m_AlphaMin < 0)
    877877            m_AlphaMin = 0;
    878878        m_AlphaChange = element.attribute("change", "5").toInt();
  • libs/libmythui/mythuiwebbrowser.h

     
    9898    void SetBackgroundColor(QColor color);
    9999
    100100    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    101                           int alphaMod, QRect clipRegion);
     101                          Effects fx, QRect clipRegion);
    102102
    103103    virtual bool ParseElement(
    104104        const QString &filename, QDomElement &element, bool showWarnings);
  • libs/libmythui/mythrender_opengl.h

     
    1717#endif
    1818
    1919#include "mythverbose.h"
     20#include "mythpainter.h"
    2021#include "mythrender_base.h"
    2122#include "mythrender_opengl_defs.h"
    2223
     
    114115    void EnableShaderObject(uint obj);
    115116
    116117    void DrawBitmap(uint tex, uint target, const QRect *src, const QRect *dst,
    117                     uint prog, int alpha = 255, int red = 255, int green = 255,
     118                    uint prog, const Effects *fx, int red = 255, int green = 255,
    118119                    int blue = 255);
    119120    void DrawBitmap(uint *textures, uint texture_count, uint target,
    120121                    const QRectF *src, const QRectF *dst, uint prog,
  • libs/libmythui/mythuibuttonlist.cpp

     
    23802380/**
    23812381 *  \copydoc MythUIType::DrawSelf()
    23822382 */
    2383 void MythUIButtonList::DrawSelf(MythPainter *, int, int, int, QRect)
     2383void MythUIButtonList::DrawSelf(MythPainter *, int, int, Effects, QRect)
    23842384{
    23852385    if (m_needsUpdate)
    23862386        SetPositionArrowStates();
  • libs/libmythui/mythuitext.h

     
    5353
    5454  protected:
    5555    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    56                           int alphaMod, QRect clipRect);
     56                          Effects fx, QRect clipRect);
    5757
    5858    virtual bool ParseElement(
    5959        const QString &filename, QDomElement &element, bool showWarnings);
  • libs/libmythui/mythrender_vdpau.h

     
    119119    bool UploadMythImage(uint id, MythImage *image);
    120120    bool UploadYUVFrame(uint id, void* const planes[3], uint32_t pitches[3]);
    121121    bool DrawBitmap(uint id, uint target, const QRect *src,
    122                     const QRect *dst, int alpha = 0, int red = 0,
     122                    const QRect *dst, const Effects *fx, int red = 0,
    123123                    int blue = 0, int green = 0, bool blend = false);
    124124
    125125    QSize GetBitmapSize(uint id);
  • libs/libmythui/mythpainter_vdpau.h

     
    2828    virtual void End();
    2929
    3030    virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    31                            int alpha);
     31                           const Effects &fx);
    3232    virtual void DrawText(const QRect &dest, const QString &msg, int flags,
    33                           const MythFontProperties &font, int alpha,
     33                          const MythFontProperties &font, const Effects &fx,
    3434                          const QRect &boundRect);
    3535    virtual void DrawRect(const QRect &area,
    3636                          bool drawFill, const QColor &fillColor,
  • libs/libmythui/mythpainter.h

     
    1313//  #include "mythfontproperties.h"
    1414
    1515#include "compat.h"
    16 
     16#include "mythuitype.h"
    1717#include "mythexp.h"
    1818
    1919class MythFontProperties;
     
    4040    QPaintDevice *GetParent(void) { return m_Parent; }
    4141
    4242    virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    43                            int alpha) = 0;
     43                           const Effects &fx) = 0;
    4444
    45     void DrawImage(int x, int y, MythImage *im, int alpha);
    46     void DrawImage(const QPoint &topLeft, MythImage *im, int alph);
     45    void DrawImage(int x, int y, MythImage *im, Effects fx);
     46    void DrawImage(const QPoint &topLeft, MythImage *im, Effects fx);
    4747
    4848    virtual void DrawText(const QRect &dest, const QString &msg, int flags,
    49                           const MythFontProperties &font, int alpha,
     49                          const MythFontProperties &font, const Effects &fx,
    5050                          const QRect &boundRect) = 0;
    5151
    5252    virtual void DrawRect(const QRect &area,
  • libs/libmythui/mythpainter_qt.h

     
    2727    virtual void SetClipRect(const QRect &clipRect);
    2828
    2929    virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    30                            int alpha);
     30                           const Effects &fx);
    3131    virtual void DrawText(const QRect &dest, const QString &msg, int flags,
    32                           const MythFontProperties &font, int alpha,
     32                          const MythFontProperties &font, const Effects &fx,
    3333                          const QRect &boundRect);
    3434    virtual void DrawRect(const QRect &area,
    3535                          bool drawFill, const QColor &fillColor,
  • libs/libmythui/mythuitype.h

     
    1111#include "mythrect.h"
    1212#include "mythgesture.h"
    1313
     14struct Effects
     15{
     16    int alpha;
     17};
     18
    1419class MythImage;
    1520class MythPainter;
    1621class MythGestureEvent;
     
    7681    // Called each draw pulse.  Will redraw automatically if dirty afterwards
    7782    virtual void Pulse(void);
    7883
    79     void Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod = 255,
     84    void Draw(MythPainter *p, int xoffset, int yoffset, Effects fx,
    8085              QRect clipRegion = QRect());
    8186
    8287    virtual void SetPosition(int x, int y);
     
    147152   
    148153  protected:
    149154    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    150                           int alphaMod, QRect clipRegion);
     155                          Effects fx, QRect clipRegion);
    151156
    152157    void AddFocusableChildrenToList(QMap<int, MythUIType *> &focusList);
    153158    void HandleAlphaPulse();
     
    180185    QRegion m_DirtyRegion;
    181186    bool m_NeedsRedraw;
    182187
    183     int m_Alpha;
     188    Effects m_Effects;
     189
    184190    int m_AlphaChangeMode; // 0 - none, 1 - once, 2 - cycle
    185191    int m_AlphaChange;
    186192    int m_AlphaMin;
  • libs/libmythui/mythpainter_vdpau.cpp

     
    9797    DeleteBitmaps();
    9898
    9999    if (m_target)
    100         m_render->DrawBitmap(0, m_target, NULL, NULL);
     100        m_render->DrawBitmap(0, m_target, NULL, NULL, NULL);
    101101    else if (m_swap_control)
    102102        m_render->WaitForFlip();
    103103
     
    139139}
    140140
    141141void MythVDPAUPainter::DrawImage(const QRect &r, MythImage *im,
    142                                  const QRect &src, int alpha)
     142                                 const QRect &src, const Effects &fx)
    143143{
    144144    if (m_render)
    145145        m_render->DrawBitmap(GetTextureFromCache(im), m_target,
    146                              &src, &r /*dst*/, alpha, 255, 255, 255);
     146                             &src, &r /*dst*/, &fx, 255, 255, 255);
    147147}
    148148
    149149void MythVDPAUPainter::DrawText(const QRect &r, const QString &msg,
    150150                                int flags, const MythFontProperties &font,
    151                                 int alpha, const QRect &boundRect)
     151                                const Effects &fx, const QRect &boundRect)
    152152{
    153153    MythImage *im = GetImageFromString(msg, flags, r, font);
    154154    if (!im)
     
    189189        srcRect.setRect(x,y,width,height);
    190190    }
    191191
    192     DrawImage(destRect, im, srcRect, alpha);
     192    DrawImage(destRect, im, srcRect, fx);
    193193}
    194194
    195195void MythVDPAUPainter::DrawRect(const QRect &area, bool drawFill,
     
    198198{
    199199    if (m_render)
    200200    {
    201         m_render->DrawBitmap(0, m_target, NULL, &area, fillColor.alpha(),
     201        Effects fx;
     202        fx.alpha = fillColor.alpha();
     203
     204        m_render->DrawBitmap(0, m_target, NULL, &area, &fx,
    202205                             fillColor.red(), fillColor.green(),
    203206                             fillColor.blue());
    204207
     
    210213                   QSize(lineWidth, area.height()));
    211214        QRect right(QPoint(area.x() + area.width() - lineWidth, area.y()),
    212215                    QSize(lineWidth, area.height()));
    213         m_render->DrawBitmap(0, m_target, NULL, &top, lineColor.alpha(),
     216        m_render->DrawBitmap(0, m_target, NULL, &top, &fx,
    214217                             lineColor.red(), lineColor.green(),
    215218                             lineColor.blue());
    216         m_render->DrawBitmap(0, m_target, NULL, &bot, lineColor.alpha(),
     219        m_render->DrawBitmap(0, m_target, NULL, &bot, &fx,
    217220                             lineColor.red(), lineColor.green(),
    218221                             lineColor.blue());
    219         m_render->DrawBitmap(0, m_target, NULL, &left, lineColor.alpha(),
     222        m_render->DrawBitmap(0, m_target, NULL, &left, &fx,
    220223                             lineColor.red(), lineColor.green(),
    221224                             lineColor.blue());
    222         m_render->DrawBitmap(0, m_target, NULL, &right, lineColor.alpha(),
     225        m_render->DrawBitmap(0, m_target, NULL, &right, &fx,
    223226                             lineColor.red(), lineColor.green(),
    224227                             lineColor.blue());
    225228    }
     
    235238    if (!im)
    236239        return;
    237240
    238     DrawImage(area, im, QRect(0, 0, area.width(), area.height()), 255);
     241    Effects fx;
     242    fx.alpha = 255;
     243
     244    DrawImage(area, im, QRect(0, 0, area.width(), area.height()), fx);
    239245}
    240246
    241247MythImage *MythVDPAUPainter::GetFormatImage()
  • libs/libmythui/mythuishape.h

     
    2626
    2727  protected:
    2828    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    29                           int alphaMod, QRect clipRect);
     29                          Effects fx, QRect clipRect);
    3030
    3131    virtual bool ParseElement(
    3232        const QString &filename, QDomElement &element, bool showWarnings);
  • libs/libmythui/mythuiguidegrid.h

     
    2222    ~MythUIGuideGrid();
    2323
    2424    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    25                           int alphaMod, QRect clipRect);
     25                          Effects fx, QRect clipRect);
    2626
    2727    enum FillType { Alpha = 10, Dense, Eco, Solid };
    2828
  • libs/libmythui/mythpainter_yuva.h

     
    1515
    1616    QString GetName(void) { return QString("YUVA"); }
    1717    void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    18                    int alpha);
     18                   const Effects &fx);
    1919    void DrawText(const QRect &dest, const QString &msg, int flags,
    20                   const MythFontProperties &font, int alpha,
     20                  const MythFontProperties &font, const Effects &fx,
    2121                  const QRect &boundRect);
    2222    void DrawRect(const QRect &area, bool drawFill, const QColor &fillColor,
    2323                  bool drawLine, int lineWidth, const QColor &lineColor);
  • libs/libmythui/mythuiimage.cpp

     
    10291029 *  \copydoc MythUIType::DrawSelf()
    10301030 */
    10311031void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    1032                            int alphaMod, QRect clipRect)
     1032                           Effects fx, QRect clipRect)
    10331033{
    10341034    m_ImagesLock.lock();
    10351035    if (m_Images.size() > 0)
     
    10521052        QRect area = GetArea().toQRect();
    10531053        area.translate(xoffset, yoffset);
    10541054
    1055         int alpha = CalcAlpha(alphaMod);
     1055        fx.alpha = CalcAlpha(fx.alpha);
    10561056
    10571057        MythImage *currentImage = m_Images[m_CurPos];
    10581058        if (currentImage)
     
    10881088        else
    10891089            srcRect = currentImageArea;
    10901090
    1091         p->DrawImage(area, currentImage, srcRect, alpha);
     1091        p->DrawImage(area, currentImage, srcRect, fx);
    10921092        currentImage->DownRef();
    10931093        d->m_UpdateLock.unlock();
    10941094    }
  • libs/libmythui/mythuitext.cpp

     
    281281}
    282282
    283283void MythUIText::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    284                           int alphaMod, QRect clipRect)
     284                          Effects fx, QRect clipRect)
    285285{
    286286    QRect area = GetArea().toQRect();
    287287    area.translate(xoffset, yoffset);
    288288    QRect drawrect = m_drawRect.toQRect();
    289289    drawrect.translate(xoffset, yoffset);
    290290
    291     int alpha = CalcAlpha(alphaMod);
     291    fx.alpha = CalcAlpha(fx.alpha);
    292292
    293     p->DrawText(drawrect, m_CutMessage, m_Justification, *m_Font, alpha, area);
     293    p->DrawText(drawrect, m_CutMessage, m_Justification, *m_Font, fx, area);
    294294}
    295295
    296296/*
  • libs/libmythui/mythuiguidegrid.cpp

     
    291291}
    292292
    293293void MythUIGuideGrid::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    294                                int alphaMod, QRect clipRect)
     294                               Effects fx, QRect clipRect)
    295295{
     296    int alphaMod = fx.alpha;
    296297    for (int i = 0; i < m_rowCount; i++)
    297298    {
    298299        QList<UIGTCon*>::iterator it = allData[i].begin();
     
    383384    QRect area = data->drawArea;
    384385    area.translate(m_Area.x(), m_Area.y());
    385386    area.adjust(breakin, breakin, -breakin, -breakin);
     387    Effects fx;
     388    fx.alpha = CalcAlpha(alphaMod);
    386389
    387390    // draw arrows
    388391    if (data->arrow != 0)
     
    392395            if (m_verticalLayout)
    393396            {
    394397                p->DrawImage(area.left() + (area.width() / 2) - (m_arrowImages[2]->width() / 2),
    395                              area.top() , m_arrowImages[2], alphaMod);
     398                             area.top() , m_arrowImages[2], fx);
    396399            }
    397400            else
    398401            {
    399402                p->DrawImage(area.left(), area.top() + (area.height() / 2) -
    400                             (m_arrowImages[0]->height() / 2), m_arrowImages[0], alphaMod);
     403                            (m_arrowImages[0]->height() / 2), m_arrowImages[0], fx);
    401404            }
    402405        }
    403406        if (data->arrow == 2 || data->arrow == 3)
     
    405408            if (m_verticalLayout)
    406409            {
    407410                p->DrawImage(area.left() + (area.width() / 2) - (m_arrowImages[3]->width() / 2),
    408                             area.top() + area.height() - m_arrowImages[3]->height(), m_arrowImages[3], alphaMod);
     411                            area.top() + area.height() - m_arrowImages[3]->height(), m_arrowImages[3], fx);
    409412            }
    410413            else
    411414            {
    412415                p->DrawImage(area.right() - m_arrowImages[1]->width(),
    413416                            area.top() + (area.height() / 2) -
    414                             (m_arrowImages[1]->height() / 2), m_arrowImages[1], alphaMod);
     417                            (m_arrowImages[1]->height() / 2), m_arrowImages[1], fx);
    415418            }
    416419        }
    417420    }
     
    421424    {
    422425        p->DrawImage(area.right() - m_recImages[data->recType]->width(),
    423426                     area.bottom() - m_recImages[data->recType]->height(),
    424                      m_recImages[data->recType], alphaMod);
     427                     m_recImages[data->recType], fx);
    425428    }
    426429}
    427430
     
    521524    if (m_drawCategoryText && !data->category.isEmpty())
    522525        msg += QString(" (%1)").arg(data->category);
    523526
     527    Effects fx;
     528    fx.alpha = CalcAlpha(alphaMod);
     529
    524530    QRect area = data->drawArea;
    525531    area.translate(m_Area.x(), m_Area.y());
    526532    area.adjust(m_textOffset.x(), m_textOffset.y(),
     
    544550    if (area.width() <= 0 || area.height() <= 0)
    545551        return;
    546552
    547     p->DrawText(area, msg, m_justification, *m_font, alphaMod, area);
     553    p->DrawText(area, msg, m_justification, *m_font, fx, area);
    548554}
    549555
    550556void MythUIGuideGrid::SetProgramInfo(int row, int col, const QRect &area,
  • libs/libmythui/mythpainter_ogl.cpp

     
    182182}
    183183
    184184void MythOpenGLPainter::DrawImage(const QRect &r, MythImage *im,
    185                                   const QRect &src, int alpha)
     185                                  const QRect &src, const Effects &fx)
    186186{
    187187
    188188    if (realRender)
    189189        realRender->DrawBitmap(GetTextureFromCache(im), target,
    190                                &src, &r, 0, alpha);
     190                               &src, &r, 0, &fx);
    191191}
    192192
    193193MythImage *MythOpenGLPainter::GetImageFromString(const QString &msg,
     
    307307
    308308void MythOpenGLPainter::DrawText(const QRect &r, const QString &msg,
    309309                                 int flags, const MythFontProperties &font,
    310                                  int alpha, const QRect &boundRect)
     310                                 const Effects &fx, const QRect &boundRect)
    311311{
    312312    if (r.width() <= 0 || r.height() <= 0)
    313313        return;
     
    352352        srcRect.setRect(x,y,width,height);
    353353    }
    354354
    355     DrawImage(destRect, im, srcRect, alpha);
     355    DrawImage(destRect, im, srcRect, fx);
    356356}
    357357
    358358void MythOpenGLPainter::DrawRect(const QRect &area,
     
    400400
    401401    MythImage *im = GetFormatImage();
    402402    im->Assign(image);
    403     MythPainter::DrawImage(area.x(), area.y(), im, 255);
     403
     404    Effects fx = { 255 };
     405
     406    MythPainter::DrawImage(area.x(), area.y(), im, fx);
    404407    im->DownRef();
    405408}
    406409
  • libs/libmythui/mythrender_vdpau.cpp

     
    617617    m_outputSurfaces.insert(id, VDPAUOutputSurface(tmp, size, fmt));
    618618    id_lock.unlock();
    619619
    620     DrawBitmap(0, id, NULL, NULL);
     620    DrawBitmap(0, id, NULL, NULL, NULL);
    621621    return id;
    622622}
    623623
     
    13081308
    13091309bool MythRenderVDPAU::DrawBitmap(uint id, uint target,
    13101310                                 const QRect *src, const QRect *dst,
    1311                                  int alpha, int red, int green, int blue,
     1311                                 const Effects *fx, int red, int green, int blue,
    13121312                                 bool blend)
    13131313{
    13141314    uint bitmap = VDP_INVALID_HANDLE;
     
    13571357        vsrc.y1 = src->y() + src->height();
    13581358    }
    13591359
     1360    int alpha = 255;
     1361    if (fx)
     1362    {
     1363        alpha = fx->alpha;
     1364    }
     1365
    13601366    VdpColor color;
    13611367    bool nullblend = (red == 0 && green == 0 && blue == 0 && alpha == 0);
    13621368    if (!nullblend)
  • libs/libmythui/mythuiwebbrowser.cpp

     
    628628 *  \copydoc MythUIType::DrawSelf()
    629629 */
    630630void MythUIWebBrowser::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    631                        int alphaMod, QRect clipRegion)
     631                       Effects fx, QRect clipRegion)
    632632{
    633633    if (!m_image || m_image->isNull() || !m_browser || m_browser->hasFocus())
    634634        return;
     
    636636    QRect area = m_Area;
    637637    area.translate(xoffset, yoffset);
    638638
    639     p->DrawImage(area.x(), area.y(), m_image, alphaMod);
     639    p->DrawImage(area.x(), area.y(), m_image, fx);
    640640}
    641641
    642642/**
  • libs/libmythui/mythrender_opengl.cpp

     
    894894}
    895895
    896896void MythRenderOpenGL::DrawBitmap(uint tex, uint target, const QRect *src,
    897                                   const QRect *dst, uint prog, int alpha,
     897                                  const QRect *dst, uint prog, const Effects *fx,
    898898                                  int red, int green, int blue)
    899899{
    900900    if (tex && !m_textures.contains(tex))
     
    931931    BindFramebuffer(target);
    932932    EnableFragmentProgram(prog);
    933933    SetBlend(true);
    934     SetColor(red, green, blue, alpha);
     934    SetColor(red, green, blue, fx->alpha);
    935935    if (tex)
    936936    {
    937937        EnableTextures(tex);
  • libs/libmythui/mythuiimage.h

     
    6161
    6262  protected:
    6363    virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
    64                           int alphaMod, QRect clipRect);
     64                          Effects fx, QRect clipRect);
    6565
    6666    void Init(void);
    6767    void Clear(void);
  • libs/libmythui/mythpainter_qimage.h

     
    3333    virtual void Clear(QPaintDevice *device, const QRegion &region);
    3434
    3535    virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src,
    36                            int alpha);
     36                           const Effects &fx);
    3737    virtual void DrawText(const QRect &dest, const QString &msg, int flags,
    38                           const MythFontProperties &font, int alpha,
     38                          const MythFontProperties &font, const Effects &fx,
    3939                          const QRect &boundRect);
    4040    virtual void DrawRect(const QRect &area,
    4141                          bool drawFill, const QColor &fillColor,