| 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 #ifndef CC_OUTPUT_BSP_TREE_H_ | 5 #ifndef CC_OUTPUT_BSP_TREE_H_ |
| 6 #define CC_OUTPUT_BSP_TREE_H_ | 6 #define CC_OUTPUT_BSP_TREE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 ScopedPtrVector<DrawPolygon> coplanars_front; | 22 ScopedPtrVector<DrawPolygon> coplanars_front; |
| 23 ScopedPtrVector<DrawPolygon> coplanars_back; | 23 ScopedPtrVector<DrawPolygon> coplanars_back; |
| 24 | 24 |
| 25 scoped_ptr<BspNode> back_child; | 25 scoped_ptr<BspNode> back_child; |
| 26 scoped_ptr<BspNode> front_child; | 26 scoped_ptr<BspNode> front_child; |
| 27 | 27 |
| 28 explicit BspNode(scoped_ptr<DrawPolygon> data); | 28 explicit BspNode(scoped_ptr<DrawPolygon> data); |
| 29 ~BspNode(); | 29 ~BspNode(); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 class CC_EXPORT BspTree { | 32 class BspTree { |
| 33 public: | 33 public: |
| 34 explicit BspTree(ScopedPtrDeque<DrawPolygon>* list); | 34 explicit BspTree(ScopedPtrDeque<DrawPolygon>* list); |
| 35 scoped_ptr<BspNode>& root() { return root_; } | 35 scoped_ptr<BspNode>& root() { return root_; } |
| 36 | 36 |
| 37 template <typename ActionHandlerType> | 37 template <typename ActionHandlerType> |
| 38 void TraverseWithActionHandler(ActionHandlerType* action_handler) const { | 38 void TraverseWithActionHandler(ActionHandlerType* action_handler) const { |
| 39 if (root_) { | 39 if (root_) { |
| 40 WalkInOrderRecursion<ActionHandlerType>(action_handler, root_.get()); | 40 WalkInOrderRecursion<ActionHandlerType>(action_handler, root_.get()); |
| 41 } | 41 } |
| 42 } | 42 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 static BspCompareResult GetNodePositionRelative(const DrawPolygon& node_a, | 105 static BspCompareResult GetNodePositionRelative(const DrawPolygon& node_a, |
| 106 const DrawPolygon& node_b); | 106 const DrawPolygon& node_b); |
| 107 // Returns whether or not our viewer is in front of or behind the plane | 107 // Returns whether or not our viewer is in front of or behind the plane |
| 108 // defined by this polygon/node | 108 // defined by this polygon/node |
| 109 static BspCompareResult GetCameraPositionRelative(const DrawPolygon& node); | 109 static BspCompareResult GetCameraPositionRelative(const DrawPolygon& node); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace cc | 112 } // namespace cc |
| 113 | 113 |
| 114 #endif // CC_OUTPUT_BSP_TREE_H_ | 114 #endif // CC_OUTPUT_BSP_TREE_H_ |
| OLD | NEW |