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