Ticket #12489: 12489_0_28.patch

File 12489_0_28.patch, 3.9 KB (added by lomion@…, 8 years ago)

Updated patch for fixes/0.28

  • mythtv/libs/libmythui/mythuiimage.cpp

    diff --git a/mythtv/libs/libmythui/mythuiimage.cpp b/mythtv/libs/libmythui/mythuiimage.cpp
    index 02ce02e..6101bd7 100644
    a b void ImageProperties::Copy(const ImageProperties &other) 
    9393    preserveAspect = other.preserveAspect;
    9494    isGreyscale = other.isGreyscale;
    9595    isReflected = other.isReflected;
    96     isMasked = other.isMasked;
    9796    isOriented = other.isOriented;
    9897
    9998    reflectAxis = other.reflectAxis;
    void ImageProperties::Copy(const ImageProperties &other) 
    106105    isThemeImage = other.isThemeImage;
    107106
    108107    SetMaskImage(other.maskImage);
     108    isMasked = other.isMasked;
     109    maskImageFilename = other.maskImageFilename;
    109110}
    110111
    111112void ImageProperties::SetMaskImage(MythImage *image)
    class ImageLoader 
    357358
    358359            if (imProps.isMasked)
    359360            {
     361                MythImage *newMaskImage = painter->GetFormatImage();
     362                if (newMaskImage->Load(imProps.GetMaskImageFilename()))
     363                {
     364                    float wmult; // Width multipler
     365                    float hmult; // Height multipler
     366                    GetMythUI()->GetScreenSettings(wmult, hmult);
     367                    if (wmult != 1.0f || hmult != 1.0f)
     368                    {
     369                        int width = newMaskImage->size().width() * wmult;
     370                        int height = newMaskImage->size().height() * hmult;
     371                        newMaskImage->Resize(QSize(width, height));
     372                    }
     373
     374                    imProps.SetMaskImage(newMaskImage);
     375                }
     376                else
     377                    imProps.SetMaskImage(NULL);
     378                newMaskImage->DecrRef();
     379
    360380                QRect imageArea = image->rect();
    361381                QRect maskArea = imProps.GetMaskImageRect();
    362382
    363383                // Crop the mask to the image
    364384                int x = 0;
    365                 int y = 0;
     385                                int y = 0;
    366386
    367387                if (maskArea.width() > imageArea.width())
    368388                    x = (maskArea.width() - imageArea.width()) / 2;
    bool MythUIImage::ParseElement( 
    14391459    }
    14401460    else if (element.tagName() == "mask")
    14411461    {
    1442         QString maskfile = getFirstText(element);
    1443 
    1444         MythImage *newMaskImage = GetPainter()->GetFormatImage();
    1445         if (newMaskImage->Load(maskfile))
    1446         {
    1447             float wmult; // Width multipler
    1448             float hmult; // Height multipler
    1449             GetMythUI()->GetScreenSettings(wmult, hmult);
    1450             if (wmult != 1.0f || hmult != 1.0f)
    1451             {
    1452                 int width = newMaskImage->size().width() * wmult;
    1453                 int height = newMaskImage->size().height() * hmult;
    1454                 newMaskImage->Resize(QSize(width, height));
    1455             }
    1456 
    1457             m_imageProperties.SetMaskImage(newMaskImage);
    1458         }
    1459         else
    1460             m_imageProperties.SetMaskImage(NULL);
    1461         newMaskImage->DecrRef();
     1462        m_imageProperties.SetMaskImageFilename(getFirstText(element));
     1463        m_imageProperties.isMasked = true;
    14621464    }
    14631465    else if (element.tagName() == "grayscale" ||
    14641466             element.tagName() == "greyscale")
  • mythtv/libs/libmythui/mythuiimage.h

    diff --git a/mythtv/libs/libmythui/mythuiimage.h b/mythtv/libs/libmythui/mythuiimage.h
    index 7847c4a..f7c160d 100644
    a b class ImageProperties 
    3030    ImageProperties &operator=(const ImageProperties &other);
    3131
    3232    void SetMaskImage(MythImage *image);
     33        void SetMaskImageFilename(const QString filename)
     34        {
     35                maskImageFilename=filename;
     36        }
     37        QString GetMaskImageFilename()
     38        {
     39                return maskImageFilename;
     40        }
    3341    QRect GetMaskImageRect(void)
    3442    {
    3543        QRect rect;
    class ImageProperties 
    7381    void Copy(const ImageProperties &other);
    7482
    7583    MythImage *maskImage;
     84        QString maskImageFilename;
    7685};
    7786
    7887typedef QPair<MythImage *, int> AnimationFrame;