| OLD | NEW |
| 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 "base/lazy_instance.h" | 5 #include "base/lazy_instance.h" |
| 6 #include "base/location.h" | 6 #include "base/location.h" |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "cc/debug/lap_timer.h" | 9 #include "cc/debug/lap_timer.h" |
| 10 #include "cc/raster/raster_buffer.h" | 10 #include "cc/raster/raster_buffer.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace cc { | 30 namespace cc { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 static const int kTimeLimitMillis = 2000; | 33 static const int kTimeLimitMillis = 2000; |
| 34 static const int kWarmupRuns = 5; | 34 static const int kWarmupRuns = 5; |
| 35 static const int kTimeCheckInterval = 10; | 35 static const int kTimeCheckInterval = 10; |
| 36 | 36 |
| 37 class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient { | 37 class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient { |
| 38 public: | 38 public: |
| 39 // Overridden from TileTaskRunner: | 39 // Overridden from TileTaskRunner: |
| 40 void SetClient(TileTaskRunnerClient* client) override {} | |
| 41 void Shutdown() override {} | 40 void Shutdown() override {} |
| 42 void ScheduleTasks(TileTaskQueue* queue) override { | 41 void ScheduleTasks(TaskGraph* graph) override { |
| 43 for (TileTaskQueue::Item::Vector::const_iterator it = queue->items.begin(); | 42 for (auto& node : graph->nodes) { |
| 44 it != queue->items.end(); ++it) { | 43 RasterTask* task = static_cast<RasterTask*>(node.task); |
| 45 RasterTask* task = it->task; | |
| 46 | 44 |
| 47 task->WillSchedule(); | 45 task->WillSchedule(); |
| 48 task->ScheduleOnOriginThread(this); | 46 task->ScheduleOnOriginThread(this); |
| 49 task->DidSchedule(); | 47 task->DidSchedule(); |
| 50 | 48 |
| 51 completed_tasks_.push_back(task); | 49 completed_tasks_.push_back(task); |
| 52 } | 50 } |
| 53 } | 51 } |
| 54 void CheckForCompletedTasks() override { | 52 void CheckForCompletedTasks() override { |
| 55 for (RasterTask::Vector::iterator it = completed_tasks_.begin(); | 53 for (RasterTask::Vector::iterator it = completed_tasks_.begin(); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); | 478 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); |
| 481 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 479 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
| 482 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 480 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
| 483 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 481 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
| 484 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 482 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
| 485 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 483 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
| 486 } | 484 } |
| 487 | 485 |
| 488 } // namespace | 486 } // namespace |
| 489 } // namespace cc | 487 } // namespace cc |
| OLD | NEW |