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

Side by Side Diff: cc/output/bsp_tree.cc

Issue 998023002: Revert of Splitting of layers for correct intersections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « cc/cc_tests.gyp ('k') | cc/output/bsp_walk_action.h » ('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 "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
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
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
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/bsp_walk_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698