| Index: cc/output/bsp_tree.cc
|
| diff --git a/cc/output/bsp_tree.cc b/cc/output/bsp_tree.cc
|
| index 4eb87cb95d28fa65f003302a7535887da7747be9..a32c3f49b69a3ebc0e5ba1086f86d6fe775f4c81 100644
|
| --- a/cc/output/bsp_tree.cc
|
| +++ b/cc/output/bsp_tree.cc
|
| @@ -7,7 +7,7 @@
|
| #include <vector>
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "cc/base/scoped_ptr_deque.h"
|
| +#include "cc/base/container_util.h"
|
| #include "cc/base/scoped_ptr_vector.h"
|
| #include "cc/output/bsp_compare_result.h"
|
| #include "cc/quads/draw_polygon.h"
|
| @@ -20,11 +20,11 @@ BspNode::BspNode(scoped_ptr<DrawPolygon> data) : node_data(data.Pass()) {
|
| BspNode::~BspNode() {
|
| }
|
|
|
| -BspTree::BspTree(ScopedPtrDeque<DrawPolygon>* list) {
|
| +BspTree::BspTree(std::deque<scoped_ptr<DrawPolygon>>* list) {
|
| if (list->size() == 0)
|
| return;
|
|
|
| - root_ = make_scoped_ptr(new BspNode(list->take_front()));
|
| + root_ = make_scoped_ptr(new BspNode(PopFront(list)));
|
| BuildTree(root_.get(), list);
|
| }
|
|
|
| @@ -35,14 +35,14 @@ BspTree::BspTree(ScopedPtrDeque<DrawPolygon>* list) {
|
| // can always simply just take from the front of the deque for our node's
|
| // data.
|
| void BspTree::BuildTree(BspNode* node,
|
| - ScopedPtrDeque<DrawPolygon>* polygon_list) {
|
| - ScopedPtrDeque<DrawPolygon> front_list;
|
| - ScopedPtrDeque<DrawPolygon> back_list;
|
| + std::deque<scoped_ptr<DrawPolygon>>* polygon_list) {
|
| + std::deque<scoped_ptr<DrawPolygon>> front_list;
|
| + std::deque<scoped_ptr<DrawPolygon>> back_list;
|
|
|
| // We take in a list of polygons at this level of the tree, and have to
|
| // find a splitting plane, then classify polygons as either in front of
|
| // or behind that splitting plane.
|
| - while (polygon_list->size() > 0) {
|
| + while (!polygon_list->empty()) {
|
| // Is this particular polygon in front of or behind our splitting polygon.
|
| BspCompareResult comparer_result =
|
| GetNodePositionRelative(*polygon_list->front(), *(node->node_data));
|
| @@ -52,10 +52,10 @@ void BspTree::BuildTree(BspNode* node,
|
| // or front of the list.
|
| switch (comparer_result) {
|
| case BSP_FRONT:
|
| - front_list.push_back(polygon_list->take_front().Pass());
|
| + front_list.push_back(PopFront(polygon_list));
|
| break;
|
| case BSP_BACK:
|
| - back_list.push_back(polygon_list->take_front().Pass());
|
| + back_list.push_back(PopFront(polygon_list));
|
| break;
|
| case BSP_SPLIT:
|
| {
|
| @@ -63,7 +63,7 @@ void BspTree::BuildTree(BspNode* node,
|
| scoped_ptr<DrawPolygon> new_front;
|
| scoped_ptr<DrawPolygon> new_back;
|
| // Time to split this geometry, *it needs to be split by node_data.
|
| - polygon = polygon_list->take_front();
|
| + polygon = PopFront(polygon_list);
|
| bool split_result =
|
| polygon->Split(*(node->node_data), &new_front, &new_back);
|
| DCHECK(split_result);
|
| @@ -75,10 +75,10 @@ void BspTree::BuildTree(BspNode* node,
|
| break;
|
| }
|
| case BSP_COPLANAR_FRONT:
|
| - node->coplanars_front.push_back(polygon_list->take_front());
|
| + node->coplanars_front.push_back(PopFront(polygon_list));
|
| break;
|
| case BSP_COPLANAR_BACK:
|
| - node->coplanars_back.push_back(polygon_list->take_front());
|
| + node->coplanars_back.push_back(PopFront(polygon_list));
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -88,14 +88,13 @@ void BspTree::BuildTree(BspNode* node,
|
|
|
| // Build the back subtree using the front of the back_list as our splitter.
|
| if (back_list.size() > 0) {
|
| - node->back_child = make_scoped_ptr(new BspNode(back_list.take_front()));
|
| + node->back_child = make_scoped_ptr(new BspNode(PopFront(&back_list)));
|
| BuildTree(node->back_child.get(), &back_list);
|
| }
|
|
|
| // Build the front subtree using the front of the front_list as our splitter.
|
| if (front_list.size() > 0) {
|
| - node->front_child =
|
| - scoped_ptr<BspNode>(new BspNode(front_list.take_front()));
|
| + node->front_child = make_scoped_ptr(new BspNode(PopFront(&front_list)));
|
| BuildTree(node->front_child.get(), &front_list);
|
| }
|
| }
|
|
|