Permalink
Browse files

[Occlusion] don't restrict subsurfaces to the occuluded region

When using occlusion culling don't restrict subsurface size to
to the rendered region at least until a better solution is found.
Fixes bnc 652581.
  • Loading branch information...
1 parent d6bf36e commit 6c6fbb2c093482ea56de1cd57b370ebbdd66df8b @lewing lewing committed Nov 18, 2010
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/uielement.cpp
View
@@ -1469,7 +1469,11 @@ UIElement::PreRender (Context *ctx, Region *region, bool skip_children)
// we need this check because ::PreRender can (and
// will) be called for elements with empty regions.
- if (!region->IsEmpty ())
+ //
+ // NOTE: we cannot safely restrict to the region
+ // when doing occlusion culling since our region
+ // may have been culled in that case
+ if (!region->IsEmpty () && !skip_children)
r = r.Intersection (region->GetExtents ());
bounds = bounds.Intersection (r);
@@ -1539,7 +1543,10 @@ UIElement::PreRender (Context *ctx, Region *region, bool skip_children)
// will keep all descendents from drawing to the
// screen.
//
- if (!region->IsEmpty ())
+ // NOTE: we cannot safely restrict to the region
+ // when doing occlusion culling since our region
+ // may have been culled
+ if (!region->IsEmpty () && !skip_children)
r = r.Intersection (region->GetExtents ());
if (flags & COMPOSITE_OPACITY)

0 comments on commit 6c6fbb2

Please sign in to comment.