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

Unified Diff: cc/base/invalidation_region.h

Issue 2054473002: Speed up InvalidationRegion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Limit pending_rects_ to kMaxInvalidationRectCount Created 4 years, 6 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 | cc/base/invalidation_region.cc » ('j') | cc/base/invalidation_region.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/invalidation_region.h
diff --git a/cc/base/invalidation_region.h b/cc/base/invalidation_region.h
index 7aa4a8b2a3b7e7f53d4aee9a7f5c2c49ba0a9ef8..a9a0762bb445390482afea6a06037e257730c649 100644
--- a/cc/base/invalidation_region.h
+++ b/cc/base/invalidation_region.h
@@ -5,6 +5,8 @@
#ifndef CC_BASE_INVALIDATION_REGION_H_
#define CC_BASE_INVALIDATION_REGION_H_
+#include <vector>
+
#include "cc/base/cc_export.h"
#include "cc/base/region.h"
#include "ui/gfx/geometry/rect.h"
@@ -22,12 +24,13 @@ class CC_EXPORT InvalidationRegion {
void Swap(Region* region);
void Clear();
void Union(const gfx::Rect& rect);
- bool IsEmpty() const { return region_.IsEmpty(); }
+ bool IsEmpty() const { return pending_rects_.empty() && region_.IsEmpty(); }
private:
- void SimplifyIfNeeded();
+ void FinalizePendingRects();
Region region_;
+ std::vector<gfx::Rect> pending_rects_;
};
} // namespace cc
« no previous file with comments | « no previous file | cc/base/invalidation_region.cc » ('j') | cc/base/invalidation_region.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698