Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont force dirtyRegions on parent controls #12255

Merged
merged 1 commit into from
Jun 7, 2017
Merged

Dont force dirtyRegions on parent controls #12255

merged 1 commit into from
Jun 7, 2017

Conversation

peak3d
Copy link
Contributor

@peak3d peak3d commented Jun 6, 2017

Dont force dirtyRegions on parent controls

Description

Currently we draw visible regions of recursivw parents if a control gets dirty
This PR changes this behaviour (only Control dirty Rect is displayed)

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@mkortstiege can you pls verify that its working as expected? Thx

@FernetMenta
Copy link
Contributor

what exactly does this do. please elaborate.

@peak3d
Copy link
Contributor Author

peak3d commented Jun 6, 2017

Beginning with PR 12213 we transport m_IsControlDirty down to the parents to get an early hint if we have to visit tree nodes in the GUI tree.

This change lead to the fact, that DirtyRegions are drawn / recorded for parents of a control wich becomes dirty ( a ListItemLabel e.g.). This was not the fact before the PR 12213.

We now have 2 states, 1 saying that the Control is dirty, and one wich say that some of its childs are dirty.

The first state is used for displaying DirtyRegions in default DirtyRegion mode, but also used for collecting only DirtyRects of dirty Controls, and not the parents of it.

The second state is base of the optimizations in PR 12213.

Edit: This is a fix for PR12213

@FernetMenta
Copy link
Contributor

we still draw the entire screen if only a single control is dirty?

@popcornmix
Copy link
Member

@FernetMenta http://kodi.wiki/view/HOW-TO:Modify_dirty_regions
"Whole screen" is the default setting.
Other settings produce artefacts due to alpha overwriting without clearing the screen (at least on GLES).

@FernetMenta
Copy link
Contributor

I know, my question was if this PR would change this. the title "Dont force dirtyRegions on parent controls" kind of suggests this.

@peak3d
Copy link
Contributor Author

peak3d commented Jun 7, 2017

PR 12213 introduced following issues:

  • dirty-mode==default (draw full screen always): if you enable "show dirty rects" you will see the rects of the parents of a dirty control. From technical POV its meaningless, because everything is redrawn because of the mode.

  • dirty-mode!= default(try to refresh only dirty regions): PR 12213 broke this, because the rects of all parents are set dirty (wich lead in effect to full redraw).

Especially the 1. part took already 2 hours discussion. This PR here fixes both issues (You'll see only the dirty rects of the dirty contrl / only the dirty controls dirty-rect is updated if anyone uses dirty-mode != default.

@FernetMenta
Copy link
Contributor

thanks for clarification

@@ -755,7 +752,7 @@ bool CGUIWindow::OnMessage(CGUIMessage& message)
}
}
else if (message.GetParam1() == GUI_MSG_STATE_CHANGED)
m_forceProcess = true;
MarkDirtyRegion(DIRTY_STATE_CHILD); //Dont force an dirtyRect, we don't knw if / what has changed.

This comment was marked as spam.

@mkortstiege
Copy link
Member

Works as expected now. Thanks!

@peak3d
Copy link
Contributor Author

peak3d commented Jun 7, 2017

thx for the time and looking at it @mkortstiege

@peak3d peak3d merged commit 604294f into xbmc:master Jun 7, 2017
@Rechi Rechi added Type: Fix non-breaking change which fixes an issue Component: GUI engine v18 Leia labels Jun 7, 2017
@Rechi Rechi added this to the L 18.0-alpha1 milestone Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GUI engine Type: Fix non-breaking change which fixes an issue v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants