• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ requestResource函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: String

CachedImage* DocLoader::requestImage(const String& url)
{
    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
        resource->setLoading(true);
        cache()->loader()->load(this, resource, true);
    }
    return resource;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:9,代码来源:DocLoader.cpp


示例2: emit

void ObjectScene::syncQuad(Kite::KQuadCom *Quad) {
	auto pixItem = (QGraphicsPixmapItem *)Quad->getSceneItem();

	Kite::KRectF32 brect;
	Quad->getBoundingRect(brect);

	if (!Quad->getAtlasTextureArray().str.empty()) {
		Kite::KAtlasTextureArray *tarray = nullptr;
		emit(tarray = (Kite::KAtlasTextureArray *)requestResource(Quad->getAtlasTextureArray().str.c_str()));

		if (tarray) {
			auto atex = tarray->getItem(Quad->getTextureArrayIndex());
			if (atex) {
				Kite::KTexture *tex = atex->getTexture();
				if (tex) {
					Kite::KImage image;
					tex->getImage(image);
					QImage qimage(image.getPixelsData(), image.getWidth(), image.getHeight(), QImage::Format::Format_RGBA8888);
					auto procimgae = qimage.copy(Quad->getAtlasItem().xpos, Quad->getAtlasItem().ypos,
																	  Quad->getAtlasItem().width, Quad->getAtlasItem().height)
														  .mirrored(Quad->getAtlasItem().getFlipH(), !Quad->getAtlasItem().getFlipV())
														  .scaled(Quad->getWidth(), Quad->getHeight());

					//blend
					if (Quad->getBlendColor() != Kite::KColor(Kite::Colors::WHITE)) {
						QColor col(Quad->getBlendColor().getR(), Quad->getBlendColor().getG(),
								   Quad->getBlendColor().getB(), Quad->getBlendColor().getA());

						auto alpha = procimgae.alphaChannel();
						for (int x = 0; x != procimgae.width(); ++x) {
							for (int y(0); y != procimgae.height(); ++y) {
								if (qAlpha(procimgae.pixel(x, y)) == 0) continue; // transparrent pixels

								QColor icol(procimgae.pixel(x, y));
								icol.setRed(BLEND_Multiply(icol.red(), col.red()));
								icol.setBlue(BLEND_Multiply(icol.blue(), col.blue()));
								icol.setGreen(BLEND_Multiply(icol.green(), col.green()));
								procimgae.setPixel(x, y, icol.rgb());
							}
						}
						procimgae.setAlphaChannel(alpha);
					}

					pixItem->setPixmap(QPixmap::fromImage(procimgae));
					pixItem->setOpacity(Quad->getBlendColor().getGLA());
					return;
				}
			}
		}
	}
	
	QPixmap pm(Quad->getWidth(), Quad->getHeight());
	pm.fill(QColor(Quad->getBlendColor().getR(), Quad->getBlendColor().getG(), Quad->getBlendColor().getB(), Quad->getBlendColor().getA()));
	pixItem->setPixmap(pm);
	pixItem->setOpacity(Quad->getBlendColor().getGLA());
}
开发者ID:MrMilad,项目名称:Kite2D,代码行数:56,代码来源:objectscene.cpp


示例3:

CachedResourceHandle<CachedImage> CachedResourceLoader::requestImage(CachedResourceRequest& request)
{
    if (Frame* f = frame()) {
        if (f->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal) {
            KURL requestURL = request.resourceRequest().url();
            if (requestURL.isValid() && canRequest(CachedResource::ImageResource, requestURL))
                PingLoader::loadImage(f, requestURL);
            return 0;
        }
    }
    request.setDefer(clientDefersImage(request.resourceRequest().url()) ? CachedResourceRequest::DeferredByClient : CachedResourceRequest::NoDefer);
    return static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request).get());
}
开发者ID:fmalita,项目名称:webkit,代码行数:13,代码来源:CachedResourceLoader.cpp


示例4: String

CachedImage* DocLoader::requestImage(const String& url)
{
    if (Frame* f = frame()) {
        Settings* settings = f->settings();
        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
            return 0;
    }
    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
        resource->setLoading(true);
        cache()->loader()->load(this, resource, true);
    }
    return resource;
}
开发者ID:Marforius,项目名称:qt,代码行数:14,代码来源:DocLoader.cpp


示例5: requestCSSStyleSheet

CachedCSSStyleSheet* DocLoader::requestCSSStyleSheet(const String& url, const String& charset, bool isUserStyleSheet)
{
    // FIXME: Passing true for "skipCanLoadCheck" here in the isUserStyleSheet case  won't have any effect
    // if this resource is already in the cache. It's theoretically possible that what's in the cache already
    // is a load that failed because of the canLoad check. Probably not an issue in practice.
    CachedCSSStyleSheet *sheet = static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, &charset, isUserStyleSheet, !isUserStyleSheet));

    // A user style sheet can outlive its DocLoader so don't store any pointers to it
    if (sheet && isUserStyleSheet) {
        sheet->setDocLoader(0);
        m_docResources.remove(sheet->url());
    }
    
    return sheet;
}
开发者ID:Crawping,项目名称:davinci,代码行数:15,代码来源:DocLoader.cpp


示例6: requestResource

void DocLoader::requestPreload(CachedResource::Type type, const String& url, const String& charset)
{
    String encoding;
    if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
        encoding = charset.isEmpty() ? m_doc->frame()->loader()->encoding() : charset;

    CachedResource* resource = requestResource(type, url, encoding, true);
    if (!resource || m_preloads.contains(resource))
        return;
    resource->increasePreloadCount();
    m_preloads.add(resource);
#if PRELOAD_DEBUG
    printf("PRELOADING %s\n",  resource->url().latin1().data());
#endif
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:15,代码来源:DocLoader.cpp


示例7: qDebug

void AliveResourceInfoUpdater::update()
{
    qDebug()<<"-------------------------------------";
    qDebug()<<"Alive Resource Info Updateing....";
    qDebug()<<"-------------------------------------";

    AliveListRequester *aliverequester\
            = new AliveListRequester(alive_list_version \
                                     ,tracker \
                                     ,peer2res_version_map \
                                     ,offline_res_peer_list);
    connect(aliverequester, SIGNAL(error(QAbstractSocket::SocketError)), \
            this, SLOT(errorHandler_for_req_lst(QAbstractSocket::SocketError)));
    connect(aliverequester,  SIGNAL(destroyed()), \
            this, SLOT(requestResource()));

    aliverequester->start();
}
开发者ID:mightyvoice,项目名称:Simple-Downloader,代码行数:18,代码来源:alive_resource_list_updater.cpp


示例8: String

CachedImage* CachedResourceLoader::requestImage(ResourceRequest& request)
{
    if (Frame* f = frame()) {
        Settings* settings = f->settings();
        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
            return 0;

        if (f->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal) {
            KURL requestURL = request.url();
            if (requestURL.isValid() && canRequest(CachedResource::ImageResource, requestURL))
                PingLoader::loadImage(f, requestURL);
            return 0;
        }
    }
    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String()));
    if (autoLoadImages() && resource && resource->stillNeedsLoad())
        resource->load(this);
    return resource;
}
开发者ID:sealeks,项目名称:nsdavinci,代码行数:19,代码来源:CachedResourceLoader.cpp


示例9: String

CachedImage* DocLoader::requestImage(const String& url)
{
    if (Frame* f = frame()) {
        Settings* settings = f->settings();
        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
            return 0;
    }
    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
        if (shouldBlockNetworkImage(url)) {
            return resource;
        }
#endif
        resource->setLoading(true);
        cache()->loader()->load(this, resource, true);
    }
    return resource;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:19,代码来源:DocLoader.cpp


示例10: String

CachedImage* CachedResourceLoader::requestImage(const String& url)
{
    if (Frame* f = frame()) {
        Settings* settings = f->settings();
        if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
            return 0;

        if (f->loader()->pageDismissalEventBeingDispatched()) {
            KURL completeURL = m_document->completeURL(url);
            if (completeURL.isValid() && canRequest(CachedResource::ImageResource, completeURL))
                PingLoader::loadImage(f, completeURL);
            return 0;
        }
    }
    CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
    if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
        resource->setLoading(true);
        load(resource, true);
    }
    return resource;
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:21,代码来源:CachedResourceLoader.cpp


示例11: requestResource

void CachedResourceLoader::requestPreload(CachedResource::Type type, CachedResourceRequest& request, const String& charset)
{
    String encoding;
    if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
        encoding = charset.isEmpty() ? m_document->charset() : charset;

    request.setCharset(encoding);
    request.setForPreload(true);

    CachedResourceHandle<CachedResource> resource = requestResource(type, request);
    if (!resource || (m_preloads && m_preloads->contains(resource.get())))
        return;
    resource->increasePreloadCount();

    if (!m_preloads)
        m_preloads = adoptPtr(new ListHashSet<CachedResource*>);
    m_preloads->add(resource.get());

#if PRELOAD_DEBUG
    printf("PRELOADING %s\n",  resource->url().latin1().data());
#endif
}
开发者ID:fmalita,项目名称:webkit,代码行数:22,代码来源:CachedResourceLoader.cpp


示例12: requestCSSStyleSheet

CachedCSSStyleSheet* DocLoader::requestCSSStyleSheet(const String& url, const String& charset)
{
    return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, charset));
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:4,代码来源:DocLoader.cpp


示例13: requestResource

ResourcePtr<ImageResource> ResourceFetcher::fetchImage(FetchRequest& request)
{
    request.setDefer(clientDefersImage(request.resourceRequest().url()) ? FetchRequest::DeferredByClient : FetchRequest::NoDefer);
    ResourcePtr<Resource> resource = requestResource(Resource::Image, request);
    return resource && resource->type() == Resource::Image ? toImageResource(resource) : 0;
}
开发者ID:greg100795,项目名称:mojo,代码行数:6,代码来源:ResourceFetcher.cpp


示例14: ASSERT

ResourcePtr<FontResource> ResourceFetcher::fetchFont(FetchRequest& request)
{
    ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone);
    request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextFont);
    return toFontResource(requestResource(Resource::Font, request));
}
开发者ID:greg100795,项目名称:mojo,代码行数:6,代码来源:ResourceFetcher.cpp


示例15: requestScript

CachedScript* DocLoader::requestScript(const String& url, const String& charset)
{
    return static_cast<CachedScript*>(requestResource(CachedResource::Script, url, charset));
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:4,代码来源:DocLoader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ requestStackPush函数代码示例发布时间:2022-05-30
下一篇:
C++ requestRedraw函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap