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

Unified Diff: ui/views/view.cc

Issue 269513002: readability review for luken (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang repairs Created 6 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 | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 3d902a6487fb939c2f0bd437a5215d4701034f6e..75c1ee87d37c35600bc5c10177cf796ad45f6838 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -782,7 +782,7 @@ void View::Paint(gfx::Canvas* canvas, const CullSet& cull_set) {
// propagation to our children.
if (IsPaintRoot()) {
if (!bounds_tree_)
- bounds_tree_.reset(new gfx::RTree(2, 5));
+ bounds_tree_.reset(new BoundsTree(2, 5));
// Recompute our bounds tree as needed.
UpdateRootBounds(bounds_tree_.get(), gfx::Vector2d());
@@ -798,7 +798,8 @@ void View::Paint(gfx::Canvas* canvas, const CullSet& cull_set) {
// our canvas bounds.
scoped_ptr<base::hash_set<intptr_t> > damaged_views(
new base::hash_set<intptr_t>());
- bounds_tree_->Query(canvas_bounds, damaged_views.get());
+ bounds_tree_->AppendIntersectingRecords(
+ canvas_bounds, damaged_views.get());
// Construct a CullSet to wrap the damaged views set, it will delete it
// for us on scope exit.
CullSet paint_root_cull_set(damaged_views.Pass());
@@ -1870,7 +1871,7 @@ void View::DoRemoveChildView(View* view,
// Remove the bounds of this child and any of its descendants from our
// paint root bounds tree.
- gfx::RTree* bounds_tree = GetBoundsTreeFromPaintRoot();
+ BoundsTree* bounds_tree = GetBoundsTreeFromPaintRoot();
if (bounds_tree)
view->RemoveRootBounds(bounds_tree);
@@ -2081,7 +2082,7 @@ void View::SetRootBoundsDirty(bool origin_changed) {
}
}
-void View::UpdateRootBounds(gfx::RTree* tree, const gfx::Vector2d& offset) {
+void View::UpdateRootBounds(BoundsTree* tree, const gfx::Vector2d& offset) {
// No need to recompute bounds if we haven't flagged ours as dirty.
TRACE_EVENT1("views", "View::UpdateRootBounds", "class", GetClassName());
@@ -2106,7 +2107,7 @@ void View::UpdateRootBounds(gfx::RTree* tree, const gfx::Vector2d& offset) {
}
}
-void View::RemoveRootBounds(gfx::RTree* tree) {
+void View::RemoveRootBounds(BoundsTree* tree) {
tree->Remove(reinterpret_cast<intptr_t>(this));
root_bounds_dirty_ = true;
@@ -2117,8 +2118,8 @@ void View::RemoveRootBounds(gfx::RTree* tree) {
}
}
-gfx::RTree* View::GetBoundsTreeFromPaintRoot() {
- gfx::RTree* bounds_tree = bounds_tree_.get();
+View::BoundsTree* View::GetBoundsTreeFromPaintRoot() {
+ BoundsTree* bounds_tree = bounds_tree_.get();
View* paint_root = this;
while (!bounds_tree && !paint_root->IsPaintRoot()) {
// Assumption is that if IsPaintRoot() is false then parent_ is valid.
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698