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

Side by Side Diff: ui/gfx/geometry/r_tree_base.cc

Issue 659713003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/events/test/mock_motion_event.cc ('k') | ui/gfx/geometry/r_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/geometry/r_tree_base.h" 5 #include "ui/gfx/geometry/r_tree_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 children_.insert(children_.end(), 456 children_.insert(children_.end(),
457 sorted_children.begin(), 457 sorted_children.begin(),
458 sorted_children.begin() + split_index); 458 sorted_children.begin() + split_index);
459 sibling->children_.insert(sibling->children_.end(), 459 sibling->children_.insert(sibling->children_.end(),
460 sorted_children.begin() + split_index, 460 sorted_children.begin() + split_index,
461 sorted_children.end()); 461 sorted_children.end());
462 462
463 for (size_t i = 0; i < sibling->children_.size(); ++i) 463 for (size_t i = 0; i < sibling->children_.size(); ++i)
464 sibling->children_[i]->set_parent(sibling.get()); 464 sibling->children_[i]->set_parent(sibling.get());
465 465
466 return sibling.PassAs<NodeBase>(); 466 return sibling.Pass();
467 } 467 }
468 468
469 RTreeBase::Node* RTreeBase::Node::LeastOverlapIncrease( 469 RTreeBase::Node* RTreeBase::Node::LeastOverlapIncrease(
470 const Rect& node_rect, 470 const Rect& node_rect,
471 const Rects& expanded_rects) { 471 const Rects& expanded_rects) {
472 NodeBase* best_node = children_.front(); 472 NodeBase* best_node = children_.front();
473 int least_overlap_increase = 473 int least_overlap_increase =
474 OverlapIncreaseToAdd(node_rect, children_[0], expanded_rects[0]); 474 OverlapIncreaseToAdd(node_rect, children_[0], expanded_rects[0]);
475 for (size_t i = 1; i < children_.size(); ++i) { 475 for (size_t i = 1; i < children_.size(); ++i) {
476 int overlap_increase = 476 int overlap_increase =
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 root_.reset( 649 root_.reset(
650 static_cast<Node*>(root_->RemoveAndReturnLastChild().release())); 650 static_cast<Node*>(root_->RemoveAndReturnLastChild().release()));
651 } 651 }
652 } 652 }
653 653
654 void RTreeBase::ResetRoot() { 654 void RTreeBase::ResetRoot() {
655 root_.reset(new Node()); 655 root_.reset(new Node());
656 } 656 }
657 657
658 } // namespace gfx 658 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/events/test/mock_motion_event.cc ('k') | ui/gfx/geometry/r_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698