• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MarkDirtyRegion函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MarkDirtyRegion函数的典型用法代码示例。如果您正苦于以下问题:C++ MarkDirtyRegion函数的具体用法?C++ MarkDirtyRegion怎么用?C++ MarkDirtyRegion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MarkDirtyRegion函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MarkDirtyRegion

void CGUIBaseContainer::UpdateScrollOffset(unsigned int currentTime)
{
  if (m_scroller.Update(currentTime))
    MarkDirtyRegion();
  else if (m_lastScrollStartTimer.IsRunning() && m_lastScrollStartTimer.GetElapsedMilliseconds() >= SCROLLING_GAP)
  {
    m_scrollTimer.Stop();
    m_lastScrollStartTimer.Stop();
  }
}
开发者ID:FernetMenta,项目名称:xbmc,代码行数:10,代码来源:GUIBaseContainer.cpp


示例2: MarkDirtyRegion

void CGUIControl::SetWidth(float width)
{
  if (m_width != width)
  {
    MarkDirtyRegion();
    m_width = width;
    m_hitRect.x2 = m_hitRect.x1 + width;
    SetInvalid();
  }
}
开发者ID:Karlson2k,项目名称:xbmc,代码行数:10,代码来源:GUIControl.cpp


示例3: MarkDirtyRegion

bool CGUIDialogTeletext::OnAction(const CAction& action)
{
  if (m_TextDecoder.HandleAction(action))
  {
    MarkDirtyRegion();
    return true;
  }

  return CGUIDialog::OnAction(action);
}
开发者ID:68foxboris,项目名称:xbmc,代码行数:10,代码来源:GUIDialogTeletext.cpp


示例4: MarkDirtyRegion

void CGUIWindowFullScreen::Process(unsigned int currentTime, CDirtyRegionList &dirtyregion)
{
    if (g_renderManager.IsGuiLayer())
        MarkDirtyRegion();

    CGUIWindow::Process(currentTime, dirtyregion);

    // TODO: This isn't quite optimal - ideally we'd only be dirtying up the actual video render rect
    //       which is probably the job of the renderer as it can more easily track resizing etc.
    m_renderRegion.SetRect(0, 0, (float)g_graphicsContext.GetWidth(), (float)g_graphicsContext.GetHeight());
}
开发者ID:halotestin,项目名称:xbmc,代码行数:11,代码来源:GUIWindowFullScreen.cpp


示例5: MarkDirtyRegion

void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  if (m_scroller.Update(currentTime))
    MarkDirtyRegion();

  // first we update visibility of all our items, to ensure our size and
  // alignment computations are correct.
  for (iControls it = m_children.begin(); it != m_children.end(); ++it)
  {
    CGUIControl *control = *it;
    GUIPROFILER_VISIBILITY_BEGIN(control);
    control->UpdateVisibility();
    GUIPROFILER_VISIBILITY_END(control);
  }

  ValidateOffset();
  if (m_pageControl && m_lastScrollerValue != m_scroller.GetValue())
  {
    CGUIMessage message(GUI_MSG_LABEL_RESET, GetParentID(), m_pageControl, (int)Size(), (int)m_totalSize);
    SendWindowMessage(message);
    CGUIMessage message2(GUI_MSG_ITEM_SELECT, GetParentID(), m_pageControl, (int)m_scroller.GetValue());
    SendWindowMessage(message2);
    m_lastScrollerValue = m_scroller.GetValue();
  }
  // we run through the controls, rendering as we go
  int index = 0;
  float pos = GetAlignOffset();
  for (iControls it = m_children.begin(); it != m_children.end(); ++it)
  {
    // note we render all controls, even if they're offscreen, as then they'll be updated
    // with respect to animations
    CGUIControl *control = *it;
    if (m_orientation == VERTICAL)
      g_graphicsContext.SetOrigin(m_posX, m_posY + pos - m_scroller.GetValue());
    else
      g_graphicsContext.SetOrigin(m_posX + pos - m_scroller.GetValue(), m_posY);
    control->DoProcess(currentTime, dirtyregions);

    if (control->IsVisible())
    {
      if (IsControlOnScreen(pos, control))
      {
        if (control->HasFocus())
          m_focusedPosition = index;
        index++;
      }

      pos += Size(control) + m_itemGap;
    }
    g_graphicsContext.RestoreOrigin();
  }
  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:anaconda,项目名称:xbmc,代码行数:53,代码来源:GUIControlGroupList.cpp


示例6: MarkDirtyRegion

void CGUIWindowPointer::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool active = g_Mouse.IsActive();
  if (active != m_active)
  {
    MarkDirtyRegion();
    m_active = active;
  }
  SetPosition((float)g_Mouse.GetX(), (float)g_Mouse.GetY());
  SetPointer(g_Mouse.GetState());
  return CGUIWindow::Process(currentTime, dirtyregions);
}
开发者ID:A600,项目名称:xbmc,代码行数:12,代码来源:GUIWindowPointer.cpp


示例7: if

bool CGUIWindowDebugInfo::OnMessage(CGUIMessage &message)
{
  if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT)
  {
    delete m_layout;
    m_layout = nullptr;
  }
  else if (message.GetMessage() == GUI_MSG_REFRESH_TIMER)
    MarkDirtyRegion();

  return CGUIDialog::OnMessage(message);
}
开发者ID:68foxboris,项目名称:xbmc,代码行数:12,代码来源:GUIWindowDebugInfo.cpp


示例8: MarkDirtyRegion

bool CGUIFixedListContainer::SelectItemFromPoint(const CPoint &point)
{
  if (!m_focusedLayout || !m_layout)
    return false;

  MarkDirtyRegion();

  const float mouse_scroll_speed = 0.25f;
  const float mouse_max_amount = 1.5f;
  float sizeOfItem = m_layout->Size(m_orientation);
  int minCursor, maxCursor;
  GetCursorRange(minCursor, maxCursor);
  // see if the point is either side of our focus range
  float start = (minCursor + 0.2f) * sizeOfItem;
  float end = (maxCursor - 0.2f) * sizeOfItem + m_focusedLayout->Size(m_orientation);
  float pos = (m_orientation == VERTICAL) ? point.y : point.x;
  if (pos < start && GetOffset() > -minCursor)
  { // scroll backward
    if (!InsideLayout(m_layout, point))
      return false;
    float amount = std::min((start - pos) / sizeOfItem, mouse_max_amount);
    m_analogScrollCount += amount * amount * mouse_scroll_speed;
    if (m_analogScrollCount > 1)
    {
      ScrollToOffset(GetOffset() - 1);
      m_analogScrollCount = 0;
    }
    return true;
  }
  else if (pos > end && GetOffset() + maxCursor < (int)m_items.size() - 1)
  {
    if (!InsideLayout(m_layout, point))
      return false;
    // scroll forward
    float amount = std::min((pos - end) / sizeOfItem, mouse_max_amount);
    m_analogScrollCount += amount * amount * mouse_scroll_speed;
    if (m_analogScrollCount > 1)
    {
      ScrollToOffset(GetOffset() + 1);
      m_analogScrollCount = 0;
    }
    return true;
  }
  else
  { // select the appropriate item
    int cursor = GetCursorFromPoint(point);
    if (cursor < 0)
      return false;
    // calling SelectItem() here will focus the item and scroll, which isn't really what we're after
    SetCursor(cursor);
    return true;
  }
}
开发者ID:anaconda,项目名称:xbmc,代码行数:53,代码来源:GUIFixedListContainer.cpp


示例9: CalculateLayout

void CGUIBaseContainer::UpdateLayout(bool updateAllItems)
{
  if (updateAllItems)
  { // free memory of items
    for (iItems it = m_items.begin(); it != m_items.end(); ++it)
      (*it)->FreeMemory();
  }
  // and recalculate the layout
  CalculateLayout();
  SetPageControlRange();
  MarkDirtyRegion();
}
开发者ID:FernetMenta,项目名称:xbmc,代码行数:12,代码来源:GUIBaseContainer.cpp


示例10: QueueAnimation

void CGUIControl::UpdateVisibility(const CGUIListItem *item)
{
  if (m_visibleCondition)
  {
    bool bWasVisible = m_visibleFromSkinCondition;
    m_visibleFromSkinCondition = m_visibleCondition->Get(item);
    if (!bWasVisible && m_visibleFromSkinCondition)
    { // automatic change of visibility - queue the in effect
  //    CLog::Log(LOGDEBUG, "Visibility changed to visible for control id %i", m_controlID);
      QueueAnimation(ANIM_TYPE_VISIBLE);
    }
    else if (bWasVisible && !m_visibleFromSkinCondition)
    { // automatic change of visibility - do the out effect
  //    CLog::Log(LOGDEBUG, "Visibility changed to hidden for control id %i", m_controlID);
      QueueAnimation(ANIM_TYPE_HIDDEN);
    }
  }
  // check for conditional animations
  for (unsigned int i = 0; i < m_animations.size(); i++)
  {
    CAnimation &anim = m_animations[i];
    if (anim.GetType() == ANIM_TYPE_CONDITIONAL)
      anim.UpdateCondition(item);
  }
  // and check for conditional enabling - note this overrides SetEnabled() from the code currently
  // this may need to be reviewed at a later date
  bool enabled = m_enabled;
  if (m_enableCondition)
    m_enabled = m_enableCondition->Get(item);

  if (m_enabled != enabled)
    MarkDirtyRegion();

  m_allowHiddenFocus.Update(item);
  if (UpdateColors())
    MarkDirtyRegion();
  // and finally, update our control information (if not pushed)
  if (!m_pushedUpdates)
    UpdateInfo(item);
}
开发者ID:Karlson2k,项目名称:xbmc,代码行数:40,代码来源:GUIControl.cpp


示例11: MarkDirtyRegion

void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  if (m_scrollSpeed != 0)
  {
    MarkDirtyRegion();
    m_offset += m_scrollSpeed * (currentTime - m_scrollLastTime);
    if ((m_scrollSpeed < 0 && m_offset < m_scrollOffset) ||
        (m_scrollSpeed > 0 && m_offset > m_scrollOffset))
    {
      m_offset = m_scrollOffset;
      m_scrollSpeed = 0;
    }
  }
  m_scrollLastTime = currentTime;

  // first we update visibility of all our items, to ensure our size and
  // alignment computations are correct.
  for (iControls it = m_children.begin(); it != m_children.end(); ++it)
  {
    CGUIControl *control = *it;
    GUIPROFILER_VISIBILITY_BEGIN(control);
    control->UpdateVisibility();
    GUIPROFILER_VISIBILITY_END(control);
  }

  ValidateOffset();
  if (m_pageControl)
  {
    CGUIMessage message(GUI_MSG_LABEL_RESET, GetParentID(), m_pageControl, (int)m_height, (int)m_totalSize);
    SendWindowMessage(message);
    CGUIMessage message2(GUI_MSG_ITEM_SELECT, GetParentID(), m_pageControl, (int)m_offset);
    SendWindowMessage(message2);
  }
  // we run through the controls, rendering as we go
  float pos = GetAlignOffset();
  for (iControls it = m_children.begin(); it != m_children.end(); ++it)
  {
    // note we render all controls, even if they're offscreen, as then they'll be updated
    // with respect to animations
    CGUIControl *control = *it;
    if (m_orientation == VERTICAL)
      g_graphicsContext.SetOrigin(m_posX, m_posY + pos - m_offset);
    else
      g_graphicsContext.SetOrigin(m_posX + pos - m_offset, m_posY);
    control->DoProcess(currentTime, dirtyregions);

    if (control->IsVisible())
      pos += Size(control) + m_itemGap;
    g_graphicsContext.RestoreOrigin();
  }
  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:Kzibi,项目名称:xbmc,代码行数:52,代码来源:GUIControlGroupList.cpp


示例12: MarkDirtyRegion

void CGUICheckMarkControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool changed = false;

  changed |= m_imgCheckMark.Process(currentTime);
  changed |= m_imgCheckMarkNoFocus.Process(currentTime);
  changed |= m_label.Process(currentTime);

  if (changed)
    MarkDirtyRegion();

  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:MrMC,项目名称:mrmc,代码行数:13,代码来源:GUICheckMarkControl.cpp


示例13: MarkDirtyRegion

void CGUIWindowPointer::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool active = CInputManager::Get().IsMouseActive();
  if (active != m_active)
  {
    MarkDirtyRegion();
    m_active = active;
  }
  MousePosition pos = CInputManager::Get().GetMousePosition();
  SetPosition((float)pos.x, (float)pos.y);
  SetPointer(CInputManager::Get().GetMouseState());
  return CGUIWindow::Process(currentTime, dirtyregions);
}
开发者ID:kisshine,项目名称:xbmc,代码行数:13,代码来源:GUIWindowPointer.cpp


示例14: MarkDirtyRegion

bool CGUISpinControl::OnMouseOver(const CPoint &point)
{
  int select = m_iSelect;
  if (m_imgspinDownFocus.HitTest(point))
    m_iSelect = SPIN_BUTTON_DOWN;
  else
    m_iSelect = SPIN_BUTTON_UP;

  if (select != m_iSelect)
    MarkDirtyRegion();

  return CGUIControl::OnMouseOver(point);
}
开发者ID:AndyPeterman,项目名称:mrmc,代码行数:13,代码来源:GUISpinControl.cpp


示例15: GetWidth

void CGUIToggleButtonControl::ProcessToggle(unsigned int currentTime)
{
  bool changed = false;

  changed |= m_label.SetMaxRect(m_posX, m_posY, GetWidth(), m_height);
  changed |= m_label.SetText(GetDescription());
  changed |= m_label.SetColor(GetTextColor());
  changed |= m_label.SetScrolling(HasFocus());
  changed |= m_label.Process(currentTime);

  if (changed)
    MarkDirtyRegion();
}
开发者ID:Montellese,项目名称:xbmc,代码行数:13,代码来源:GUIToggleButtonControl.cpp


示例16: MarkDirtyRegion

void CGUIMoverControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  if (m_bInvalidated)
  {
    m_imgFocus.SetWidth(m_width);
    m_imgFocus.SetHeight(m_height);

    m_imgNoFocus.SetWidth(m_width);
    m_imgNoFocus.SetHeight(m_height);
  }
  if (HasFocus())
  {
    unsigned int alphaCounter = m_frameCounter + 2;
    unsigned int alphaChannel;
    if ((alphaCounter % 128) >= 64)
      alphaChannel = alphaCounter % 64;
    else
      alphaChannel = 63 - (alphaCounter % 64);

    alphaChannel += 192;
    if (SetAlpha( (unsigned char)alphaChannel ))
      MarkDirtyRegion();
    m_imgFocus.SetVisible(true);
    m_imgNoFocus.SetVisible(false);
    m_frameCounter++;
  }
  else
  {
    if (SetAlpha(0xff))
      MarkDirtyRegion();
    m_imgFocus.SetVisible(false);
    m_imgNoFocus.SetVisible(true);
  }
  m_imgFocus.Process(currentTime);
  m_imgNoFocus.Process(currentTime);

  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:7orlum,项目名称:xbmc,代码行数:38,代码来源:GUIMoverControl.cpp


示例17: CRect

void CGUIBorderedImage::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  if (!m_borderImage.GetFileName().IsEmpty() && m_texture.ReadyToRender())
  {
    CRect rect = CRect(m_texture.GetXPosition(), m_texture.GetYPosition(), m_texture.GetXPosition() + m_texture.GetWidth(), m_texture.GetYPosition() + m_texture.GetHeight());
    rect.Intersect(m_texture.GetRenderRect());
    m_borderImage.SetPosition(rect.x1 - m_borderSize.x1, rect.y1 - m_borderSize.y1);
    m_borderImage.SetWidth(rect.Width() + m_borderSize.x1 + m_borderSize.x2);
    m_borderImage.SetHeight(rect.Height() + m_borderSize.y1 + m_borderSize.y2);
    m_borderImage.SetDiffuseColor(m_diffuseColor);
    if (m_borderImage.Process(currentTime))
      MarkDirtyRegion();
  }
  CGUIImage::Process(currentTime, dirtyregions);
}
开发者ID:rolflobker,项目名称:xbmc,代码行数:15,代码来源:GUIBorderedImage.cpp


示例18: if

void CGUISettingsSliderControl::ProcessText()
{
  bool changed = false;

  changed |= m_label.SetMaxRect(m_buttonControl.GetXPosition(), m_posY, m_posX - m_buttonControl.GetXPosition(), m_height);
  changed |= m_label.SetText(CGUISliderControl::GetDescription());
  if (IsDisabled())
    changed |= m_label.SetColor(CGUILabel::COLOR_DISABLED);
  else if (HasFocus())
    changed |= m_label.SetColor(CGUILabel::COLOR_FOCUSED);
  else
    changed |= m_label.SetColor(CGUILabel::COLOR_TEXT);

  if (changed)
    MarkDirtyRegion();
}
开发者ID:A600,项目名称:xbmc,代码行数:16,代码来源:GUISettingsSliderControl.cpp


示例19: UpdateBarSize

void CGUIScrollBar::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool changed = false;

  if (m_bInvalidated)
    changed |= UpdateBarSize();

  changed |= m_guiBackground.Process(currentTime);
  changed |= m_guiBarNoFocus.Process(currentTime);
  changed |= m_guiBarFocus.Process(currentTime);
  changed |= m_guiNibNoFocus.Process(currentTime);
  changed |= m_guiNibFocus.Process(currentTime);

  if (changed)
    MarkDirtyRegion();

  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:Anankin,项目名称:xbmc,代码行数:18,代码来源:GUIScrollBarControl.cpp


示例20: SetIntValue

void CGUISliderControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool dirty = false;

  dirty |= m_guiBackground.SetPosition( m_posX, m_posY );
  int infoCode = m_iInfoCode;
  if (m_action && (!m_dragging || m_action->fireOnDrag))
    infoCode = m_action->infoCode;
  if (infoCode)
  {
    int val;
    if (g_infoManager.GetInt(val, infoCode))
      SetIntValue(val);
  }

  float fScaleY = m_height == 0 ? 1.0f : m_height / m_guiBackground.GetTextureHeight();

  dirty |= m_guiBackground.SetHeight(m_height);
  dirty |= m_guiBackground.SetWidth(m_width);
  dirty |= m_guiBackground.Process(currentTime);

  // we render the nib centered at the appropriate percentage, except where the nib
  // would overflow the background image
  CGUITexture &nib = (m_bHasFocus && !IsDisabled()) ? m_guiMidFocus : m_guiMid;

  dirty |= nib.SetHeight(nib.GetTextureHeight() * fScaleY);
  dirty |= nib.SetWidth(nib.GetHeight() * 2);
  CAspectRatio ratio(CAspectRatio::AR_KEEP); ratio.align = ASPECT_ALIGN_LEFT | ASPECT_ALIGNY_CENTER;
  dirty |= nib.SetAspectRatio(ratio);
  CRect rect = nib.GetRenderRect();

  float offset = GetProportion() * m_width - rect.Width() / 2;
  if (offset > m_width - rect.Width())
    offset = m_width - rect.Width();
  if (offset < 0)
    offset = 0;
  dirty |= nib.SetPosition(m_guiBackground.GetXPosition() + offset, m_guiBackground.GetYPosition() );
  dirty |= nib.Process(currentTime);

  if (dirty)
    MarkDirtyRegion();

  CGUIControl::Process(currentTime, dirtyregions);
}
开发者ID:Sky-git,项目名称:xbmc,代码行数:44,代码来源:GUISliderControl.cpp



注:本文中的MarkDirtyRegion函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MarkRenderStateDirty函数代码示例发布时间:2022-05-30
下一篇:
C++ MarkDirty函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap