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

Unified Diff: cc/trees/occlusion_tracker.cc

Issue 576173003: cc: Move UnoccludedContentRect to Occlusion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
Index: cc/trees/occlusion_tracker.cc
diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc
index 9959bfb1c3385b524171194edf616e67553c6b6a..7d90834b35f6d05030a3b8a2c529bdf8dabd7c0a 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -493,47 +493,6 @@ void OcclusionTracker<LayerType>::MarkOccludedBehindLayer(
}
template <typename LayerType>
-gfx::Rect OcclusionTracker<LayerType>::UnoccludedContentRect(
- const gfx::Rect& content_rect,
- const gfx::Transform& draw_transform) const {
- DCHECK(!stack_.empty());
- if (content_rect.IsEmpty())
- return content_rect;
-
- const StackObject& back = stack_.back();
- if (back.occlusion_from_inside_target.IsEmpty() &&
- back.occlusion_from_outside_target.IsEmpty()) {
- return content_rect;
- }
-
- gfx::Transform inverse_draw_transform(gfx::Transform::kSkipInitialization);
- bool ok = draw_transform.GetInverse(&inverse_draw_transform);
- DCHECK(ok);
-
- // Take the ToEnclosingRect at each step, as we want to contain any unoccluded
- // partial pixels in the resulting Rect.
- gfx::Rect unoccluded_rect_in_target_surface =
- MathUtil::MapEnclosingClippedRect(draw_transform, content_rect);
- DCHECK_LE(back.occlusion_from_inside_target.GetRegionComplexity(), 1u);
- DCHECK_LE(back.occlusion_from_outside_target.GetRegionComplexity(), 1u);
- // These subtract operations are more lossy than if we did both operations at
- // once.
- unoccluded_rect_in_target_surface.Subtract(
- back.occlusion_from_inside_target.bounds());
- unoccluded_rect_in_target_surface.Subtract(
- back.occlusion_from_outside_target.bounds());
-
- if (unoccluded_rect_in_target_surface.IsEmpty())
- return gfx::Rect();
-
- gfx::Rect unoccluded_rect = MathUtil::ProjectEnclosingClippedRect(
- inverse_draw_transform, unoccluded_rect_in_target_surface);
- unoccluded_rect.Intersect(content_rect);
-
- return unoccluded_rect;
-}
-
-template <typename LayerType>
gfx::Rect OcclusionTracker<LayerType>::UnoccludedContributingSurfaceContentRect(
const gfx::Rect& content_rect,
const gfx::Transform& draw_transform) const {

Powered by Google App Engine
This is Rietveld 408576698