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

Unified Diff: cc/base/region.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/ref_counted_managed.h ('k') | cc/base/region.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/region.h
diff --git a/cc/base/region.h b/cc/base/region.h
deleted file mode 100644
index 583311e09fe007618f133e5084db6183f5ddd288..0000000000000000000000000000000000000000
--- a/cc/base/region.h
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_BASE_REGION_H_
-#define CC_BASE_REGION_H_
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "cc/base/cc_export.h"
-#include "third_party/skia/include/core/SkRegion.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/gfx/skia_util.h"
-
-namespace base {
-class Value;
-namespace trace_event {
-class TracedValue;
-}
-}
-
-namespace cc {
-class SimpleEnclosedRegion;
-
-class CC_EXPORT Region {
- public:
- Region();
- Region(const Region& region);
- Region(const gfx::Rect& rect); // NOLINT(runtime/explicit)
- ~Region();
-
- const Region& operator=(const gfx::Rect& rect);
- const Region& operator=(const Region& region);
-
- void Swap(Region* region);
- void Clear();
- bool IsEmpty() const;
- int GetRegionComplexity() const;
-
- bool Contains(const gfx::Point& point) const;
- bool Contains(const gfx::Rect& rect) const;
- bool Contains(const Region& region) const;
-
- bool Intersects(const gfx::Rect& rect) const;
- bool Intersects(const Region& region) const;
-
- void Subtract(const gfx::Rect& rect);
- void Subtract(const Region& region);
- void Subtract(const SimpleEnclosedRegion& region);
- void Union(const gfx::Rect& rect);
- void Union(const Region& region);
- void Intersect(const gfx::Rect& rect);
- void Intersect(const Region& region);
-
- bool Equals(const Region& other) const {
- return skregion_ == other.skregion_;
- }
-
- gfx::Rect bounds() const {
- return gfx::SkIRectToRect(skregion_.getBounds());
- }
-
- std::string ToString() const;
- scoped_ptr<base::Value> AsValue() const;
- void AsValueInto(base::trace_event::TracedValue* array) const;
-
- class CC_EXPORT Iterator {
- public:
- Iterator();
- explicit Iterator(const Region& region);
- ~Iterator();
-
- gfx::Rect rect() const {
- return gfx::SkIRectToRect(it_.rect());
- }
-
- void next() {
- it_.next();
- }
-
- bool has_rect() const {
- return !it_.done();
- }
-
- private:
- SkRegion::Iterator it_;
- };
-
- private:
- SkRegion skregion_;
-};
-
-inline bool operator==(const Region& a, const Region& b) {
- return a.Equals(b);
-}
-
-inline bool operator!=(const Region& a, const Region& b) {
- return !(a == b);
-}
-
-inline Region SubtractRegions(const Region& a, const Region& b) {
- Region result = a;
- result.Subtract(b);
- return result;
-}
-
-inline Region SubtractRegions(const Region& a, const gfx::Rect& b) {
- Region result = a;
- result.Subtract(b);
- return result;
-}
-
-inline Region IntersectRegions(const Region& a, const Region& b) {
- Region result = a;
- result.Intersect(b);
- return result;
-}
-
-inline Region IntersectRegions(const Region& a, const gfx::Rect& b) {
- Region result = a;
- result.Intersect(b);
- return result;
-}
-
-inline Region UnionRegions(const Region& a, const Region& b) {
- Region result = a;
- result.Union(b);
- return result;
-}
-
-inline Region UnionRegions(const Region& a, const gfx::Rect& b) {
- Region result = a;
- result.Union(b);
- return result;
-}
-
-} // namespace cc
-
-#endif // CC_BASE_REGION_H_
« no previous file with comments | « cc/base/ref_counted_managed.h ('k') | cc/base/region.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698