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


C++ RenderProgress类代码示例

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


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

示例1: progressRect

IntRect RenderThemeGtk::calculateProgressRect(RenderObject* renderObject, const IntRect& fullBarRect)
{
    IntRect progressRect(fullBarRect);
    RenderProgress* renderProgress = toRenderProgress(renderObject);
    if (renderProgress->isDeterminate()) {
        int progressWidth = progressRect.width() * renderProgress->position();
        if (renderObject->style()->direction() == RTL)
            progressRect.setX(progressRect.x() + progressRect.width() - progressWidth);
        progressRect.setWidth(progressWidth);
        return progressRect;
    }

    double animationProgress = renderProgress->animationProgress();

    // Never let the progress rect shrink smaller than 2 pixels.
    int newWidth = max(2, progressRect.width() / progressActivityBlocks);
    int movableWidth = progressRect.width() - newWidth;
    progressRect.setWidth(newWidth);

    // We want the first 0.5 units of the animation progress to represent the
    // forward motion and the second 0.5 units to represent the backward motion,
    // thus we multiply by two here to get the full sweep of the progress bar with
    // each direction.
    if (animationProgress < 0.5)
        progressRect.setX(progressRect.x() + (animationProgress * 2 * movableWidth));
    else
        progressRect.setX(progressRect.x() + ((1.0 - animationProgress) * 2 * movableWidth));
    return progressRect;
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:29,代码来源:RenderThemeGtk.cpp

示例2: process_job

void process_job (Job& job)
{
	VERBOSE_OUT(3) << job.filename.c_str() << " -- " << std::endl;
	VERBOSE_OUT(3) << '\t'
				   << boost::format("w:%d, h:%d, a:%d, pxaspect:%f, imaspect:%f, span:%f")
                                    % job.desc.get_w()
                                    % job.desc.get_h()
                                    % job.desc.get_antialias()
                                    % job.desc.get_pixel_aspect()
                                    % job.desc.get_image_aspect()
                                    % job.desc.get_span()
                    << std::endl;

	VERBOSE_OUT(3) << '\t'
				   << boost::format("tl:[%f,%f], br:[%f,%f], focus:[%f,%f]")
                                    % job.desc.get_tl()[0]
                                    % job.desc.get_tl()[1]
                                    % job.desc.get_br()[0]
                                    % job.desc.get_br()[1]
                                    % job.desc.get_focus()[0]
                                    % job.desc.get_focus()[1]
                    << std::endl;

	RenderProgress p;
	p.task(job.filename + " ==> " + job.outfilename);

	if(job.sifout)
	{
		// todo: support containers
		if(!save_canvas(FileSystemNative::instance()->get_identifier(job.outfilename), job.canvas))
			throw (SynfigToolException(SYNFIGTOOL_RENDERFAILURE, _("Render Failure.")));
	}
	else
	{
		VERBOSE_OUT(1) << _("Rendering...") << std::endl;
		boost::chrono::system_clock::time_point start_timepoint =
            boost::chrono::system_clock::now();

		// Call the render member of the target
		if(!job.target->render(&p))
			throw (SynfigToolException(SYNFIGTOOL_RENDERFAILURE, _("Render Failure.")));

		if(SynfigToolGeneralOptions::instance()->should_print_benchmarks())
        {
            boost::chrono::duration<double> duration =
                boost::chrono::system_clock::now() - start_timepoint;

            std::cout << job.filename.c_str()
                      << _(": Rendered in ")
                      << duration.count()
                      << _(" seconds.") << std::endl;
        }
	}

	VERBOSE_OUT(1) << _("Done.") << std::endl;
}
开发者ID:BakaMANIA,项目名称:synfig,代码行数:56,代码来源:joblistprocessor.cpp

示例3: toRenderProgress

bool RenderThemeNix::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
    RenderProgress* renderProgress = toRenderProgress(o);
    WebKit::WebThemeEngine::ProgressBarExtraParams extraParams;
    extraParams.isDeterminate = renderProgress->isDeterminate();
    extraParams.position = renderProgress->position();
    extraParams.animationProgress = renderProgress->animationProgress();
    extraParams.animationStartTime = renderProgress->animationStartTime();
    themeEngine()->paintProgressBar(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams);

    return false;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:12,代码来源:RenderThemeNix.cpp

示例4: p

bool RenderThemeQStyle::paintProgressBar(RenderObject* o, const PaintInfo& pi, const IntRect& r)
{
    if (!o->isProgress())
        return true;

    StylePainterQStyle p(this, pi, o);
    if (!p.isValid())
        return true;

    p.styleOption.rect = r;
    RenderProgress* renderProgress = toRenderProgress(o);
    p.paintProgressBar(renderProgress->position(), renderProgress->animationProgress());
    return false;
}
开发者ID:anger123520,项目名称:qtwebkit-23_from_gitorious,代码行数:14,代码来源:RenderThemeQStyle.cpp

示例5: toRenderProgress

bool RenderThemeChromiumWin::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
    if (!o->isProgress())
        return true;

    RenderProgress* renderProgress = toRenderProgress(o);
    // For indeterminate bar, valueRect is ignored and it is computed by the theme engine
    // because the animation is a platform detail and WebKit doesn't need to know how.
    IntRect valueRect = renderProgress->isDeterminate() ? determinateProgressValueRectFor(renderProgress, r) : IntRect(0, 0, 0, 0);
    double animatedSeconds = renderProgress->animationStartTime() ?  WTF::currentTime() - renderProgress->animationStartTime() : 0;
    ThemePainter painter(i.context, r);
    ChromiumBridge::paintProgressBar(painter.context(), r, valueRect, renderProgress->isDeterminate(), animatedSeconds);
    return false;
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:14,代码来源:RenderThemeChromiumWin.cpp

示例6: toRenderProgress

bool RenderThemeChromiumLinux::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
    if (!o->isProgress())
        return true;

    RenderProgress* renderProgress = toRenderProgress(o);
    IntRect valueRect = progressValueRectFor(renderProgress, rect);

    PlatformSupport::ThemePaintExtraParams extraParams;
    extraParams.progressBar.determinate = renderProgress->isDeterminate();
    extraParams.progressBar.valueRectX = valueRect.x();
    extraParams.progressBar.valueRectY = valueRect.y();
    extraParams.progressBar.valueRectWidth = valueRect.width();
    extraParams.progressBar.valueRectHeight = valueRect.height();

    PlatformSupport::paintThemePart(i.context, PlatformSupport::PartProgressBar, getWebThemeState(this, o), rect, &extraParams);
    return false;
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:18,代码来源:RenderThemeChromiumLinux.cpp

示例7: p

bool RenderThemeQtMobile::paintProgressBar(RenderObject* o, const PaintInfo& pi, const IntRect& r)
{
    if (!o->isProgress())
        return true;

    StylePainterMobile p(this, pi);
    if (!p.isValid())
        return true;

    RenderProgress* renderProgress = toRenderProgress(o);
    const bool isRTL = (renderProgress->style()->direction() == RTL);

    if (renderProgress->isDeterminate())
        p.drawProgress(r, renderProgress->position(), !isRTL);
    else
        p.drawProgress(r, renderProgress->animationProgress(), !isRTL, true);

    return false;
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:19,代码来源:RenderThemeQtMobile.cpp

示例8: toRenderProgress

bool RenderThemeChromiumDefault::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
    if (!o->isProgress())
        return true;

    RenderProgress* renderProgress = toRenderProgress(o);
    IntRect valueRect = progressValueRectFor(renderProgress, rect);

    WebKit::WebThemeEngine::ExtraParams extraParams;
    extraParams.progressBar.determinate = renderProgress->isDeterminate();
    extraParams.progressBar.valueRectX = valueRect.x();
    extraParams.progressBar.valueRectY = valueRect.y();
    extraParams.progressBar.valueRectWidth = valueRect.width();
    extraParams.progressBar.valueRectHeight = valueRect.height();

    DirectionFlippingScope scope(o, i, rect);
    WebKit::WebCanvas* canvas = i.context->canvas();
    WebKit::Platform::current()->themeEngine()->paint(canvas, WebKit::WebThemeEngine::PartProgressBar, getWebThemeState(this, o), WebKit::WebRect(rect), &extraParams);
    return false;
}
开发者ID:windyuuy,项目名称:opera,代码行数:20,代码来源:RenderThemeChromiumDefault.cpp


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