CRect CGUIButtonControl::CalcRenderRegion() const { CRect buttonRect = CGUIControl::CalcRenderRegion(); CRect textRect = m_label.GetRenderRect(); buttonRect.Union(textRect); return buttonRect; }
// the main processing routine. // 1. animate and set animation transform // 2. if visible, process // 3. reset the animation transform void CGUIControl::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions) { CRect dirtyRegion = m_renderRegion; bool changed = m_bInvalidated; changed |= Animate(currentTime); m_cachedTransform = g_graphicsContext.AddTransform(m_transform); if (m_hasCamera) g_graphicsContext.SetCameraPosition(m_camera); if (IsVisible()) { Process(currentTime, dirtyregions); m_bInvalidated = false; } changed |= m_controlIsDirty; if (changed || dirtyRegion != m_renderRegion) { dirtyRegion.Union(m_renderRegion); dirtyregions.push_back(dirtyRegion); } if (m_hasCamera) g_graphicsContext.RestoreCameraPosition(); g_graphicsContext.RemoveTransform(); m_controlIsDirty = false; }
CRect CGUIImage::CalcRenderRegion() const { CRect region = m_texture.GetRenderRect(); for (vector<CFadingTexture *>::const_iterator itr = m_fadingTextures.begin(); itr != m_fadingTextures.end(); itr++) region.Union( (*itr)->m_texture->GetRenderRect() ); return CGUIControl::CalcRenderRegion().Intersect(region); }
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; }
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; }