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


C++ CachedImage::errorOccurred方法代码示例

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


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

示例1: writeImage

void Pasteboard::writeImage(Element& element, const URL&, const String& title)
{
    if (!(element.renderer() && element.renderer()->isRenderImage()))
        return;

    RenderImage* renderer = toRenderImage(element.renderer());
    CachedImage* cachedImage = renderer->cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return;
    Image* image = cachedImage->imageForRenderer(renderer);
    ASSERT(image);

    m_dataObject->clearAll();

    URL url = getURLForImageElement(element);
    if (!url.isEmpty()) {
        m_dataObject->setURL(url, title);

        m_dataObject->setMarkup(createMarkup(element, IncludeNode, 0, ResolveAllURLs));
    }

    GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf());
    m_dataObject->setImage(pixbuf.get());

    if (m_gtkClipboard)
        PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(m_gtkClipboard);
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:27,代码来源:PasteboardGtk.cpp

示例2: writeImage

void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
{
    ASSERT(node);

    if (!(node->renderer() && node->renderer()->isImage()))
        return;

    RenderImage* renderer = toRenderImage(node->renderer());
    CachedImage* cachedImage = renderer->cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return;
    Image* image = cachedImage->imageForRenderer(renderer);
    ASSERT(image);

    GtkClipboard* clipboard = gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD);
    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);

    KURL url = getURLForImageNode(node);
    if (!url.isEmpty()) {
        dataObject->setURL(url, title);

        dataObject->setMarkup(createMarkup(static_cast<Element*>(node), IncludeNode, 0, ResolveAllURLs));
    }

    GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf());
    dataObject->setImage(pixbuf.get());

    PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard);
}
开发者ID:1833183060,项目名称:wke,代码行数:29,代码来源:PasteboardGtk.cpp

示例3: writeImage

void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
{
    ASSERT(node);

    if (!(node->renderer() && node->renderer()->isImage()))
        return;

    RenderImage* renderer = toRenderImage(node->renderer());
    CachedImage* cachedImage = renderer->cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return;
    Image* image = cachedImage->imageForRenderer(renderer);
    ASSERT(image);

    NativeImagePtr bitmap = image->nativeImageForCurrentFrame();
    if (!bitmap)
        return;

    // If the image is wrapped in a link, |url| points to the target of the
    // link.  This isn't useful to us, so get the actual image URL.
    AtomicString urlString;
    if (node->hasTagName(HTMLNames::imgTag) || node->hasTagName(HTMLNames::inputTag))
        urlString = static_cast<Element*>(node)->getAttribute(HTMLNames::srcAttr);
#if ENABLE(SVG)
    else if (node->hasTagName(SVGNames::imageTag))
        urlString = static_cast<Element*>(node)->getAttribute(XLinkNames::hrefAttr);
#endif
    else if (node->hasTagName(HTMLNames::embedTag) || node->hasTagName(HTMLNames::objectTag)) {
        Element* element = static_cast<Element*>(node);
        urlString = element->getAttribute(element->imageSourceAttributeName());
    }
    KURL url = urlString.isEmpty() ? KURL() : node->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));

    PlatformSupport::clipboardWriteImage(bitmap, url, title);
}
开发者ID:Spencerx,项目名称:webkit,代码行数:35,代码来源:PasteboardChromium.cpp

示例4: getImage

static Image* getImage(Element* element)
{
    ASSERT(element);
    CachedImage* cachedImage = getCachedImage(element);
    // Don't use cachedImage->imageForRenderer() here as that may return BitmapImages for cached SVG Images.
    // Users of getImage() want access to the SVGImage, in order to figure out the filename extensions,
    // which would be empty when asking the cached BitmapImages.
    return (cachedImage && !cachedImage->errorOccurred()) ?
           cachedImage->image() : 0;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: notifyFinished

void HTMLImageLoader::notifyFinished(CachedResource*)
{    
    CachedImage* cachedImage = image();

    Element* elem = element();
    ImageLoader::notifyFinished(cachedImage);

    if ((cachedImage->errorOccurred() || cachedImage->httpStatusCodeErrorOccurred()) && elem->hasTagName(HTMLNames::objectTag))
        static_cast<HTMLObjectElement*>(elem)->renderFallbackContent();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:10,代码来源:HTMLImageLoader.cpp

示例6: getImageForElement

static bool getImageForElement(Element& element, RefPtr<Image>& image)
{
    auto* renderer = element.renderer();
    if (!is<RenderImage>(renderer))
        return false;

    CachedImage* cachedImage = downcast<RenderImage>(*renderer).cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return false;

    image = cachedImage->imageForRenderer(renderer);
    return image;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:13,代码来源:EditorGtk.cpp

示例7: writeImage

void Pasteboard::writeImage(Node* node, const KURL&, const String&)
{
    ASSERT(node && node->renderer() && node->renderer()->isImage());
    RenderImage* renderer = toRenderImage(node->renderer());
    CachedImage* cachedImage = renderer->cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return;
    Image* image = cachedImage->image();
    ASSERT(image);

    clear();

    HDC dc = GetDC(0);
    HDC compatibleDC = CreateCompatibleDC(0);
    HDC sourceDC = CreateCompatibleDC(0);
    OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height()));
    HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get());

    BitmapInfo bmInfo = BitmapInfo::create(image->size());

    HBITMAP coreBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
    HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap);
    image->getHBITMAP(coreBitmap);

#if !defined(NO_ALPHABLEND)
    BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
    AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(),
        sourceDC, 0, 0, image->width(), image->height(), bf);
#else
    StretchBlt(compatibleDC, 0, 0, image->width(), image->height(),
        sourceDC, 0, 0, image->width(), image->height(), SRCCOPY);
#endif

    SelectObject(sourceDC, oldSource);
    DeleteObject(coreBitmap);

    SelectObject(compatibleDC, oldBitmap);
    DeleteDC(sourceDC);
    DeleteDC(compatibleDC);
    ReleaseDC(0, dc);

    if (::OpenClipboard(m_owner)) {
        ::SetClipboardData(CF_BITMAP, resultBitmap.leakPtr());
        ::CloseClipboard();
    }
}
开发者ID:,项目名称:,代码行数:46,代码来源:

示例8: writeImage

void Pasteboard::writeImage(Node* node, const KURL&, const String&)
{
    ASSERT(node && node->renderer() && node->renderer()->isImage());

#ifndef QT_NO_CLIPBOARD
    CachedImage* cachedImage = toRenderImage(node->renderer())->cachedImage();
    if (!cachedImage || cachedImage->errorOccurred())
        return;

    Image* image = cachedImage->image();
    ASSERT(image);

    QPixmap* pixmap = image->nativeImageForCurrentFrame();
    if (!pixmap)
        return;
    QApplication::clipboard()->setPixmap(*pixmap, QClipboard::Clipboard);
#endif
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:18,代码来源:PasteboardQt.cpp

示例9: notifyFinished

void HTMLImageLoader::notifyFinished(CachedResource*)
{
    CachedImage* cachedImage = image();

    RefPtr<Element> element = this->element();
    ImageLoader::notifyFinished(cachedImage);

    bool loadError = cachedImage->errorOccurred() || cachedImage->response().httpStatusCode() >= 400;
    if (!loadError) {
        if (!element->inDocument()) {
            JSC::VM* vm = JSDOMWindowBase::commonVM();
            JSC::JSLockHolder lock(vm);
            vm->heap.reportExtraMemoryCost(cachedImage->encodedSize());
        }
    }

    if (loadError && element->hasTagName(HTMLNames::objectTag))
        static_cast<HTMLObjectElement*>(element.get())->renderFallbackContent();
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例10: notifyFinished

void HTMLImageLoader::notifyFinished(CachedResource*)
{
    CachedImage* cachedImage = image();

    RefPtr<Element> element = client()->sourceElement();
    ImageLoader::notifyFinished(cachedImage);

    bool loadError = cachedImage->errorOccurred() || cachedImage->response().httpStatusCode() >= 400;
#if USE(JSC)
    if (!loadError) {
        if (!element->inDocument()) {
            JSC::JSGlobalData* globalData = JSDOMWindowBase::commonJSGlobalData();
            JSC::JSLockHolder lock(globalData);
            globalData->heap.reportExtraMemoryCost(cachedImage->encodedSize());
        }
    }
#endif

    if (loadError && element->hasTagName(HTMLNames::objectTag))
        static_cast<HTMLObjectElement*>(element.get())->renderFallbackContent();
}
开发者ID:dog-god,项目名称:iptv,代码行数:21,代码来源:HTMLImageLoader.cpp


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