Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2164)

Unified Diff: cc/occlusion_tracker.h

Issue 11583005: cc: Make occlusion tracker always work in target space. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase+nits Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/occlusion_tracker.h
diff --git a/cc/occlusion_tracker.h b/cc/occlusion_tracker.h
index 96df92e31a5756924129b3b3a400f51d8248ed49..260dddbd1061ba92f322166ac5c7d673c17305d5 100644
--- a/cc/occlusion_tracker.h
+++ b/cc/occlusion_tracker.h
@@ -26,7 +26,7 @@ class RenderSurface;
template<typename LayerType, typename RenderSurfaceType>
class CC_EXPORT OcclusionTrackerBase {
public:
- OcclusionTrackerBase(gfx::Rect rootTargetRect, bool recordMetricsForFrame);
+ OcclusionTrackerBase(gfx::Rect screenSpaceClipRect, bool recordMetricsForFrame);
~OcclusionTrackerBase();
// Called at the beginning of each step in the LayerIterator's front-to-back traversal.
@@ -47,7 +47,10 @@ public:
OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get(); }
// Gives the region of the screen that is not occluded by something opaque.
- Region computeVisibleRegionInScreen() const { return SubtractRegions(m_rootTargetRect, m_stack.back().occlusionInScreen); }
+ Region computeVisibleRegionInScreen() const {
+ DCHECK(!m_stack.back().target->parent());
+ return SubtractRegions(m_screenSpaceClipRect, m_stack.back().occlusionFromInsideTarget);
+ }
void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize = size; }
@@ -60,8 +63,8 @@ protected:
StackObject() : target(0) { }
StackObject(const LayerType* target) : target(target) { }
const LayerType* target;
- Region occlusionInScreen;
- Region occlusionInTarget;
+ Region occlusionFromOutsideTarget;
+ Region occlusionFromInsideTarget;
};
// The stack holds occluded regions for subtrees in the RenderSurfaceImpl-Layer tree, so that when we leave a subtree we may
@@ -91,7 +94,7 @@ private:
// Add the layer's occlusion to the tracked state.
void markOccludedBehindLayer(const LayerType*);
- gfx::Rect m_rootTargetRect;
+ gfx::Rect m_screenSpaceClipRect;
scoped_ptr<OverdrawMetrics> m_overdrawMetrics;
gfx::Size m_minimumTrackingSize;
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698