Permalink
Browse files

move invalid use of MarkDirtyRegion to SetInvalid

  • Loading branch information...
1 parent 319fe65 commit a25a163282da2409249dcbc77a13bb75821c06f5 Jonathan Marshall committed Jan 23, 2012
@@ -1196,7 +1196,7 @@ void CGUIBaseContainer::SetCursor(int cursor)
void CGUIBaseContainer::SetOffset(int offset)
{
if (m_offset != offset)
- MarkDirtyRegion();
+ SetInvalid();
m_offset = offset;
}
@@ -233,7 +233,7 @@ void CGUIButtonControl::SetPosition(float posX, float posY)
void CGUIButtonControl::SetAlpha(unsigned char alpha)
{
if (m_alpha != alpha)
- MarkDirtyRegion();
+ SetInvalid();
m_alpha = alpha;
}
@@ -402,8 +402,6 @@ void CGUIControl::SetPosition(float posX, float posY)
{
if ((m_posX != posX) || (m_posY != posY))
{
- MarkDirtyRegion();
-
m_hitRect += CPoint(posX - m_posX, posY - m_posY);
m_posX = posX;
m_posY = posY;
@@ -482,7 +480,6 @@ void CGUIControl::SetWidth(float width)
{
if (m_width != width)
{
- MarkDirtyRegion();
m_width = width;
m_hitRect.x2 = m_hitRect.x1 + width;
SetInvalid();
@@ -493,7 +490,6 @@ void CGUIControl::SetHeight(float height)
{
if (m_height != height)
{
- MarkDirtyRegion();
m_height = height;
m_hitRect.y2 = m_hitRect.y1 + height;
SetInvalid();
@@ -647,28 +643,24 @@ void CGUIControl::SetVisibleCondition(const CStdString &expression, const CStdSt
void CGUIControl::SetAnimations(const vector<CAnimation> &animations)
{
m_animations = animations;
- MarkDirtyRegion();
+ SetInvalid();
}
void CGUIControl::ResetAnimation(ANIMATION_TYPE type)
{
- MarkDirtyRegion();
-
for (unsigned int i = 0; i < m_animations.size(); i++)
{
if (m_animations[i].GetType() == type)
m_animations[i].ResetAnimation();
}
+ SetInvalid();
}
void CGUIControl::ResetAnimations()
{
- MarkDirtyRegion();
-
for (unsigned int i = 0; i < m_animations.size(); i++)
m_animations[i].ResetAnimation();
-
- MarkDirtyRegion();
+ SetInvalid();
}
bool CGUIControl::CheckAnimation(ANIMATION_TYPE animType)
@@ -698,7 +690,6 @@ bool CGUIControl::CheckAnimation(ANIMATION_TYPE animType)
void CGUIControl::QueueAnimation(ANIMATION_TYPE animType)
{
- MarkDirtyRegion();
if (!CheckAnimation(animType))
return;
CAnimation *reverseAnim = GetAnimation((ANIMATION_TYPE)-animType, false);
@@ -721,6 +712,7 @@ void CGUIControl::QueueAnimation(ANIMATION_TYPE animType)
if (reverseAnim) reverseAnim->ResetAnimation();
UpdateStates(animType, ANIM_PROCESS_NORMAL, ANIM_STATE_APPLIED);
}
+ SetInvalid();
}
CAnimation *CGUIControl::GetAnimation(ANIMATION_TYPE type, bool checkConditions /* = true */)
@@ -313,7 +313,7 @@ void CGUIImage::SetFileName(const CStdString& strFileName, bool setConstant)
if (m_texture.ReadyToRender() || m_texture.GetFileName().IsEmpty())
{ // save the current image
m_fadingTextures.push_back(new CFadingTexture(m_texture, m_currentFadeTime));
- MarkDirtyRegion();
+ SetInvalid();
}
m_currentFadeTime = 0;
}
@@ -322,7 +322,7 @@ void CGUIImage::SetFileName(const CStdString& strFileName, bool setConstant)
// we'll check whether it loaded or not in Render()
m_currentTexture = strFileName;
if (m_texture.SetFileName(m_currentTexture))
- MarkDirtyRegion();
+ SetInvalid();
}
}
@@ -55,7 +55,7 @@ void CGUILabelControl::SetCursorPos(int iPos)
if (iPos < 0) iPos = 0;
if (m_iCursorPos != iPos)
- MarkDirtyRegion();
+ SetInvalid();
m_iCursorPos = iPos;
}
@@ -106,7 +106,7 @@ void CGUILabelControl::UpdateInfo(const CGUIListItem *item)
changed |= m_label.SetText(label);
if (changed)
- MarkDirtyRegion();
+ SetInvalid();
}
void CGUILabelControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
@@ -152,7 +152,7 @@ void CGUILabelControl::SetLabel(const string &strLabel)
void CGUILabelControl::SetWidthControl(float minWidth, bool bScroll)
{
if (m_label.SetScrolling(bScroll) || m_minWidth != minWidth)
- MarkDirtyRegion();
+ SetInvalid();
m_minWidth = minWidth;
}
@@ -161,7 +161,7 @@ void CGUILabelControl::SetAlignment(uint32_t align)
{
if (m_label.GetLabelInfo().align != align)
{
- MarkDirtyRegion();
+ SetInvalid();
m_label.GetLabelInfo().align = align;
}
}
@@ -220,7 +220,7 @@ CStdString CGUILabelControl::ShortenPath(const CStdString &path)
}
if (m_label.SetText(workPath))
- MarkDirtyRegion();
+ SetInvalid();
float textWidth = m_label.GetTextWidth();
@@ -237,7 +237,7 @@ CStdString CGUILabelControl::ShortenPath(const CStdString &path)
workPath.replace( nPos + 1, nGreaterDelim - nPos - 1, "..." );
if (m_label.SetText(workPath))
- MarkDirtyRegion();
+ SetInvalid();
textWidth = m_label.GetTextWidth();
}
@@ -78,7 +78,7 @@ bool CGUIRadioButtonControl::OnAction(const CAction &action)
if (action.GetID() == ACTION_SELECT_ITEM)
{
m_bSelected = !m_bSelected;
- MarkDirtyRegion();
+ SetInvalid();
}
return CGUIButtonControl::OnAction(action);
}
@@ -185,7 +185,7 @@ void CGUISpinControl::OnLeft()
{
// select the down button
m_iSelect = SPIN_BUTTON_DOWN;
- MarkDirtyRegion();
+ SetInvalid();
}
else
{ // base class
@@ -199,7 +199,7 @@ void CGUISpinControl::OnRight()
{
// select the up button
m_iSelect = SPIN_BUTTON_UP;
- MarkDirtyRegion();
+ SetInvalid();
}
else
{ // base class
@@ -889,7 +889,7 @@ bool CGUISpinControl::OnMouseOver(const CPoint &point)
m_iSelect = SPIN_BUTTON_UP;
if (select != m_iSelect)
- MarkDirtyRegion();
+ SetInvalid();
return CGUIControl::OnMouseOver(point);
}

0 comments on commit a25a163

Please sign in to comment.