2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2018-04-13 13:48:15 -07:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#ifndef FLUTTER_SHELL_COMMON_THREAD_HOST_H_
|
|
|
|
|
#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
#include "flutter/fml/macros.h"
|
2018-04-13 13:48:15 -07:00
|
|
|
#include "flutter/fml/thread.h"
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
namespace flutter {
|
2018-04-13 13:48:15 -07:00
|
|
|
|
2019-06-13 16:15:10 -07:00
|
|
|
/// The collection of all the threads used by the engine.
|
2018-04-13 13:48:15 -07:00
|
|
|
struct ThreadHost {
|
|
|
|
|
enum Type {
|
|
|
|
|
Platform = 1 << 0,
|
|
|
|
|
UI = 1 << 1,
|
|
|
|
|
GPU = 1 << 2,
|
|
|
|
|
IO = 1 << 3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<fml::Thread> platform_thread;
|
|
|
|
|
std::unique_ptr<fml::Thread> ui_thread;
|
|
|
|
|
std::unique_ptr<fml::Thread> gpu_thread;
|
|
|
|
|
std::unique_ptr<fml::Thread> io_thread;
|
|
|
|
|
|
|
|
|
|
ThreadHost();
|
|
|
|
|
|
2018-11-12 19:59:29 -08:00
|
|
|
ThreadHost(ThreadHost&&);
|
2018-04-13 13:48:15 -07:00
|
|
|
|
|
|
|
|
ThreadHost& operator=(ThreadHost&&) = default;
|
|
|
|
|
|
|
|
|
|
ThreadHost(std::string name_prefix, uint64_t type_mask);
|
|
|
|
|
|
|
|
|
|
~ThreadHost();
|
|
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
|
};
|
|
|
|
|
|
2019-04-09 17:10:46 -07:00
|
|
|
} // namespace flutter
|
2018-04-13 13:48:15 -07:00
|
|
|
|
|
|
|
|
#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_
|