本文整理汇总了C++中webcore::Image::nativeImageForCurrentFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::nativeImageForCurrentFrame方法的具体用法?C++ Image::nativeImageForCurrentFrame怎么用?C++ Image::nativeImageForCurrentFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::Image
的用法示例。
在下文中一共展示了Image::nativeImageForCurrentFrame方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LayerAndroid
FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(PassRefPtr<RenderStyle> aStyle,
int w, int h)
: LayerAndroid((RenderLayer*)0)
, m_width(w)
, m_height(h)
{
RefPtr<RenderStyle> style = aStyle;
FillLayer* layers = style->accessBackgroundLayers();
StyleImage* styleImage = layers->image();
CachedImage* cachedImage = static_cast<StyleCachedImage*>(styleImage)->cachedImage();
WebCore::Image* image = cachedImage->image();
setContentsImage(image->nativeImageForCurrentFrame());
setSize(image->width(), image->height());
setIntrinsicallyComposited(true);
SkLength left, top;
left = SkLength::convertLength(style->backgroundXPosition());
top = SkLength::convertLength(style->backgroundYPosition());
BackgroundImagePositioning* position = new BackgroundImagePositioning(this);
position->setRepeatX(style->backgroundRepeatX() != WebCore::NoRepeatFill);
position->setRepeatY(style->backgroundRepeatY() != WebCore::NoRepeatFill);
setFixedPosition(position);
position->setPosition(left, top);
#ifdef DEBUG_COUNT
ClassTracker::instance()->increment("FixedBackgroundImageLayerAndroid");
#endif
}
示例2: ewk_settings_icon_database_icon_surface_get
/**
* Query icon for given URL, returning associated cairo surface.
*
* @note in order to have this working, one must open icon database
* with ewk_settings_icon_database_path_set().
*
* @param url which url to query icon.
*
* @return cairo surface if any, or NULL on failure.
*/
cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url));
WebCore::Image *icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
if (!icon) {
ERR("no icon for url %s", url);
return 0;
}
return icon->nativeImageForCurrentFrame();
}
示例3: imageContents
WebImage WebElement::imageContents()
{
if (isNull())
return WebImage();
WebCore::Image* image = unwrap<Element>()->imageContents();
if (!image)
return WebImage();
RefPtr<NativeImageSkia> bitmap = image->nativeImageForCurrentFrame();
if (!bitmap)
return WebImage();
return bitmap->bitmap();
}
示例4: ewk_settings_icon_database_icon_object_get
Evas_Object* ewk_settings_icon_database_icon_object_get(const char* url, Evas* canvas)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url));
WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
if (!icon) {
ERR("no icon for url %s", url);
return 0;
}
WebCore::NativeImageCairo* nativeImage = icon->nativeImageForCurrentFrame();
return nativeImage ? ewk_util_image_from_cairo_surface_add(canvas, nativeImage->surface()) : 0;
}
示例5: ewk_settings_icon_database_icon_object_add
/**
* Create Evas_Object of type image representing the given URL.
*
* This is an utility function that creates an Evas_Object of type
* image set to have fill always match object size
* (evas_object_image_filled_add()), saving some code to use it from Evas.
*
* @note in order to have this working, one must open icon database
* with ewk_settings_icon_database_path_set().
*
* @param url which url to query icon.
* @param canvas evas instance where to add resulting object.
*
* @return newly allocated Evas_Object instance or @c NULL on
* errors. Delete the object with evas_object_del().
*/
Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* canvas)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url));
WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
cairo_surface_t* surface;
if (!icon) {
ERR("no icon for url %s", url);
return 0;
}
surface = icon->nativeImageForCurrentFrame();
return ewk_util_image_from_cairo_surface_add(canvas, surface);
}
示例6: isContentEditable
QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest)
: isContentEditable(false)
, isContentSelected(false)
, isScrollBar(false)
{
if (!hitTest.innerNode())
return;
pos = hitTest.point();
boundingRect = hitTest.boundingBox();
title = hitTest.title();
linkText = hitTest.textContent();
linkUrl = hitTest.absoluteLinkURL();
linkTitle = hitTest.titleDisplayString();
alternateText = hitTest.altDisplayString();
imageUrl = hitTest.absoluteImageURL();
innerNode = hitTest.innerNode();
innerNonSharedNode = hitTest.innerNonSharedNode();
WebCore::Image *img = hitTest.image();
if (img) {
QPixmap *pix = img->nativeImageForCurrentFrame();
if (pix)
pixmap = *pix;
}
WebCore::Frame *wframe = hitTest.targetFrame();
if (wframe)
linkTargetFrame = QWebFramePrivate::kit(wframe);
isContentEditable = hitTest.isContentEditable();
isContentSelected = hitTest.isSelected();
isScrollBar = hitTest.scrollbar();
if (innerNonSharedNode && innerNonSharedNode->document()
&& innerNonSharedNode->document()->frame())
frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame());
if (Node *block = WebCore::enclosingBlock(innerNode.get())) {
RenderObject *renderBlock = block->renderer();
while (renderBlock && renderBlock->isListItem())
renderBlock = renderBlock->containingBlock();
if (renderBlock)
enclosingBlock = renderBlock->absoluteClippedOverflowRect();
}
}