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

Unified Diff: cc/base/region.cc

Issue 202523002: cc: Replace Region with SimpleEnclosedRegion for occlusion tracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpleregion: . Created 6 years, 4 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 | « cc/base/region.h ('k') | cc/base/simple_enclosed_region.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/region.cc
diff --git a/cc/base/region.cc b/cc/base/region.cc
index 79c30ec8251a0b0b881aed2ba304bbcc63eb64ba..2484cc21ecbe8da92993fa1a31067b03161ab1c7 100644
--- a/cc/base/region.cc
+++ b/cc/base/region.cc
@@ -3,8 +3,10 @@
// found in the LICENSE file.
#include "cc/base/region.h"
+
#include "base/debug/trace_event_argument.h"
#include "base/values.h"
+#include "cc/base/simple_enclosed_region.h"
namespace cc {
@@ -80,6 +82,13 @@ void Region::Subtract(const Region& region) {
skregion_.op(region.skregion_, SkRegion::kDifference_Op);
}
+void Region::Subtract(const SimpleEnclosedRegion& region) {
+ for (size_t i = 0; i < region.GetRegionComplexity(); ++i) {
+ skregion_.op(gfx::RectToSkIRect(region.GetRect(i)),
+ SkRegion::kDifference_Op);
+ }
+}
+
void Region::Union(const gfx::Rect& rect) {
skregion_.op(gfx::RectToSkIRect(rect), SkRegion::kUnion_Op);
}
« no previous file with comments | « cc/base/region.h ('k') | cc/base/simple_enclosed_region.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698