Commit f080b5b7 authored by danakj's avatar danakj Committed by Commit bot

cc: Stop testing occlusion by making awkward queries.

We used to test the state of the occlusion tracker by making queries
for various input rects to try and guess what its occlusion state
must be. This is bad. Instead, we can query the state directly.

This removes all state queries from tests that are verifying the
occlusion tracker's internal state changes correctly. And adds some
new tests that just set internal state and verify the query methods
work correctly.

R=enne

Review URL: https://codereview.chromium.org/497493004

Cr-Commit-Position: refs/heads/master@{#291608}
parent 5a456030
......@@ -52,6 +52,21 @@ class TestOcclusionTracker : public OcclusionTracker<LayerType> {
OcclusionTracker<LayerType>::stack_.back().occlusion_from_inside_target =
region;
}
void set_occlusion_on_contributing_surface_from_outside_target(
const SimpleEnclosedRegion& region) {
size_t stack_size = OcclusionTracker<LayerType>::stack_.size();
DCHECK_GE(stack_size, 2u);
OcclusionTracker<LayerType>::stack_[stack_size - 2]
.occlusion_from_outside_target = region;
}
void set_occlusion_on_contributing_surface_from_inside_target(
const SimpleEnclosedRegion& region) {
size_t stack_size = OcclusionTracker<LayerType>::stack_.size();
DCHECK_GE(stack_size, 2u);
OcclusionTracker<LayerType>::stack_[stack_size - 2]
.occlusion_from_inside_target = region;
}
};
} // namespace cc
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment