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

Unified Diff: cc/trees/occlusion_tracker.cc

Issue 381613004: cc: early return if unoccluded_region_in_target_surface is empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added same early out in UnoccludedContributingSurfaceContentRect also. Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/occlusion_tracker.cc
diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc
index f4a414f6de29c35815f8abf9592974f0c56a6e1a..fb3b5acfe94c90fc145aa1f44279270e1f7a453f 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -567,6 +567,9 @@ gfx::Rect OcclusionTracker<LayerType>::UnoccludedContentRect(
unoccluded_region_in_target_surface.Subtract(
stack_.back().occlusion_from_outside_target);
+ if (unoccluded_region_in_target_surface.IsEmpty())
+ return gfx::Rect();
+
gfx::Rect unoccluded_rect_in_target_surface =
unoccluded_region_in_target_surface.bounds();
gfx::Rect unoccluded_rect = MathUtil::ProjectEnclosingClippedRect(
@@ -609,6 +612,9 @@ gfx::Rect OcclusionTracker<LayerType>::UnoccludedContributingSurfaceContentRect(
unoccluded_region_in_target_surface.Subtract(
second_last.occlusion_from_outside_target);
+ if (unoccluded_region_in_target_surface.IsEmpty())
+ return gfx::Rect();
+
gfx::Rect unoccluded_rect_in_target_surface =
unoccluded_region_in_target_surface.bounds();
gfx::Rect unoccluded_rect = MathUtil::ProjectEnclosingClippedRect(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698