本文整理汇总了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());
}
示例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();
}
}
示例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);
}
示例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());
}
}
示例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();
}
示例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();
}