OLD | NEW |
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 "cc/output/bsp_tree.h" | 5 #include "cc/output/bsp_tree.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/scoped_ptr_deque.h" | 10 #include "cc/base/scoped_ptr_deque.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 front_list.push_back(polygon_list->take_front().Pass()); | 55 front_list.push_back(polygon_list->take_front().Pass()); |
56 break; | 56 break; |
57 case BSP_BACK: | 57 case BSP_BACK: |
58 back_list.push_back(polygon_list->take_front().Pass()); | 58 back_list.push_back(polygon_list->take_front().Pass()); |
59 break; | 59 break; |
60 case BSP_SPLIT: | 60 case BSP_SPLIT: |
61 { | 61 { |
62 scoped_ptr<DrawPolygon> polygon; | 62 scoped_ptr<DrawPolygon> polygon; |
63 scoped_ptr<DrawPolygon> new_front; | 63 scoped_ptr<DrawPolygon> new_front; |
64 scoped_ptr<DrawPolygon> new_back; | 64 scoped_ptr<DrawPolygon> new_back; |
| 65 bool split_result = false; |
65 // Time to split this geometry, *it needs to be split by node_data. | 66 // Time to split this geometry, *it needs to be split by node_data. |
66 polygon = polygon_list->take_front(); | 67 polygon = polygon_list->take_front(); |
67 bool split_result = | 68 split_result = |
68 polygon->Split(*(node->node_data), &new_front, &new_back); | 69 polygon->Split(*(node->node_data), &new_front, &new_back); |
69 DCHECK(split_result); | 70 DCHECK(split_result); |
70 if (!split_result) { | 71 if (!split_result) { |
71 break; | 72 break; |
72 } | 73 } |
73 front_list.push_back(new_front.Pass()); | 74 front_list.push_back(new_front.Pass()); |
74 back_list.push_back(new_back.Pass()); | 75 back_list.push_back(new_back.Pass()); |
75 break; | 76 break; |
76 } | 77 } |
77 case BSP_COPLANAR_FRONT: | 78 case BSP_COPLANAR_FRONT: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if (node.normal().z() > 0.0f) { | 111 if (node.normal().z() > 0.0f) { |
111 return BSP_FRONT; | 112 return BSP_FRONT; |
112 } | 113 } |
113 return BSP_BACK; | 114 return BSP_BACK; |
114 } | 115 } |
115 | 116 |
116 BspTree::~BspTree() { | 117 BspTree::~BspTree() { |
117 } | 118 } |
118 | 119 |
119 } // namespace cc | 120 } // namespace cc |
OLD | NEW |