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

Unified Diff: cc/occlusion_tracker.cc

Issue 11312154: cc: Add some early outs to avoid expensive operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extra casts Created 8 years, 1 month 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/math_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/occlusion_tracker.cc
diff --git a/cc/occlusion_tracker.cc b/cc/occlusion_tracker.cc
index 9c536d2e3a29e8977cdff3f1da09771eb5563edb..c5f7276e945cf4230930604ee8e3c34dc88f975a 100644
--- a/cc/occlusion_tracker.cc
+++ b/cc/occlusion_tracker.cc
@@ -349,6 +349,9 @@ bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerTyp
// the resulting unoccluded region is not rectangular, we return a rect containing it.
static inline gfx::Rect rectSubtractRegion(const gfx::Rect& rect, const Region& region)
{
+ if (region.IsEmpty())
+ return rect;
+
Region rectRegion(rect);
rectRegion.Subtract(region);
return rectRegion.bounds();
« no previous file with comments | « cc/math_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698