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

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

Issue 2867793002: Add a cache of LayerImpl's viewport layer type (Closed)
Patch Set: Rebase from space Created 3 years, 7 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/layers/layer_impl.cc ('k') | cc/trees/layer_tree_impl.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (scroll_info.scrolls[i].layer_id != id) 299 if (scroll_info.scrolls[i].layer_id != id)
300 continue; 300 continue;
301 times_encountered++; 301 times_encountered++;
302 } 302 }
303 303
304 ASSERT_EQ(0, times_encountered); 304 ASSERT_EQ(0, times_encountered);
305 } 305 }
306 306
307 LayerImpl* CreateScrollAndContentsLayers(LayerTreeImpl* layer_tree_impl, 307 LayerImpl* CreateScrollAndContentsLayers(LayerTreeImpl* layer_tree_impl,
308 const gfx::Size& content_size) { 308 const gfx::Size& content_size) {
309 // Clear any existing viewport layers that were setup so this function can
310 // be called multiple times.
311 layer_tree_impl->ClearViewportLayers();
312
309 // Create both an inner viewport scroll layer and an outer viewport scroll 313 // Create both an inner viewport scroll layer and an outer viewport scroll
310 // layer. The MaxScrollOffset of the outer viewport scroll layer will be 314 // layer. The MaxScrollOffset of the outer viewport scroll layer will be
311 // 0x0, so the scrolls will be applied directly to the inner viewport. 315 // 0x0, so the scrolls will be applied directly to the inner viewport.
312 const int kOuterViewportClipLayerId = 116; 316 const int kOuterViewportClipLayerId = 116;
313 const int kOuterViewportScrollLayerId = 117; 317 const int kOuterViewportScrollLayerId = 117;
314 const int kContentLayerId = 118; 318 const int kContentLayerId = 118;
315 const int kInnerViewportScrollLayerId = 2; 319 const int kInnerViewportScrollLayerId = 2;
316 const int kInnerViewportClipLayerId = 4; 320 const int kInnerViewportClipLayerId = 4;
317 const int kPageScaleLayerId = 5; 321 const int kPageScaleLayerId = 5;
318 322
(...skipping 12048 matching lines...) Expand 10 before | Expand all | Expand 10 after
12367 else 12371 else
12368 EXPECT_FALSE(tile->HasRasterTask()); 12372 EXPECT_FALSE(tile->HasRasterTask());
12369 } 12373 }
12370 Region expected_invalidation( 12374 Region expected_invalidation(
12371 raster_source->GetRectForImage(checkerable_image->uniqueID())); 12375 raster_source->GetRectForImage(checkerable_image->uniqueID()));
12372 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); 12376 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation()));
12373 } 12377 }
12374 12378
12375 } // namespace 12379 } // namespace
12376 } // namespace cc 12380 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698