当前位置: 首页>>代码示例>>C++>>正文


C++ RenderImageResource类代码示例

本文整理汇总了C++中RenderImageResource的典型用法代码示例。如果您正苦于以下问题:C++ RenderImageResource类的具体用法?C++ RenderImageResource怎么用?C++ RenderImageResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RenderImageResource类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: renderImageResource

void ImageLoader::updateRenderer()
{
    RenderImageResource* imageResource = renderImageResource();

    if (!imageResource)
        return;

    // Only update the renderer if it doesn't have an image or if what we have
    // is a complete image.  This prevents flickering in the case where a dynamic
    // change is happening between two images.
    CachedImage* cachedImage = imageResource->cachedImage();
    if (m_image != cachedImage && (m_imageComplete || !cachedImage))
        imageResource->setCachedImage(m_image.get());
}
开发者ID:windyuuy,项目名称:opera,代码行数:14,代码来源:ImageLoader.cpp

示例2: toRenderImage

void ImageElement::setImageIfNecessary(RenderObject* renderObject, ImageLoader* imageLoader)
{
    if (renderObject && renderObject->isImage() && !imageLoader->hasPendingBeforeLoadEvent()) {
        RenderImage* renderImage = toRenderImage(renderObject);
        RenderImageResource* renderImageResource = renderImage->imageResource();
        if (renderImageResource->hasImage())
            return;
        renderImageResource->setCachedImage(imageLoader->image());

        // If we have no image at all because we have no src attribute, set
        // image height and width for the alt text instead.
        if (!imageLoader->image() && !renderImageResource->cachedImage())
            renderImage->setImageSizeForAltText();
    }
}
开发者ID:kcomkar,项目名称:webkit,代码行数:15,代码来源:HTMLImageElement.cpp

示例3: toRenderImage

void TextFieldDecorationElement::updateImage()
{
    if (!renderer() || !renderer()->isImage())
        return;
    RenderImageResource* resource = toRenderImage(renderer())->imageResource();
    CachedImage* image;
    if (hostInput()->disabled())
        image = m_textFieldDecorator->imageForDisabledState();
    else if (hostInput()->readOnly())
        image = m_textFieldDecorator->imageForReadonlyState();
    else
        image = m_textFieldDecorator->imageForNormalState();
    ASSERT(image);
    resource->setCachedImage(image);
}
开发者ID:yoavweiss,项目名称:RespImg-WebKit,代码行数:15,代码来源:TextFieldDecorationElement.cpp

示例4: toRenderImage

void HTMLImageElement::attach(const AttachContext& context)
{
    HTMLElement::attach(context);

    if (renderer() && renderer()->isImage()) {
        RenderImage* renderImage = toRenderImage(renderer());
        RenderImageResource* renderImageResource = renderImage->imageResource();
        if (renderImageResource->hasImage())
            return;

        // If we have no image at all because we have no src attribute, set
        // image height and width for the alt text instead.
        if (!imageLoader().image() && !renderImageResource->cachedImage())
            renderImage->setImageSizeForAltText();
        else
            renderImageResource->setImageResource(imageLoader().image());

    }
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:19,代码来源:HTMLImageElement.cpp

示例5: element

void ImageInputType::startResourceLoading()
{
    BaseButtonInputType::startResourceLoading();

    HTMLImageLoader* imageLoader = element().imageLoader();
    imageLoader->updateFromElement();

    RenderImage* renderer = toRenderImage(element().renderer());
    if (!renderer)
        return;

    RenderImageResource* imageResource = renderer->imageResource();
    imageResource->setImageResource(imageLoader->image());

    // If we have no image at all because we have no src attribute, set
    // image height and width for the alt text instead.
    if (!imageLoader->image() && !imageResource->cachedImage())
        renderer->setImageSizeForAltText();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:19,代码来源:ImageInputType.cpp

示例6: adoptPtr

void ImageInputType::attach()
{
    BaseButtonInputType::attach();

    if (!m_imageLoader)
        m_imageLoader = adoptPtr(new HTMLImageLoader(element()));
    m_imageLoader->updateFromElement();

    RenderImage* renderer = toRenderImage(element()->renderer());
    if (!renderer)
        return;

    if (m_imageLoader->hasPendingBeforeLoadEvent())
        return;

    RenderImageResource* imageResource = renderer->imageResource();
    imageResource->setCachedImage(m_imageLoader->image()); 

    // If we have no image at all because we have no src attribute, set
    // image height and width for the alt text instead.
    if (!m_imageLoader->image() && !imageResource->cachedImage())
        renderer->setImageSizeForAltText();
}
开发者ID:dog-god,项目名称:iptv,代码行数:23,代码来源:ImageInputType.cpp


注:本文中的RenderImageResource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。