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

Side by Side Diff: cc/resources/worker_pool_unittest.cc

Issue 110883015: Add preliminary support for hw-accelerated tile rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avoid implementing TestContextProvider::GrContext for now Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/worker_pool_perftest.cc ('k') | cc/test/fake_tile_manager.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resources/worker_pool.h" 5 #include "cc/resources/worker_pool.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/base/completion_event.h" 9 #include "cc/base/completion_event.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 scheduled_tasks_completion_.reset(new CompletionEvent); 110 scheduled_tasks_completion_.reset(new CompletionEvent);
111 111
112 SetTaskGraph(&new_graph); 112 SetTaskGraph(&new_graph);
113 113
114 dependents_.swap(new_dependents); 114 dependents_.swap(new_dependents);
115 completion_task_.swap(new_completion_task); 115 completion_task_.swap(new_completion_task);
116 tasks_.swap(new_tasks); 116 tasks_.swap(new_tasks);
117 } 117 }
118 118
119 void CheckForCompletedTasks() {
120 CheckForCompletedWorkerTasks();
121 }
122
119 void WaitForTasksToComplete() { 123 void WaitForTasksToComplete() {
120 DCHECK(scheduled_tasks_completion_); 124 DCHECK(scheduled_tasks_completion_);
121 scheduled_tasks_completion_->Wait(); 125 scheduled_tasks_completion_->Wait();
122 } 126 }
123 127
124 private: 128 private:
125 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; 129 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector;
126 130
127 void OnTasksCompleted() { 131 void OnTasksCompleted() {
128 DCHECK(scheduled_tasks_completion_); 132 DCHECK(scheduled_tasks_completion_);
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 EXPECT_EQ(1u, run_task_ids()[2]); 389 EXPECT_EQ(1u, run_task_ids()[2]);
386 ASSERT_EQ(3u, on_task_completed_ids().size()); 390 ASSERT_EQ(3u, on_task_completed_ids().size());
387 EXPECT_EQ(2u, on_task_completed_ids()[0]); 391 EXPECT_EQ(2u, on_task_completed_ids()[0]);
388 EXPECT_EQ(1u, on_task_completed_ids()[1]); 392 EXPECT_EQ(1u, on_task_completed_ids()[1]);
389 EXPECT_EQ(0u, on_task_completed_ids()[2]); 393 EXPECT_EQ(0u, on_task_completed_ids()[2]);
390 } 394 }
391 395
392 } // namespace 396 } // namespace
393 397
394 } // namespace cc 398 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/worker_pool_perftest.cc ('k') | cc/test/fake_tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698