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

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

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 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 active_tree()->UpdateDrawProperties(); 96 bool update_lcd_text = false;
97 active_tree()->UpdateDrawProperties(update_lcd_text);
97 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList(); 98 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList();
98 ASSERT_EQ(1u, rsll.size()); 99 ASSERT_EQ(1u, rsll.size());
99 EXPECT_EQ(1u, rsll[0]->render_surface()->layer_list().size()); 100 EXPECT_EQ(1u, rsll[0]->render_surface()->layer_list().size());
100 101
101 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll); 102 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll);
102 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll); 103 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll);
103 104
104 LayerIteratorPosition<LayerImpl> pos = begin; 105 LayerIteratorPosition<LayerImpl> pos = begin;
105 106
106 // The opaque_layer adds occlusion over the whole viewport. 107 // The opaque_layer adds occlusion over the whole viewport.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 opaque_layer->SetContentsOpaque(true); 158 opaque_layer->SetContentsOpaque(true);
158 opaque_layer->SetDrawsContent(true); 159 opaque_layer->SetDrawsContent(true);
159 opaque_layer->SetBounds( 160 opaque_layer->SetBounds(
160 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); 161 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2));
161 opaque_layer->SetContentBounds( 162 opaque_layer->SetContentBounds(
162 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2)); 163 gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2));
163 opaque_layer->SetPosition(gfx::Point(i, i)); 164 opaque_layer->SetPosition(gfx::Point(i, i));
164 active_tree()->root_layer()->AddChild(opaque_layer.Pass()); 165 active_tree()->root_layer()->AddChild(opaque_layer.Pass());
165 } 166 }
166 167
167 active_tree()->UpdateDrawProperties(); 168 bool update_lcd_text = false;
169 active_tree()->UpdateDrawProperties(update_lcd_text);
168 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList(); 170 const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList();
169 ASSERT_EQ(1u, rsll.size()); 171 ASSERT_EQ(1u, rsll.size());
170 EXPECT_EQ(static_cast<size_t>(kNumOpaqueLayers), 172 EXPECT_EQ(static_cast<size_t>(kNumOpaqueLayers),
171 rsll[0]->render_surface()->layer_list().size()); 173 rsll[0]->render_surface()->layer_list().size());
172 174
173 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll); 175 LayerIterator<LayerImpl> begin = LayerIterator<LayerImpl>::Begin(&rsll);
174 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll); 176 LayerIterator<LayerImpl> end = LayerIterator<LayerImpl>::End(&rsll);
175 177
176 // The opaque_layers add occlusion. 178 // The opaque_layers add occlusion.
177 for (int i = 0; i < kNumOpaqueLayers - 1; ++i) { 179 for (int i = 0; i < kNumOpaqueLayers - 1; ++i) {
(...skipping 28 matching lines...) Expand all
206 EXPECT_EQ(active_tree()->root_layer(), next.current_layer); 208 EXPECT_EQ(active_tree()->root_layer(), next.current_layer);
207 209
208 ++begin; 210 ++begin;
209 EXPECT_EQ(end, begin); 211 EXPECT_EQ(end, begin);
210 212
211 PrintResults(); 213 PrintResults();
212 } 214 }
213 215
214 } // namespace 216 } // namespace
215 } // namespace cc 217 } // 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