本文整理汇总了C++中CDirtyRegionList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CDirtyRegionList::size方法的具体用法?C++ CDirtyRegionList::size怎么用?C++ CDirtyRegionList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDirtyRegionList
的用法示例。
在下文中一共展示了CDirtyRegionList::size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Solve
void CGreedyDirtyRegionSolver::Solve(const CDirtyRegionList &input, CDirtyRegionList &output)
{
for (unsigned int i = 0; i < input.size(); i++)
{
CDirtyRegion possibleUnionRegion;
int possibleUnionNbr = -1;
float possibleUnionCost = 100000.0f;
CDirtyRegion currentRegion = input[i];
for (unsigned int j = 0; j < output.size(); j++)
{
CDirtyRegion temporaryUnion = output[j];
temporaryUnion.Union(currentRegion);
float temporaryCost = m_costPerArea * (temporaryUnion.Area() - output[j].Area());
if (temporaryCost < possibleUnionCost)
{
// TODO if the temporaryCost is 0 then we could skip checking the other regions since there exist no better solution
possibleUnionRegion = temporaryUnion;
possibleUnionNbr = j;
possibleUnionCost = temporaryCost;
}
}
float newRegionTotalCost = m_costPerArea * currentRegion.Area() + m_costNewRegion;
if (possibleUnionNbr >= 0 && possibleUnionCost < newRegionTotalCost)
output[possibleUnionNbr] = possibleUnionRegion;
else
output.push_back(currentRegion);
}
}
示例2: Render
bool CGUIWindowManager::Render()
{
/*
参数:
1、
返回:
1、
说明:
1、
*/
assert(g_application.IsCurrentThread());
CSingleLock lock(g_graphicsContext);
CDirtyRegionList dirtyRegions = m_tracker.GetDirtyRegions();
bool hasRendered = false;
// If we visualize the regions we will always render the entire viewport
if (g_advancedSettings.m_guiVisualizeDirtyRegions || g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_FILL_VIEWPORT_ALWAYS)
{
RenderPass();
hasRendered = true;
}
else if (g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_FILL_VIEWPORT_ON_CHANGE)
{
if (dirtyRegions.size() > 0)
{
RenderPass();
hasRendered = true;
}
}
else
{
for (CDirtyRegionList::const_iterator i = dirtyRegions.begin(); i != dirtyRegions.end(); i++)
{
if (i->IsEmpty())
continue;
g_graphicsContext.SetScissors(*i);
RenderPass();
hasRendered = true;
}
g_graphicsContext.ResetScissors();
}
if (g_advancedSettings.m_guiVisualizeDirtyRegions)
{
g_graphicsContext.SetRenderingResolution(g_graphicsContext.GetResInfo(), false);
const CDirtyRegionList &markedRegions = m_tracker.GetMarkedRegions();
for (CDirtyRegionList::const_iterator i = markedRegions.begin(); i != markedRegions.end(); i++)
CGUITexture::DrawQuad(*i, 0x0fff0000);
for (CDirtyRegionList::const_iterator i = dirtyRegions.begin(); i != dirtyRegions.end(); i++)
CGUITexture::DrawQuad(*i, 0x4c00ff00);
}
m_tracker.CleanMarkedRegions();
return hasRendered;
}
示例3: Process
void CGUIControlGroup::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
CPoint pos(GetPosition());
g_graphicsContext.SetOrigin(pos.x, pos.y);
CRect rect;
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl *control = *it;
control->UpdateVisibility();
unsigned int oldDirty = dirtyregions.size();
control->DoProcess(currentTime, dirtyregions);
if (control->IsVisible() || (oldDirty != dirtyregions.size())) // visible or dirty (was visible?)
rect.Union(control->GetRenderRegion());
}
g_graphicsContext.RestoreOrigin();
CGUIControl::Process(currentTime, dirtyregions);
m_renderRegion = rect;
}
示例4: Process
void CGUIListGroup::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
CServiceBroker::GetWinSystem()->GetGfxContext().SetOrigin(m_posX, m_posY);
CRect rect;
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl *control = *it;
control->UpdateVisibility(m_item);
unsigned int oldDirty = dirtyregions.size();
control->DoProcess(currentTime, dirtyregions);
if (control->IsVisible() || (oldDirty != dirtyregions.size())) // visible or dirty (was visible?)
rect.Union(control->GetRenderRegion());
}
CServiceBroker::GetWinSystem()->GetGfxContext().RestoreOrigin();
CGUIControl::Process(currentTime, dirtyregions);
m_renderRegion = rect;
m_item = NULL;
}
示例5: Solve
void CFillViewportOnChangeRegionSolver::Solve(const CDirtyRegionList &input, CDirtyRegionList &output)
{
if (input.size() > 0)
output.assign(1,g_graphicsContext.GetViewWindow());
}