コード例 #1
0
Image* FixedBackgroundImageLayerAndroid::GetCachedImage(PassRefPtr<RenderStyle> aStyle)
{
    RefPtr<RenderStyle> style = aStyle;
    if (!style)
        return 0;

    if (!style->hasFixedBackgroundImage())
        return 0;

    FillLayer* layers = style->accessBackgroundLayers();
    StyleImage* styleImage = layers->image();

    if (!styleImage)
        return 0;

    if (!styleImage->isLoaded())
        return 0;

    if (!styleImage->isCachedImage())
        return 0;

    CachedImage* cachedImage = static_cast<StyleCachedImage*>(styleImage)->cachedImage();

    Image* image = cachedImage->image();
    bool willPaintBrokenImage = cachedImage->willPaintBrokenImage();   //SAMSUNG_CHANGES -- MPSG6322 & MPSG6356

    if (image && !image->nativeImageForCurrentFrame())
        return 0;

    //SAMSUNG_CHANGES -- MPSG6322 & MPSG6356
    //WAS: if (image == Image::nullImage())
    if (image == Image::nullImage() || willPaintBrokenImage)
        return 0;

    return image;
}