• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/common/task_runners.h"
6 
7 #include <utility>
8 
9 namespace flutter {
10 
TaskRunners(std::string label,fml::RefPtr<fml::TaskRunner> platform,fml::RefPtr<fml::TaskRunner> gpu,fml::RefPtr<fml::TaskRunner> ui,fml::RefPtr<fml::TaskRunner> io)11 TaskRunners::TaskRunners(std::string label,
12                          fml::RefPtr<fml::TaskRunner> platform,
13                          fml::RefPtr<fml::TaskRunner> gpu,
14                          fml::RefPtr<fml::TaskRunner> ui,
15                          fml::RefPtr<fml::TaskRunner> io)
16     : label_(std::move(label)),
17       platform_(std::move(platform)),
18       gpu_(std::move(gpu)),
19       ui_(std::move(ui)),
20       io_(std::move(io)) {}
21 
22 TaskRunners::TaskRunners(const TaskRunners& other) = default;
23 
24 TaskRunners::~TaskRunners() = default;
25 
GetLabel() const26 const std::string& TaskRunners::GetLabel() const {
27   return label_;
28 }
29 
GetPlatformTaskRunner() const30 fml::RefPtr<fml::TaskRunner> TaskRunners::GetPlatformTaskRunner() const {
31   return platform_;
32 }
33 
GetUITaskRunner() const34 fml::RefPtr<fml::TaskRunner> TaskRunners::GetUITaskRunner() const {
35   return ui_;
36 }
37 
GetIOTaskRunner() const38 fml::RefPtr<fml::TaskRunner> TaskRunners::GetIOTaskRunner() const {
39   return io_;
40 }
41 
GetGPUTaskRunner() const42 fml::RefPtr<fml::TaskRunner> TaskRunners::GetGPUTaskRunner() const {
43   return gpu_;
44 }
45 
IsValid() const46 bool TaskRunners::IsValid() const {
47   return platform_ && gpu_ && ui_ && io_;
48 }
49 
50 }  // namespace flutter
51