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

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

Issue 862263004: cc: Make eviction queue building consistent with raster. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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_host_impl.cc ('k') | no next file » | 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 5818 matching lines...) Expand 10 before | Expand all | Expand 10 after
5829 5829
5830 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 5830 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
5831 5831
5832 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, 5832 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
5833 LayerTreeHostImpl::FrameData* frame_data, 5833 LayerTreeHostImpl::FrameData* frame_data,
5834 DrawResult draw_result) override { 5834 DrawResult draw_result) override {
5835 EXPECT_EQ(4u, host_impl->resource_provider()->num_resources()); 5835 EXPECT_EQ(4u, host_impl->resource_provider()->num_resources());
5836 5836
5837 // Verify which tiles got resources using an eviction iterator, which has to 5837 // Verify which tiles got resources using an eviction iterator, which has to
5838 // return all tiles that have resources. 5838 // return all tiles that have resources.
5839 EvictionTilePriorityQueue eviction_queue; 5839 scoped_ptr<EvictionTilePriorityQueue> eviction_queue(
5840 host_impl->BuildEvictionQueue(&eviction_queue, 5840 host_impl->BuildEvictionQueue(SAME_PRIORITY_FOR_BOTH_TREES));
5841 SAME_PRIORITY_FOR_BOTH_TREES);
5842 int tile_count = 0; 5841 int tile_count = 0;
5843 for (; !eviction_queue.IsEmpty(); eviction_queue.Pop()) { 5842 for (; !eviction_queue->IsEmpty(); eviction_queue->Pop()) {
5844 Tile* tile = eviction_queue.Top(); 5843 Tile* tile = eviction_queue->Top();
5845 // Ensure this tile is within the viewport. 5844 // Ensure this tile is within the viewport.
5846 EXPECT_TRUE(tile->content_rect().Intersects(gfx::Rect(viewport_size_))); 5845 EXPECT_TRUE(tile->content_rect().Intersects(gfx::Rect(viewport_size_)));
5847 // Ensure that the tile is 1/4 of the viewport tall (plus padding). 5846 // Ensure that the tile is 1/4 of the viewport tall (plus padding).
5848 EXPECT_EQ(tile->content_rect().height(), 5847 EXPECT_EQ(tile->content_rect().height(),
5849 (viewport_size_.height() / 4) + 2); 5848 (viewport_size_.height() / 4) + 2);
5850 ++tile_count; 5849 ++tile_count;
5851 } 5850 }
5852 EXPECT_EQ(4, tile_count); 5851 EXPECT_EQ(4, tile_count);
5853 EndTest(); 5852 EndTest();
5854 return draw_result; 5853 return draw_result;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
6171 6170
6172 void AfterTest() override { EXPECT_TRUE(did_commit_); } 6171 void AfterTest() override { EXPECT_TRUE(did_commit_); }
6173 6172
6174 private: 6173 private:
6175 bool did_commit_; 6174 bool did_commit_;
6176 }; 6175 };
6177 6176
6178 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); 6177 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit);
6179 6178
6180 } // namespace cc 6179 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698