forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_runners.cc
50 lines (37 loc) · 1.3 KB
/
task_runners.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/common/task_runners.h"
#include <utility>
namespace flutter {
TaskRunners::TaskRunners(std::string label,
fml::RefPtr<fml::TaskRunner> platform,
fml::RefPtr<fml::TaskRunner> raster,
fml::RefPtr<fml::TaskRunner> ui,
fml::RefPtr<fml::TaskRunner> io)
: label_(std::move(label)),
platform_(std::move(platform)),
raster_(std::move(raster)),
ui_(std::move(ui)),
io_(std::move(io)) {}
TaskRunners::TaskRunners(const TaskRunners& other) = default;
TaskRunners::~TaskRunners() = default;
const std::string& TaskRunners::GetLabel() const {
return label_;
}
fml::RefPtr<fml::TaskRunner> TaskRunners::GetPlatformTaskRunner() const {
return platform_;
}
fml::RefPtr<fml::TaskRunner> TaskRunners::GetUITaskRunner() const {
return ui_;
}
fml::RefPtr<fml::TaskRunner> TaskRunners::GetIOTaskRunner() const {
return io_;
}
fml::RefPtr<fml::TaskRunner> TaskRunners::GetRasterTaskRunner() const {
return raster_;
}
bool TaskRunners::IsValid() const {
return platform_ && raster_ && ui_ && io_;
}
} // namespace flutter