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

Unified Diff: cc/trees/occlusion_tracker.cc

Issue 917763003: cc: Move occlusion debug rects into the debug layer borders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 97bd2cfef1b13ff5555280c8c9a7bc4c3ee968c6..388eb6ee2caa20c2a797bc6b4c8f0c22206ecc36 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -20,12 +20,12 @@ namespace cc {
template <typename LayerType>
OcclusionTracker<LayerType>::OcclusionTracker(
const gfx::Rect& screen_space_clip_rect)
- : screen_space_clip_rect_(screen_space_clip_rect),
- occluding_screen_space_rects_(NULL),
- non_occluding_screen_space_rects_(NULL) {}
+ : screen_space_clip_rect_(screen_space_clip_rect) {
+}
template <typename LayerType>
-OcclusionTracker<LayerType>::~OcclusionTracker() {}
+OcclusionTracker<LayerType>::~OcclusionTracker() {
+}
template <typename LayerType>
Occlusion OcclusionTracker<LayerType>::GetCurrentOcclusionForLayer(
@@ -465,48 +465,6 @@ void OcclusionTracker<LayerType>::MarkOccludedBehindLayer(
transformed_rect.height() < minimum_tracking_size_.height())
continue;
stack_.back().occlusion_from_inside_target.Union(transformed_rect);
-
- if (!occluding_screen_space_rects_)
- continue;
-
- // Save the occluding area in screen space for debug visualization.
- bool clipped;
- gfx::QuadF screen_space_quad = MathUtil::MapQuad(
- layer->render_target()->render_surface()->screen_space_transform(),
- gfx::QuadF(transformed_rect), &clipped);
- // TODO(danakj): Store the quad in the debug info instead of the bounding
- // box.
- gfx::Rect screen_space_rect =
- gfx::ToEnclosedRect(screen_space_quad.BoundingBox());
- occluding_screen_space_rects_->push_back(screen_space_rect);
- }
-
- if (!non_occluding_screen_space_rects_)
- return;
-
- Region non_opaque_contents(gfx::Rect(layer->content_bounds()));
- non_opaque_contents.Subtract(opaque_contents);
-
- for (Region::Iterator non_opaque_content_rects(non_opaque_contents);
- non_opaque_content_rects.has_rect();
- non_opaque_content_rects.next()) {
- gfx::Rect transformed_rect =
- MathUtil::MapEnclosedRectWith2dAxisAlignedTransform(
- layer->draw_transform(), non_opaque_content_rects.rect());
- transformed_rect.Intersect(clip_rect_in_target);
- if (transformed_rect.IsEmpty())
- continue;
-
- bool clipped;
- gfx::QuadF screen_space_quad = MathUtil::MapQuad(
- layer->render_target()->render_surface()->screen_space_transform(),
- gfx::QuadF(transformed_rect),
- &clipped);
- // TODO(danakj): Store the quad in the debug info instead of the bounding
- // box.
- gfx::Rect screen_space_rect =
- gfx::ToEnclosedRect(screen_space_quad.BoundingBox());
- non_occluding_screen_space_rects_->push_back(screen_space_rect);
}
}

Powered by Google App Engine
This is Rietveld 408576698