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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 static const int kWarmupRuns = 5; | 37 static const int kWarmupRuns = 5; |
38 static const int kTimeCheckInterval = 10; | 38 static const int kTimeCheckInterval = 10; |
39 | 39 |
40 class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient { | 40 class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient { |
41 public: | 41 public: |
42 // Overridden from TileTaskRunner: | 42 // Overridden from TileTaskRunner: |
43 void Shutdown() override {} | 43 void Shutdown() override {} |
44 void ScheduleTasks(TaskGraph* graph) override { | 44 void ScheduleTasks(TaskGraph* graph) override { |
45 for (auto& node : graph->nodes) { | 45 for (auto& node : graph->nodes) { |
46 TileTask* task = static_cast<TileTask*>(node.task); | 46 TileTask* task = static_cast<TileTask*>(node.task); |
47 | |
48 task->WillSchedule(); | |
49 task->ScheduleOnOriginThread(this); | |
50 task->DidSchedule(); | |
51 | |
52 completed_tasks_.push_back(task); | 47 completed_tasks_.push_back(task); |
53 } | 48 } |
54 } | 49 } |
55 void CheckForCompletedTasks() override { | 50 void CollectCompletedTasks(Task::Vector* completed_tasks) override { |
56 for (TileTask::Vector::iterator it = completed_tasks_.begin(); | 51 for (TileTask::Vector::iterator it = completed_tasks_.begin(); |
57 it != completed_tasks_.end(); ++it) { | 52 it != completed_tasks_.end(); ++it) { |
58 TileTask* task = it->get(); | 53 TileTask* task = it->get(); |
59 | |
60 task->WillComplete(); | |
61 task->CompleteOnOriginThread(this); | |
62 task->DidComplete(); | 54 task->DidComplete(); |
63 } | 55 } |
64 completed_tasks_.clear(); | 56 completed_tasks_.clear(); |
65 } | 57 } |
66 ResourceFormat GetResourceFormat(bool must_support_alpha) const override { | 58 ResourceFormat GetResourceFormat(bool must_support_alpha) const override { |
67 return RGBA_8888; | 59 return RGBA_8888; |
68 } | 60 } |
69 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override { | 61 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override { |
70 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); | 62 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); |
71 } | 63 } |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); | 466 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); |
475 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 467 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
476 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 468 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
477 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 469 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
478 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 470 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
479 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 471 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
480 } | 472 } |
481 | 473 |
482 } // namespace | 474 } // namespace |
483 } // namespace cc | 475 } // namespace cc |
OLD | NEW |