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

Side by Side Diff: cc/trees/occlusion_tracker_perftest.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.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/trees/layer_tree_settings.cc ('k') | cc/trees/property_tree_builder.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 "cc/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "cc/debug/lap_timer.h" 8 #include "cc/debug/lap_timer.h"
9 #include "cc/layers/layer_iterator.h" 9 #include "cc/layers/layer_iterator.h"
10 #include "cc/layers/solid_color_layer_impl.h" 10 #include "cc/layers/solid_color_layer_impl.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 scoped_ptr<SolidColorLayerImpl> opaque_layer = 87 scoped_ptr<SolidColorLayerImpl> opaque_layer =
88 SolidColorLayerImpl::Create(active_tree(), 2); 88 SolidColorLayerImpl::Create(active_tree(), 2);
89 opaque_layer->SetBackgroundColor(SK_ColorRED); 89 opaque_layer->SetBackgroundColor(SK_ColorRED);
90 opaque_layer->SetContentsOpaque(true); 90 opaque_layer->SetContentsOpaque(true);
91 opaque_layer->SetDrawsContent(true); 91 opaque_layer->SetDrawsContent(true);
92 opaque_layer->SetBounds(viewport_rect.size()); 92 opaque_layer->SetBounds(viewport_rect.size());
93 opaque_layer->SetContentBounds(viewport_rect.size()); 93 opaque_layer->SetContentBounds(viewport_rect.size());
94 active_tree()->root_layer()->AddChild(opaque_layer.Pass()); 94 active_tree()->root_layer()->AddChild(opaque_layer.Pass());
95 95
96 bool update_lcd_text = false; 96 active_tree()->UpdateDrawProperties();
97 active_tree()->UpdateDrawProperties(update_lcd_text);
98 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList(); 97 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList();
99 ASSERT_EQ(1u, rsll.size()); 98 ASSERT_EQ(1u, rsll.size());
100 EXPECT_EQ(1u, rsll[0]->render_surface()->layer_list().size()); 99 EXPECT_EQ(1u, rsll[0]->render_surface()->layer_list().size());
101 100
102 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll); 101 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll);
103 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll); 102 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll);
104 103
105 LayerIteratorPosition<LayerImpl> pos = begin; 104 LayerIteratorPosition<LayerImpl> pos = begin;
106 105
107 // The opaque_layer adds occlusion over the whole viewport. 106 // The opaque_layer adds occlusion over the whole viewport.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 opaque_layer->SetContentsOpaque(true); 157 opaque_layer->SetContentsOpaque(true);
159 opaque_layer->SetDrawsContent(true); 158 opaque_layer->SetDrawsContent(true);
160 opaque_layer->SetBounds( 159 opaque_layer->SetBounds(
161 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); 160 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2));
162 opaque_layer->SetContentBounds( 161 opaque_layer->SetContentBounds(
163 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); 162 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2));
164 opaque_layer->SetPosition(gfx::Point(i, i)); 163 opaque_layer->SetPosition(gfx::Point(i, i));
165 active_tree()->root_layer()->AddChild(opaque_layer.Pass()); 164 active_tree()->root_layer()->AddChild(opaque_layer.Pass());
166 } 165 }
167 166
168 bool update_lcd_text = false; 167 active_tree()->UpdateDrawProperties();
169 active_tree()->UpdateDrawProperties(update_lcd_text);
170 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList(); 168 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList();
171 ASSERT_EQ(1u, rsll.size()); 169 ASSERT_EQ(1u, rsll.size());
172 EXPECT_EQ(static_cast<size_t>(kNumOpaqueLayers), 170 EXPECT_EQ(static_cast<size_t>(kNumOpaqueLayers),
173 rsll[0]->render_surface()->layer_list().size()); 171 rsll[0]->render_surface()->layer_list().size());
174 172
175 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll); 173 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll);
176 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll); 174 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll);
177 175
178 // The opaque_layers add occlusion. 176 // The opaque_layers add occlusion.
179 for (int i = 0; i < kNumOpaqueLayers - 1; ++i) { 177 for (int i = 0; i < kNumOpaqueLayers - 1; ++i) {
(...skipping 28 matching lines...) Expand all
208 EXPECT_EQ(active_tree()->root_layer(), next.current_layer); 206 EXPECT_EQ(active_tree()->root_layer(), next.current_layer);
209 207
210 ++begin; 208 ++begin;
211 EXPECT_EQ(end, begin); 209 EXPECT_EQ(end, begin);
212 210
213 PrintResults(); 211 PrintResults();
214 } 212 }
215 213
216 } // namespace 214 } // namespace
217 } // namespace cc 215 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698