本文整理汇总了C++中DisplayModel::ShouldCacheRendering方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplayModel::ShouldCacheRendering方法的具体用法?C++ DisplayModel::ShouldCacheRendering怎么用?C++ DisplayModel::ShouldCacheRendering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayModel
的用法示例。
在下文中一共展示了DisplayModel::ShouldCacheRendering方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
void StressTest::OnTimer(int timerIdGot)
{
CrashIf(timerId != timerIdGot);
KillTimer(win->hwndFrame, timerId);
if (!win->IsDocLoaded()) {
if (!GoToNextFile()) {
Finished(true);
return;
}
TickTimer();
return;
}
// chm documents aren't rendered and we block until we show them
// so we can assume previous page has been shown and go to next page
if (!win->AsFixed()) {
if (!GoToNextPage())
return;
goto Next;
}
// For non-image files, we detect if a page was rendered by checking the cache
// (but we don't wait more than 3 seconds).
// Image files are always fully rendered in WM_PAINT, so we know the page
// has already been rendered.
DisplayModel *dm = win->AsFixed();
bool didRender = gRenderCache.Exists(dm, currPage, dm->GetRotation());
if (!didRender && dm->ShouldCacheRendering(currPage)) {
double timeInMs = currPageRenderTime.GetTimeInMs();
if (timeInMs > 3.0 * 1000) {
if (!GoToNextPage())
return;
}
}
else if (!GoToNextPage()) {
return;
}
MakeRandomSelection(win, currPage);
Next:
TickTimer();
}