Rename ftl to fxl in Fuchsia specific code (flutter/engine#4090)
This commit is contained in:
committed by
GitHub
parent
87b7a7de63
commit
fa539e618e
@@ -9,10 +9,10 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/ftl/files/file.h"
|
||||
#include "lib/ftl/files/path.h"
|
||||
#include "lib/ftl/files/unique_fd.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/files/file.h"
|
||||
#include "lib/fxl/files/path.h"
|
||||
#include "lib/fxl/files/unique_fd.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string DirectoryAssetBundle::GetPathForAsset(
|
||||
const std::string& asset_name) {
|
||||
std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name);
|
||||
if (asset_path.find(directory_) != 0u) {
|
||||
FTL_LOG(ERROR) << "Asset name '" << asset_name
|
||||
FXL_LOG(ERROR) << "Asset name '" << asset_name
|
||||
<< "' attempted to traverse outside asset bundle.";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -24,7 +24,7 @@ class DirectoryAssetBundle {
|
||||
|
||||
const std::string directory_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "flutter/assets/unzipper_provider.h"
|
||||
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "third_party/zlib/contrib/minizip/unzip.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -13,7 +13,7 @@ UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) {
|
||||
return [zip_path]() {
|
||||
zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr));
|
||||
if (!unzipper.is_valid())
|
||||
FTL_LOG(ERROR) << "Unable to open zip file: " << zip_path;
|
||||
FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path;
|
||||
return unzipper;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/ftl/files/unique_fd.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/files/unique_fd.h"
|
||||
#include "flutter/glue/trace_event.h"
|
||||
#include "lib/zip/unique_unzipper.h"
|
||||
|
||||
@@ -43,13 +43,13 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name,
|
||||
|
||||
result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos));
|
||||
if (result != UNZ_OK) {
|
||||
FTL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result;
|
||||
FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result;
|
||||
return false;
|
||||
}
|
||||
|
||||
result = unzOpenCurrentFile(unzipper.get());
|
||||
if (result != UNZ_OK) {
|
||||
FTL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result;
|
||||
FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
#include <vector>
|
||||
|
||||
#include "flutter/assets/unzipper_provider.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/ref_counted.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "third_party/zlib/contrib/minizip/unzip.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
class ZipAssetStore : public ftl::RefCountedThreadSafe<ZipAssetStore> {
|
||||
class ZipAssetStore : public fxl::RefCountedThreadSafe<ZipAssetStore> {
|
||||
public:
|
||||
explicit ZipAssetStore(UnzipperProvider unzipper_provider);
|
||||
~ZipAssetStore();
|
||||
@@ -35,7 +35,7 @@ class ZipAssetStore : public ftl::RefCountedThreadSafe<ZipAssetStore> {
|
||||
|
||||
void BuildStatCache();
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore);
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace blink {
|
||||
namespace {
|
||||
@@ -16,12 +16,12 @@ Settings* g_settings = nullptr;
|
||||
} // namespace
|
||||
|
||||
const Settings& Settings::Get() {
|
||||
FTL_CHECK(g_settings);
|
||||
FXL_CHECK(g_settings);
|
||||
return *g_settings;
|
||||
}
|
||||
|
||||
void Settings::Set(const Settings& settings) {
|
||||
FTL_CHECK(!g_settings);
|
||||
FXL_CHECK(!g_settings);
|
||||
g_settings = new Settings();
|
||||
*g_settings = settings;
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ Threads* g_threads = nullptr;
|
||||
|
||||
Threads::Threads() {}
|
||||
|
||||
Threads::Threads(ftl::RefPtr<ftl::TaskRunner> platform,
|
||||
ftl::RefPtr<ftl::TaskRunner> gpu,
|
||||
ftl::RefPtr<ftl::TaskRunner> ui,
|
||||
ftl::RefPtr<ftl::TaskRunner> io)
|
||||
Threads::Threads(fxl::RefPtr<fxl::TaskRunner> platform,
|
||||
fxl::RefPtr<fxl::TaskRunner> gpu,
|
||||
fxl::RefPtr<fxl::TaskRunner> ui,
|
||||
fxl::RefPtr<fxl::TaskRunner> io)
|
||||
: platform_(std::move(platform)),
|
||||
gpu_(std::move(gpu)),
|
||||
ui_(std::move(ui)),
|
||||
@@ -26,29 +26,29 @@ Threads::Threads(ftl::RefPtr<ftl::TaskRunner> platform,
|
||||
|
||||
Threads::~Threads() {}
|
||||
|
||||
const ftl::RefPtr<ftl::TaskRunner>& Threads::Platform() {
|
||||
const fxl::RefPtr<fxl::TaskRunner>& Threads::Platform() {
|
||||
return Get().platform_;
|
||||
}
|
||||
|
||||
const ftl::RefPtr<ftl::TaskRunner>& Threads::Gpu() {
|
||||
const fxl::RefPtr<fxl::TaskRunner>& Threads::Gpu() {
|
||||
return Get().gpu_;
|
||||
}
|
||||
|
||||
const ftl::RefPtr<ftl::TaskRunner>& Threads::UI() {
|
||||
const fxl::RefPtr<fxl::TaskRunner>& Threads::UI() {
|
||||
return Get().ui_;
|
||||
}
|
||||
|
||||
const ftl::RefPtr<ftl::TaskRunner>& Threads::IO() {
|
||||
const fxl::RefPtr<fxl::TaskRunner>& Threads::IO() {
|
||||
return Get().io_;
|
||||
}
|
||||
|
||||
const Threads& Threads::Get() {
|
||||
FTL_CHECK(g_threads);
|
||||
FXL_CHECK(g_threads);
|
||||
return *g_threads;
|
||||
}
|
||||
|
||||
void Threads::Set(const Threads& threads) {
|
||||
FTL_CHECK(!g_threads);
|
||||
FXL_CHECK(!g_threads);
|
||||
g_threads = new Threads();
|
||||
*g_threads = threads;
|
||||
}
|
||||
|
||||
@@ -5,42 +5,42 @@
|
||||
#ifndef FLUTTER_COMMON_THREADS_H_
|
||||
#define FLUTTER_COMMON_THREADS_H_
|
||||
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
#include "lib/fxl/tasks/task_runner.h"
|
||||
|
||||
#define ASSERT_IS_PLATFORM_THREAD \
|
||||
FTL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread());
|
||||
FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread());
|
||||
#define ASSERT_IS_GPU_THREAD \
|
||||
FTL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread());
|
||||
FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread());
|
||||
#define ASSERT_IS_UI_THREAD \
|
||||
FTL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread());
|
||||
FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread());
|
||||
#define ASSERT_IS_IO_THREAD \
|
||||
FTL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread());
|
||||
FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread());
|
||||
|
||||
namespace blink {
|
||||
|
||||
class Threads {
|
||||
public:
|
||||
Threads();
|
||||
Threads(ftl::RefPtr<ftl::TaskRunner> platform,
|
||||
ftl::RefPtr<ftl::TaskRunner> gpu,
|
||||
ftl::RefPtr<ftl::TaskRunner> ui,
|
||||
ftl::RefPtr<ftl::TaskRunner> io);
|
||||
Threads(fxl::RefPtr<fxl::TaskRunner> platform,
|
||||
fxl::RefPtr<fxl::TaskRunner> gpu,
|
||||
fxl::RefPtr<fxl::TaskRunner> ui,
|
||||
fxl::RefPtr<fxl::TaskRunner> io);
|
||||
~Threads();
|
||||
|
||||
static const ftl::RefPtr<ftl::TaskRunner>& Platform();
|
||||
static const ftl::RefPtr<ftl::TaskRunner>& Gpu();
|
||||
static const ftl::RefPtr<ftl::TaskRunner>& UI();
|
||||
static const ftl::RefPtr<ftl::TaskRunner>& IO();
|
||||
static const fxl::RefPtr<fxl::TaskRunner>& Platform();
|
||||
static const fxl::RefPtr<fxl::TaskRunner>& Gpu();
|
||||
static const fxl::RefPtr<fxl::TaskRunner>& UI();
|
||||
static const fxl::RefPtr<fxl::TaskRunner>& IO();
|
||||
|
||||
static void Set(const Threads& settings);
|
||||
|
||||
private:
|
||||
static const Threads& Get();
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> platform_;
|
||||
ftl::RefPtr<ftl::TaskRunner> gpu_;
|
||||
ftl::RefPtr<ftl::TaskRunner> ui_;
|
||||
ftl::RefPtr<ftl::TaskRunner> io_;
|
||||
fxl::RefPtr<fxl::TaskRunner> platform_;
|
||||
fxl::RefPtr<fxl::TaskRunner> gpu_;
|
||||
fxl::RefPtr<fxl::TaskRunner> ui_;
|
||||
fxl::RefPtr<fxl::TaskRunner> io_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -50,7 +50,7 @@ source_set("flow") {
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
"//garnet/public/lib/ftl",
|
||||
"//garnet/public/lib/fxl",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "flutter/flow/instrumentation.h"
|
||||
#include "flutter/flow/process_info.h"
|
||||
#include "flutter/flow/raster_cache.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkPictureRecorder.h"
|
||||
|
||||
@@ -44,7 +44,7 @@ class CompositorContext {
|
||||
|
||||
friend class CompositorContext;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame);
|
||||
};
|
||||
|
||||
CompositorContext(std::unique_ptr<ProcessInfo> info);
|
||||
@@ -79,7 +79,7 @@ class CompositorContext {
|
||||
|
||||
void EndFrame(ScopedFrame& frame, bool enable_instrumentation);
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(CompositorContext);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "flutter/flow/matrix_decomposition.h"
|
||||
#include "flutter/flow/raster_cache_key.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkMatrix.h"
|
||||
#include "third_party/skia/include/core/SkMatrix44.h"
|
||||
#include "third_party/skia/include/core/SkPoint3.h"
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
#include "flutter/flow/export_node.h"
|
||||
|
||||
#include "flutter/common/threads.h"
|
||||
#include "lib/ftl/functional/make_copyable.h"
|
||||
#include "lib/fxl/functional/make_copyable.h"
|
||||
|
||||
namespace flow {
|
||||
|
||||
ExportNodeHolder::ExportNodeHolder(
|
||||
ftl::RefPtr<zircon::dart::Handle> export_token_handle)
|
||||
fxl::RefPtr<zircon::dart::Handle> export_token_handle)
|
||||
: export_node_(std::make_unique<ExportNode>(export_token_handle)) {
|
||||
ASSERT_IS_UI_THREAD;
|
||||
}
|
||||
@@ -26,18 +26,18 @@ void ExportNodeHolder::Bind(SceneUpdateContext& context,
|
||||
ExportNodeHolder::~ExportNodeHolder() {
|
||||
ASSERT_IS_UI_THREAD;
|
||||
blink::Threads::Gpu()->PostTask(
|
||||
ftl::MakeCopyable([export_node = std::move(export_node_)]() {
|
||||
fxl::MakeCopyable([export_node = std::move(export_node_)]() {
|
||||
export_node->Dispose(true);
|
||||
}));
|
||||
}
|
||||
|
||||
ExportNode::ExportNode(ftl::RefPtr<zircon::dart::Handle> export_token_handle)
|
||||
ExportNode::ExportNode(fxl::RefPtr<zircon::dart::Handle> export_token_handle)
|
||||
: export_token_(export_token_handle->ReleaseHandle()) {}
|
||||
|
||||
ExportNode::~ExportNode() {
|
||||
// Ensure that we properly released the node.
|
||||
FTL_DCHECK(!node_);
|
||||
FTL_DCHECK(scene_update_context_ == nullptr);
|
||||
FXL_DCHECK(!node_);
|
||||
FXL_DCHECK(scene_update_context_ == nullptr);
|
||||
}
|
||||
|
||||
void ExportNode::Bind(SceneUpdateContext& context,
|
||||
@@ -75,7 +75,7 @@ void ExportNode::Dispose(bool remove_from_scene_update_context) {
|
||||
// 1. A node was never created, or
|
||||
// 2. A node was created but was already dereferenced (i.e. Dispose has
|
||||
// already been called).
|
||||
FTL_DCHECK(scene_update_context_ || !node_);
|
||||
FXL_DCHECK(scene_update_context_ || !node_);
|
||||
|
||||
if (remove_from_scene_update_context && scene_update_context_) {
|
||||
scene_update_context_->RemoveExportNode(this);
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "flutter/flow/scene_update_context.h"
|
||||
#include "dart-pkg/zircon/sdk_ext/handle.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/ref_counted.h"
|
||||
#include "lib/ftl/synchronization/mutex.h"
|
||||
#include "lib/ftl/synchronization/thread_annotations.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "lib/fxl/synchronization/mutex.h"
|
||||
#include "lib/fxl/synchronization/thread_annotations.h"
|
||||
#include "third_party/skia/include/core/SkPoint.h"
|
||||
|
||||
namespace flow {
|
||||
@@ -24,9 +24,9 @@ namespace flow {
|
||||
// Wrapper class for ExportNode to use on UI Thread. When ExportNodeHolder is
|
||||
// destroyed, a task is posted on the Rasterizer thread to dispose the resources
|
||||
// held by the ExportNode.
|
||||
class ExportNodeHolder : public ftl::RefCountedThreadSafe<ExportNodeHolder> {
|
||||
class ExportNodeHolder : public fxl::RefCountedThreadSafe<ExportNodeHolder> {
|
||||
public:
|
||||
ExportNodeHolder(ftl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
ExportNodeHolder(fxl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
~ExportNodeHolder();
|
||||
|
||||
// Calls Bind() on the wrapped ExportNode.
|
||||
@@ -42,7 +42,7 @@ class ExportNodeHolder : public ftl::RefCountedThreadSafe<ExportNodeHolder> {
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(ExportNodeHolder);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder);
|
||||
};
|
||||
|
||||
// Represents a node which is being exported from the session.
|
||||
@@ -50,7 +50,7 @@ class ExportNodeHolder : public ftl::RefCountedThreadSafe<ExportNodeHolder> {
|
||||
// must be created and destroyed by the rasterizer thread.
|
||||
class ExportNode {
|
||||
public:
|
||||
ExportNode(ftl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
ExportNode(fxl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
|
||||
~ExportNode();
|
||||
|
||||
@@ -74,7 +74,7 @@ class ExportNode {
|
||||
mx::eventpair export_token_;
|
||||
std::unique_ptr<scenic_lib::EntityNode> node_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ExportNode);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -14,28 +14,28 @@ namespace flow {
|
||||
static const size_t kMaxSamples = 120;
|
||||
static const size_t kMaxFrameMarkers = 8;
|
||||
|
||||
Stopwatch::Stopwatch() : start_(ftl::TimePoint::Now()), current_sample_(0) {
|
||||
const ftl::TimeDelta delta = ftl::TimeDelta::Zero();
|
||||
Stopwatch::Stopwatch() : start_(fxl::TimePoint::Now()), current_sample_(0) {
|
||||
const fxl::TimeDelta delta = fxl::TimeDelta::Zero();
|
||||
laps_.resize(kMaxSamples, delta);
|
||||
}
|
||||
|
||||
Stopwatch::~Stopwatch() = default;
|
||||
|
||||
void Stopwatch::Start() {
|
||||
start_ = ftl::TimePoint::Now();
|
||||
start_ = fxl::TimePoint::Now();
|
||||
current_sample_ = (current_sample_ + 1) % kMaxSamples;
|
||||
}
|
||||
|
||||
void Stopwatch::Stop() {
|
||||
laps_[current_sample_] = ftl::TimePoint::Now() - start_;
|
||||
laps_[current_sample_] = fxl::TimePoint::Now() - start_;
|
||||
}
|
||||
|
||||
void Stopwatch::SetLapTime(const ftl::TimeDelta& delta) {
|
||||
void Stopwatch::SetLapTime(const fxl::TimeDelta& delta) {
|
||||
current_sample_ = (current_sample_ + 1) % kMaxSamples;
|
||||
laps_[current_sample_] = delta;
|
||||
}
|
||||
|
||||
const ftl::TimeDelta& Stopwatch::LastLap() const {
|
||||
const fxl::TimeDelta& Stopwatch::LastLap() const {
|
||||
return laps_[(current_sample_ - 1) % kMaxSamples];
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ static inline double UnitHeight(double frame_time_ms,
|
||||
return unitHeight;
|
||||
}
|
||||
|
||||
ftl::TimeDelta Stopwatch::MaxDelta() const {
|
||||
ftl::TimeDelta max_delta;
|
||||
fxl::TimeDelta Stopwatch::MaxDelta() const {
|
||||
fxl::TimeDelta max_delta;
|
||||
for (size_t i = 0; i < kMaxSamples; i++) {
|
||||
if (laps_[i] > max_delta)
|
||||
max_delta = laps_[i];
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/time/time_delta.h"
|
||||
#include "lib/ftl/time/time_point.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/time/time_delta.h"
|
||||
#include "lib/fxl/time/time_point.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
|
||||
namespace flow {
|
||||
@@ -22,11 +22,11 @@ class Stopwatch {
|
||||
|
||||
~Stopwatch();
|
||||
|
||||
const ftl::TimeDelta& LastLap() const;
|
||||
const fxl::TimeDelta& LastLap() const;
|
||||
|
||||
ftl::TimeDelta CurrentLap() const { return ftl::TimePoint::Now() - start_; }
|
||||
fxl::TimeDelta CurrentLap() const { return fxl::TimePoint::Now() - start_; }
|
||||
|
||||
ftl::TimeDelta MaxDelta() const;
|
||||
fxl::TimeDelta MaxDelta() const;
|
||||
|
||||
void Visualize(SkCanvas& canvas, const SkRect& rect) const;
|
||||
|
||||
@@ -34,14 +34,14 @@ class Stopwatch {
|
||||
|
||||
void Stop();
|
||||
|
||||
void SetLapTime(const ftl::TimeDelta& delta);
|
||||
void SetLapTime(const fxl::TimeDelta& delta);
|
||||
|
||||
private:
|
||||
ftl::TimePoint start_;
|
||||
std::vector<ftl::TimeDelta> laps_;
|
||||
fxl::TimePoint start_;
|
||||
std::vector<fxl::TimeDelta> laps_;
|
||||
size_t current_sample_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
|
||||
};
|
||||
|
||||
class Counter {
|
||||
@@ -57,7 +57,7 @@ class Counter {
|
||||
private:
|
||||
size_t count_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Counter);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Counter);
|
||||
};
|
||||
|
||||
class CounterValues {
|
||||
@@ -80,7 +80,7 @@ class CounterValues {
|
||||
std::vector<int64_t> values_;
|
||||
size_t current_sample_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(CounterValues);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(CounterValues);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -14,7 +14,7 @@ BackdropFilterLayer::~BackdropFilterLayer() = default;
|
||||
|
||||
void BackdropFilterLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
Layer::AutoSaveLayer(context, SkCanvas::SaveLayerRec{&paint_bounds(), nullptr,
|
||||
filter_.get(), 0});
|
||||
|
||||
@@ -21,7 +21,7 @@ class BackdropFilterLayer : public ContainerLayer {
|
||||
private:
|
||||
sk_sp<SkImageFilter> filter_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -15,11 +15,11 @@ void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
}
|
||||
|
||||
void ChildSceneLayer::Paint(PaintContext& context) {
|
||||
FTL_NOTREACHED() << "This layer never needs painting.";
|
||||
FXL_NOTREACHED() << "This layer never needs painting.";
|
||||
}
|
||||
|
||||
void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
// TODO(MZ-191): Set clip.
|
||||
// It's worth asking whether all children should be clipped implicitly
|
||||
|
||||
@@ -21,7 +21,7 @@ class ChildSceneLayer : public Layer {
|
||||
void set_size(const SkSize& size) { size_ = size; }
|
||||
|
||||
void set_export_node_holder(
|
||||
ftl::RefPtr<ExportNodeHolder> export_node_holder) {
|
||||
fxl::RefPtr<ExportNodeHolder> export_node_holder) {
|
||||
export_node_holder_ = std::move(export_node_holder);
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ class ChildSceneLayer : public Layer {
|
||||
private:
|
||||
SkPoint offset_;
|
||||
SkSize size_;
|
||||
ftl::RefPtr<ExportNodeHolder> export_node_holder_;
|
||||
fxl::RefPtr<ExportNodeHolder> export_node_holder_;
|
||||
bool hit_testable_ = true;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -28,7 +28,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
// TODO(MZ-140): Must be able to specify paths as shapes to nodes.
|
||||
// Treating the shape as a rectangle for now.
|
||||
@@ -46,7 +46,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
|
||||
void ClipPathLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "ClipPathLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
Layer::AutoSaveLayer save(context, paint_bounds(), nullptr);
|
||||
context.canvas.clipPath(clip_path_, true);
|
||||
|
||||
@@ -26,7 +26,7 @@ class ClipPathLayer : public ContainerLayer {
|
||||
private:
|
||||
SkPath clip_path_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -22,7 +22,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
scenic_lib::Rectangle shape(context.session(), // session
|
||||
clip_rect_.width(), // width
|
||||
@@ -37,7 +37,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
|
||||
void ClipRectLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "ClipRectLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
SkAutoCanvasRestore save(&context.canvas, true);
|
||||
context.canvas.clipRect(paint_bounds());
|
||||
|
||||
@@ -26,7 +26,7 @@ class ClipRectLayer : public ContainerLayer {
|
||||
private:
|
||||
SkRect clip_rect_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -22,7 +22,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
// TODO(MZ-137): Need to be able to express the radii as vectors.
|
||||
scenic_lib::RoundedRectangle shape(
|
||||
@@ -44,7 +44,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
|
||||
void ClipRRectLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "ClipRRectLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
Layer::AutoSaveLayer save(context, paint_bounds(), nullptr);
|
||||
context.canvas.clipRRect(clip_rrect_, true);
|
||||
|
||||
@@ -26,7 +26,7 @@ class ClipRRectLayer : public ContainerLayer {
|
||||
private:
|
||||
SkRRect clip_rrect_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -12,7 +12,7 @@ ColorFilterLayer::~ColorFilterLayer() = default;
|
||||
|
||||
void ColorFilterLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "ColorFilterLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
sk_sp<SkColorFilter> color_filter =
|
||||
SkColorFilter::MakeModeFilter(color_, blend_mode_);
|
||||
|
||||
@@ -24,7 +24,7 @@ class ColorFilterLayer : public ContainerLayer {
|
||||
SkColor color_;
|
||||
SkBlendMode blend_mode_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -38,7 +38,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context,
|
||||
}
|
||||
|
||||
void ContainerLayer::PaintChildren(PaintContext& context) const {
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
// Intentionally not tracing here as there should be no self-time
|
||||
// and the trace event on this common function has a small overhead.
|
||||
@@ -56,7 +56,7 @@ void ContainerLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
}
|
||||
|
||||
void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
// Paint all of the layers which need to be drawn into the container.
|
||||
// These may be flattened down to a containing
|
||||
|
||||
@@ -38,7 +38,7 @@ class ContainerLayer : public Layer {
|
||||
private:
|
||||
std::vector<std::unique_ptr<Layer>> layers_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include "flutter/flow/instrumentation.h"
|
||||
#include "flutter/flow/raster_cache.h"
|
||||
#include "flutter/glue/trace_event.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "third_party/skia/include/core/SkColorFilter.h"
|
||||
@@ -108,7 +108,7 @@ class Layer {
|
||||
bool needs_system_composite_;
|
||||
SkRect paint_bounds_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Layer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Layer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
#include "flutter/flow/compositor_context.h"
|
||||
#include "flutter/flow/layers/layer.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/time/time_delta.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/time/time_delta.h"
|
||||
#include "third_party/skia/include/core/SkSize.h"
|
||||
|
||||
namespace flow {
|
||||
@@ -51,11 +51,11 @@ class LayerTree {
|
||||
|
||||
void set_frame_size(const SkISize& frame_size) { frame_size_ = frame_size; }
|
||||
|
||||
void set_construction_time(const ftl::TimeDelta& delta) {
|
||||
void set_construction_time(const fxl::TimeDelta& delta) {
|
||||
construction_time_ = delta;
|
||||
}
|
||||
|
||||
const ftl::TimeDelta& construction_time() const { return construction_time_; }
|
||||
const fxl::TimeDelta& construction_time() const { return construction_time_; }
|
||||
|
||||
// The number of frame intervals missed after which the compositor must
|
||||
// trace the rasterized picture to a trace file. Specify 0 to disable all
|
||||
@@ -79,7 +79,7 @@ class LayerTree {
|
||||
private:
|
||||
SkISize frame_size_; // Physical pixels.
|
||||
std::unique_ptr<Layer> root_layer_;
|
||||
ftl::TimeDelta construction_time_;
|
||||
fxl::TimeDelta construction_time_;
|
||||
uint32_t rasterizer_tracing_threshold_;
|
||||
bool checkerboard_raster_cache_images_;
|
||||
bool checkerboard_offscreen_layers_;
|
||||
@@ -88,7 +88,7 @@ class LayerTree {
|
||||
float device_pixel_ratio_ = 1.f;
|
||||
#endif
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(LayerTree);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -12,7 +12,7 @@ OpacityLayer::~OpacityLayer() = default;
|
||||
|
||||
void OpacityLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "OpacityLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
SkPaint paint;
|
||||
paint.setAlpha(alpha_);
|
||||
|
||||
@@ -24,7 +24,7 @@ class OpacityLayer : public ContainerLayer {
|
||||
private:
|
||||
int alpha_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
|
||||
|
||||
#include "flutter/flow/layers/layer.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace flow {
|
||||
|
||||
@@ -26,7 +26,7 @@ class PerformanceOverlayLayer : public Layer {
|
||||
private:
|
||||
int options_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -39,7 +39,7 @@ void PhysicalModelLayer::Preroll(PrerollContext* context,
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
void PhysicalModelLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
SceneUpdateContext::Frame frame(context, rrect_, color_, elevation_);
|
||||
for (auto& layer : layers()) {
|
||||
@@ -55,7 +55,7 @@ void PhysicalModelLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
|
||||
void PhysicalModelLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "PhysicalModelLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
SkPath path;
|
||||
path.addRRect(rrect_);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "flutter/flow/layers/picture_layer.h"
|
||||
|
||||
#include "flutter/common/threads.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace flow {
|
||||
|
||||
@@ -33,8 +33,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
|
||||
void PictureLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "PictureLayer::Paint");
|
||||
FTL_DCHECK(picture_);
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(picture_);
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
SkAutoCanvasRestore save(&context.canvas, true);
|
||||
context.canvas.translate(offset_.x(), offset_.y());
|
||||
|
||||
@@ -33,7 +33,7 @@ class PictureLayer : public Layer {
|
||||
bool will_change_ = false;
|
||||
RasterCacheResult raster_cache_result_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(PictureLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(PictureLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -12,7 +12,7 @@ ShaderMaskLayer::~ShaderMaskLayer() = default;
|
||||
|
||||
void ShaderMaskLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
Layer::AutoSaveLayer(context, paint_bounds(), nullptr);
|
||||
PaintChildren(context);
|
||||
|
||||
@@ -29,7 +29,7 @@ class ShaderMaskLayer : public ContainerLayer {
|
||||
SkRect mask_rect_;
|
||||
SkBlendMode blend_mode_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -24,7 +24,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
|
||||
#if defined(OS_FUCHSIA)
|
||||
|
||||
void TransformLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
FTL_DCHECK(needs_system_composite());
|
||||
FXL_DCHECK(needs_system_composite());
|
||||
|
||||
SceneUpdateContext::Transform transform(context, transform_);
|
||||
UpdateSceneChildren(context);
|
||||
@@ -34,7 +34,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) {
|
||||
|
||||
void TransformLayer::Paint(PaintContext& context) {
|
||||
TRACE_EVENT0("flutter", "TransformLayer::Paint");
|
||||
FTL_DCHECK(needs_painting());
|
||||
FXL_DCHECK(needs_painting());
|
||||
|
||||
SkAutoCanvasRestore save(&context.canvas, true);
|
||||
context.canvas.concat(transform_);
|
||||
|
||||
@@ -26,7 +26,7 @@ class TransformLayer : public ContainerLayer {
|
||||
private:
|
||||
SkMatrix transform_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(TransformLayer);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(TransformLayer);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_
|
||||
#define FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkMatrix.h"
|
||||
#include "third_party/skia/include/core/SkMatrix44.h"
|
||||
#include "third_party/skia/include/core/SkPoint3.h"
|
||||
@@ -43,7 +43,7 @@ class MatrixDecomposition {
|
||||
SkVector4 perspective_;
|
||||
SkVector4 rotation_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_FLOW_PROCESS_INFO_H_
|
||||
#define FLUTTER_FLOW_PROCESS_INFO_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace flow {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "flutter/common/threads.h"
|
||||
#include "flutter/flow/paint_utils.h"
|
||||
#include "flutter/glue/trace_event.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
#include "flutter/flow/instrumentation.h"
|
||||
#include "flutter/flow/raster_cache_key.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/weak_ptr.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/weak_ptr.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkSize.h"
|
||||
|
||||
@@ -73,9 +73,9 @@ class RasterCache {
|
||||
const size_t threshold_;
|
||||
RasterCacheKey::Map<Entry> cache_;
|
||||
bool checkerboard_images_;
|
||||
ftl::WeakPtrFactory<RasterCache> weak_factory_;
|
||||
fxl::WeakPtrFactory<RasterCache> weak_factory_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(RasterCache);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(RasterCache);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include "flutter/flow/matrix_decomposition.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace flow {
|
||||
SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session,
|
||||
SurfaceProducer* surface_producer)
|
||||
: session_(session), surface_producer_(surface_producer) {
|
||||
FTL_DCHECK(surface_producer_ != nullptr);
|
||||
FXL_DCHECK(surface_producer_ != nullptr);
|
||||
}
|
||||
|
||||
SceneUpdateContext::~SceneUpdateContext() {
|
||||
@@ -31,7 +31,7 @@ void SceneUpdateContext::AddChildScene(ExportNode* export_node,
|
||||
SkPoint offset,
|
||||
bool hit_testable) {
|
||||
ASSERT_IS_GPU_THREAD;
|
||||
FTL_DCHECK(top_entity_);
|
||||
FXL_DCHECK(top_entity_);
|
||||
|
||||
export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded(
|
||||
auto surface = surface_producer_->ProduceSurface(physical_size);
|
||||
|
||||
if (!surface) {
|
||||
FTL_LOG(ERROR) << "Could not acquire a surface from the surface producer "
|
||||
FXL_LOG(ERROR) << "Could not acquire a surface from the surface producer "
|
||||
"of size: "
|
||||
<< physical_size.width() << "x" << physical_size.height();
|
||||
return nullptr;
|
||||
@@ -193,7 +193,7 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) {
|
||||
TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks");
|
||||
std::vector<std::unique_ptr<SurfaceProducerSurface>> surfaces_to_submit;
|
||||
for (auto& task : paint_tasks_) {
|
||||
FTL_DCHECK(task.surface);
|
||||
FXL_DCHECK(task.surface);
|
||||
SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas();
|
||||
Layer::PaintContext context = {*canvas, frame.context().frame_time(),
|
||||
frame.context().engine_time(),
|
||||
@@ -222,7 +222,7 @@ SceneUpdateContext::Entity::Entity(SceneUpdateContext& context)
|
||||
}
|
||||
|
||||
SceneUpdateContext::Entity::~Entity() {
|
||||
FTL_DCHECK(context_.top_entity_ == this);
|
||||
FXL_DCHECK(context_.top_entity_ == this);
|
||||
context_.top_entity_ = previous_entity_;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ SceneUpdateContext::Frame::~Frame() {
|
||||
}
|
||||
|
||||
void SceneUpdateContext::Frame::AddPaintedLayer(Layer* layer) {
|
||||
FTL_DCHECK(layer->needs_painting());
|
||||
FXL_DCHECK(layer->needs_painting());
|
||||
paint_layers_.push_back(layer);
|
||||
paint_bounds_.join(layer->paint_bounds());
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
#include "lib/ui/scenic/client/resources.h"
|
||||
#include "flutter/flow/compositor_context.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "third_party/skia/include/core/SkRect.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
|
||||
@@ -140,7 +140,7 @@ class SceneUpdateContext {
|
||||
// CPU wait. Once Vulkan semaphores are available, this method must return
|
||||
// void and the implementation must submit surfaces on its own as soon as the
|
||||
// specific canvas operations are done.
|
||||
FTL_WARN_UNUSED_RESULT
|
||||
FXL_WARN_UNUSED_RESULT
|
||||
std::vector<std::unique_ptr<SurfaceProducerSurface>> ExecutePaintTasks(
|
||||
CompositorContext::ScopedFrame& frame);
|
||||
|
||||
@@ -188,7 +188,7 @@ class SceneUpdateContext {
|
||||
// Save ExportNodes so we can dispose them in our destructor.
|
||||
std::set<ExportNode*> export_nodes_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext);
|
||||
};
|
||||
|
||||
} // namespace flow
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include "flutter/fml/mapping.h"
|
||||
#include "flutter/fml/paths.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "third_party/icu/source/common/unicode/udata.h"
|
||||
|
||||
namespace fml {
|
||||
@@ -51,8 +51,8 @@ class ICUContext {
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME(chinmaygarde): There is no Path::Join in FTL. So a non-portable
|
||||
// version is used here. Patch FTL and update.
|
||||
// FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable
|
||||
// version is used here. Patch FXL and update.
|
||||
auto file = std::make_unique<FileMapping>(directory.second + "/" +
|
||||
kIcuDataFileName);
|
||||
if (file->GetSize() != 0) {
|
||||
@@ -85,12 +85,12 @@ class ICUContext {
|
||||
bool valid_;
|
||||
std::unique_ptr<Mapping> mapping_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ICUContext);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ICUContext);
|
||||
};
|
||||
|
||||
void InitializeICUOnce(const std::string& icu_data_path) {
|
||||
static ICUContext* context = new ICUContext(icu_data_path);
|
||||
FTL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context";
|
||||
FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context";
|
||||
}
|
||||
|
||||
std::once_flag g_icu_init_flag;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
namespace icu {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
|
||||
#if OS_MACOSX
|
||||
|
||||
@@ -40,10 +40,10 @@ std::unique_ptr<Mapping> GetResourceMapping(const std::string& resource_name) {
|
||||
}
|
||||
|
||||
FileMapping::FileMapping(const std::string& path)
|
||||
: FileMapping(ftl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) {
|
||||
: FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) {
|
||||
}
|
||||
|
||||
FileMapping::FileMapping(const ftl::UniqueFD& handle)
|
||||
FileMapping::FileMapping(const fxl::UniqueFD& handle)
|
||||
: size_(0), mapping_(nullptr) {
|
||||
if (!handle.is_valid()) {
|
||||
return;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "lib/ftl/files/unique_fd.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/files/unique_fd.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -23,7 +23,7 @@ class Mapping {
|
||||
virtual const uint8_t* GetMapping() const = 0;
|
||||
|
||||
private:
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Mapping);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Mapping);
|
||||
};
|
||||
|
||||
bool PlatformHasResourcesBundle();
|
||||
@@ -34,7 +34,7 @@ class FileMapping : public Mapping {
|
||||
public:
|
||||
FileMapping(const std::string& path);
|
||||
|
||||
FileMapping(const ftl::UniqueFD& fd);
|
||||
FileMapping(const fxl::UniqueFD& fd);
|
||||
|
||||
~FileMapping() override;
|
||||
|
||||
@@ -46,7 +46,7 @@ class FileMapping : public Mapping {
|
||||
size_t size_;
|
||||
uint8_t* mapping_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(FileMapping);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "flutter/fml/message_loop_impl.h"
|
||||
#include "flutter/fml/task_runner.h"
|
||||
#include "flutter/fml/thread_local.h"
|
||||
#include "lib/ftl/memory/ref_counted.h"
|
||||
#include "lib/ftl/memory/ref_ptr.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "lib/fxl/memory/ref_ptr.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -20,7 +20,7 @@ FML_THREAD_LOCAL ThreadLocal tls_message_loop([](intptr_t value) {
|
||||
|
||||
MessageLoop& MessageLoop::GetCurrent() {
|
||||
auto loop = reinterpret_cast<MessageLoop*>(tls_message_loop.Get());
|
||||
FTL_CHECK(loop != nullptr)
|
||||
FXL_CHECK(loop != nullptr)
|
||||
<< "MessageLoop::EnsureInitializedForCurrentThread was not called on "
|
||||
"this thread prior to message loop use.";
|
||||
return *loop;
|
||||
@@ -40,9 +40,9 @@ bool MessageLoop::IsInitializedForCurrentThread() {
|
||||
|
||||
MessageLoop::MessageLoop()
|
||||
: loop_(MessageLoopImpl::Create()),
|
||||
task_runner_(ftl::MakeRefCounted<fml::TaskRunner>(loop_)) {
|
||||
FTL_CHECK(loop_);
|
||||
FTL_CHECK(task_runner_);
|
||||
task_runner_(fxl::MakeRefCounted<fml::TaskRunner>(loop_)) {
|
||||
FXL_CHECK(loop_);
|
||||
FXL_CHECK(task_runner_);
|
||||
}
|
||||
|
||||
MessageLoop::~MessageLoop() = default;
|
||||
@@ -55,11 +55,11 @@ void MessageLoop::Terminate() {
|
||||
loop_->DoTerminate();
|
||||
}
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> MessageLoop::GetTaskRunner() const {
|
||||
fxl::RefPtr<fxl::TaskRunner> MessageLoop::GetTaskRunner() const {
|
||||
return task_runner_;
|
||||
}
|
||||
|
||||
ftl::RefPtr<MessageLoopImpl> MessageLoop::GetLoopImpl() const {
|
||||
fxl::RefPtr<MessageLoopImpl> MessageLoop::GetLoopImpl() const {
|
||||
return loop_;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#define FLUTTER_FML_MESSAGE_LOOP_H_
|
||||
|
||||
#include "flutter/fml/task_observer.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/tasks/task_runner.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -28,7 +28,7 @@ class MessageLoop {
|
||||
|
||||
void RemoveTaskObserver(TaskObserver* observer);
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> GetTaskRunner() const;
|
||||
fxl::RefPtr<fxl::TaskRunner> GetTaskRunner() const;
|
||||
|
||||
static void EnsureInitializedForCurrentThread();
|
||||
|
||||
@@ -40,14 +40,14 @@ class MessageLoop {
|
||||
friend class TaskRunner;
|
||||
friend class MessageLoopImpl;
|
||||
|
||||
ftl::RefPtr<MessageLoopImpl> loop_;
|
||||
ftl::RefPtr<fml::TaskRunner> task_runner_;
|
||||
fxl::RefPtr<MessageLoopImpl> loop_;
|
||||
fxl::RefPtr<fml::TaskRunner> task_runner_;
|
||||
|
||||
MessageLoop();
|
||||
|
||||
ftl::RefPtr<MessageLoopImpl> GetLoopImpl() const;
|
||||
fxl::RefPtr<MessageLoopImpl> GetLoopImpl() const;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoop);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoop);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "flutter/fml/trace_event.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
|
||||
#if OS_MACOSX
|
||||
|
||||
@@ -38,16 +38,16 @@ using PlatformMessageLoopImpl = fml::MessageLoopWin;
|
||||
|
||||
namespace fml {
|
||||
|
||||
ftl::RefPtr<MessageLoopImpl> MessageLoopImpl::Create() {
|
||||
return ftl::MakeRefCounted<::PlatformMessageLoopImpl>();
|
||||
fxl::RefPtr<MessageLoopImpl> MessageLoopImpl::Create() {
|
||||
return fxl::MakeRefCounted<::PlatformMessageLoopImpl>();
|
||||
}
|
||||
|
||||
MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {}
|
||||
|
||||
MessageLoopImpl::~MessageLoopImpl() = default;
|
||||
|
||||
void MessageLoopImpl::PostTask(ftl::Closure task, ftl::TimePoint target_time) {
|
||||
FTL_DCHECK(task != nullptr);
|
||||
void MessageLoopImpl::PostTask(fxl::Closure task, fxl::TimePoint target_time) {
|
||||
FXL_DCHECK(task != nullptr);
|
||||
RegisterTask(task, target_time);
|
||||
}
|
||||
|
||||
@@ -56,16 +56,16 @@ void MessageLoopImpl::RunExpiredTasksNow() {
|
||||
}
|
||||
|
||||
void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) {
|
||||
FTL_DCHECK(observer != nullptr);
|
||||
FTL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
|
||||
FXL_DCHECK(observer != nullptr);
|
||||
FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
|
||||
<< "Message loop task observer must be added on the same thread as the "
|
||||
"loop.";
|
||||
task_observers_.insert(observer);
|
||||
}
|
||||
|
||||
void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) {
|
||||
FTL_DCHECK(observer != nullptr);
|
||||
FTL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
|
||||
FXL_DCHECK(observer != nullptr);
|
||||
FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this)
|
||||
<< "Message loop task observer must be removed from the same thread as "
|
||||
"the loop.";
|
||||
task_observers_.erase(observer);
|
||||
@@ -94,7 +94,7 @@ void MessageLoopImpl::DoRun() {
|
||||
// should be destructed on the message loop's thread. We have just returned
|
||||
// from the implementations |Run| method which we know is on the correct
|
||||
// thread. Drop all pending tasks on the floor.
|
||||
ftl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
fxl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
delayed_tasks_ = {};
|
||||
}
|
||||
|
||||
@@ -103,31 +103,31 @@ void MessageLoopImpl::DoTerminate() {
|
||||
Terminate();
|
||||
}
|
||||
|
||||
void MessageLoopImpl::RegisterTask(ftl::Closure task,
|
||||
ftl::TimePoint target_time) {
|
||||
FTL_DCHECK(task != nullptr);
|
||||
void MessageLoopImpl::RegisterTask(fxl::Closure task,
|
||||
fxl::TimePoint target_time) {
|
||||
FXL_DCHECK(task != nullptr);
|
||||
if (terminated_) {
|
||||
// If the message loop has already been terminated, PostTask should destruct
|
||||
// |task| synchronously within this function.
|
||||
return;
|
||||
}
|
||||
ftl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
fxl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
delayed_tasks_.push({++order_, std::move(task), target_time});
|
||||
WakeUp(delayed_tasks_.top().target_time);
|
||||
}
|
||||
|
||||
void MessageLoopImpl::RunExpiredTasks() {
|
||||
TRACE_EVENT0("fml", "MessageLoop::RunExpiredTasks");
|
||||
std::vector<ftl::Closure> invocations;
|
||||
std::vector<fxl::Closure> invocations;
|
||||
|
||||
{
|
||||
ftl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
fxl::MutexLocker lock(&delayed_tasks_mutex_);
|
||||
|
||||
if (delayed_tasks_.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto now = ftl::TimePoint::Now();
|
||||
auto now = fxl::TimePoint::Now();
|
||||
while (!delayed_tasks_.empty()) {
|
||||
const auto& top = delayed_tasks_.top();
|
||||
if (top.target_time > now) {
|
||||
@@ -137,7 +137,7 @@ void MessageLoopImpl::RunExpiredTasks() {
|
||||
delayed_tasks_.pop();
|
||||
}
|
||||
|
||||
WakeUp(delayed_tasks_.empty() ? ftl::TimePoint::Max()
|
||||
WakeUp(delayed_tasks_.empty() ? fxl::TimePoint::Max()
|
||||
: delayed_tasks_.top().target_time);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
#include <utility>
|
||||
|
||||
#include "flutter/fml/message_loop.h"
|
||||
#include "lib/ftl/functional/closure.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/ref_counted.h"
|
||||
#include "lib/ftl/synchronization/mutex.h"
|
||||
#include "lib/ftl/synchronization/thread_annotations.h"
|
||||
#include "lib/ftl/time/time_point.h"
|
||||
#include "lib/fxl/functional/closure.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "lib/fxl/synchronization/mutex.h"
|
||||
#include "lib/fxl/synchronization/thread_annotations.h"
|
||||
#include "lib/fxl/time/time_point.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
class MessageLoopImpl : public ftl::RefCountedThreadSafe<MessageLoopImpl> {
|
||||
class MessageLoopImpl : public fxl::RefCountedThreadSafe<MessageLoopImpl> {
|
||||
public:
|
||||
static ftl::RefPtr<MessageLoopImpl> Create();
|
||||
static fxl::RefPtr<MessageLoopImpl> Create();
|
||||
|
||||
virtual ~MessageLoopImpl();
|
||||
|
||||
@@ -31,9 +31,9 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe<MessageLoopImpl> {
|
||||
|
||||
virtual void Terminate() = 0;
|
||||
|
||||
virtual void WakeUp(ftl::TimePoint time_point) = 0;
|
||||
virtual void WakeUp(fxl::TimePoint time_point) = 0;
|
||||
|
||||
void PostTask(ftl::Closure task, ftl::TimePoint target_time);
|
||||
void PostTask(fxl::Closure task, fxl::TimePoint target_time);
|
||||
|
||||
void AddTaskObserver(TaskObserver* observer);
|
||||
|
||||
@@ -51,12 +51,12 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe<MessageLoopImpl> {
|
||||
private:
|
||||
struct DelayedTask {
|
||||
size_t order;
|
||||
ftl::Closure task;
|
||||
ftl::TimePoint target_time;
|
||||
fxl::Closure task;
|
||||
fxl::TimePoint target_time;
|
||||
|
||||
DelayedTask(size_t p_order,
|
||||
ftl::Closure p_task,
|
||||
ftl::TimePoint p_target_time)
|
||||
fxl::Closure p_task,
|
||||
fxl::TimePoint p_target_time)
|
||||
: order(p_order), task(std::move(p_task)), target_time(p_target_time) {}
|
||||
};
|
||||
|
||||
@@ -71,16 +71,16 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe<MessageLoopImpl> {
|
||||
priority_queue<DelayedTask, std::deque<DelayedTask>, DelayedTaskCompare>;
|
||||
|
||||
std::set<TaskObserver*> task_observers_;
|
||||
ftl::Mutex delayed_tasks_mutex_;
|
||||
DelayedTaskQueue delayed_tasks_ FTL_GUARDED_BY(delayed_tasks_mutex_);
|
||||
size_t order_ FTL_GUARDED_BY(delayed_tasks_mutex_);
|
||||
fxl::Mutex delayed_tasks_mutex_;
|
||||
DelayedTaskQueue delayed_tasks_ FXL_GUARDED_BY(delayed_tasks_mutex_);
|
||||
size_t order_ FXL_GUARDED_BY(delayed_tasks_mutex_);
|
||||
std::atomic_bool terminated_;
|
||||
|
||||
void RegisterTask(ftl::Closure task, ftl::TimePoint target_time);
|
||||
void RegisterTask(fxl::Closure task, fxl::TimePoint target_time);
|
||||
|
||||
void RunExpiredTasks();
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "flutter/fml/message_loop.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "lib/ftl/synchronization/waitable_event.h"
|
||||
#include "lib/fxl/synchronization/waitable_event.h"
|
||||
|
||||
#define TIME_SENSITIVE(x) TimeSensitiveTest_##x
|
||||
|
||||
@@ -20,8 +20,8 @@ TEST(MessageLoop, GetCurrent) {
|
||||
|
||||
TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) {
|
||||
fml::MessageLoop* loop1 = nullptr;
|
||||
ftl::AutoResetWaitableEvent latch1;
|
||||
ftl::AutoResetWaitableEvent term1;
|
||||
fxl::AutoResetWaitableEvent latch1;
|
||||
fxl::AutoResetWaitableEvent term1;
|
||||
std::thread thread1([&loop1, &latch1, &term1]() {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
loop1 = &fml::MessageLoop::GetCurrent();
|
||||
@@ -30,8 +30,8 @@ TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) {
|
||||
});
|
||||
|
||||
fml::MessageLoop* loop2 = nullptr;
|
||||
ftl::AutoResetWaitableEvent latch2;
|
||||
ftl::AutoResetWaitableEvent term2;
|
||||
fxl::AutoResetWaitableEvent latch2;
|
||||
fxl::AutoResetWaitableEvent term2;
|
||||
std::thread thread2([&loop2, &latch2, &term2]() {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
loop2 = &fml::MessageLoop::GetCurrent();
|
||||
@@ -102,7 +102,7 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) {
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
size_t current = 0;
|
||||
const auto now_plus_some =
|
||||
ftl::TimePoint::Now() + ftl::TimeDelta::FromMilliseconds(2);
|
||||
fxl::TimePoint::Now() + fxl::TimeDelta::FromMilliseconds(2);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
loop.GetTaskRunner()->PostTaskForTime(
|
||||
[&terminated, i, ¤t]() {
|
||||
@@ -125,8 +125,8 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) {
|
||||
}
|
||||
|
||||
TEST(MessageLoop, CheckRunsTaskOnCurrentThread) {
|
||||
ftl::RefPtr<ftl::TaskRunner> runner;
|
||||
ftl::AutoResetWaitableEvent latch;
|
||||
fxl::RefPtr<fxl::TaskRunner> runner;
|
||||
fxl::AutoResetWaitableEvent latch;
|
||||
std::thread thread([&runner, &latch]() {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
@@ -145,17 +145,17 @@ TEST(MessageLoop, TIME_SENSITIVE(SingleDelayedTaskByDelta)) {
|
||||
std::thread thread([&checked]() {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
auto begin = ftl::TimePoint::Now();
|
||||
auto begin = fxl::TimePoint::Now();
|
||||
loop.GetTaskRunner()->PostDelayedTask(
|
||||
[begin, &checked]() {
|
||||
auto delta = ftl::TimePoint::Now() - begin;
|
||||
auto delta = fxl::TimePoint::Now() - begin;
|
||||
auto ms = delta.ToMillisecondsF();
|
||||
ASSERT_GE(ms, 3);
|
||||
ASSERT_LE(ms, 7);
|
||||
checked = true;
|
||||
fml::MessageLoop::GetCurrent().Terminate();
|
||||
},
|
||||
ftl::TimeDelta::FromMilliseconds(5));
|
||||
fxl::TimeDelta::FromMilliseconds(5));
|
||||
loop.Run();
|
||||
});
|
||||
thread.join();
|
||||
@@ -167,17 +167,17 @@ TEST(MessageLoop, TIME_SENSITIVE(SingleDelayedTaskForTime)) {
|
||||
std::thread thread([&checked]() {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
auto begin = ftl::TimePoint::Now();
|
||||
auto begin = fxl::TimePoint::Now();
|
||||
loop.GetTaskRunner()->PostTaskForTime(
|
||||
[begin, &checked]() {
|
||||
auto delta = ftl::TimePoint::Now() - begin;
|
||||
auto delta = fxl::TimePoint::Now() - begin;
|
||||
auto ms = delta.ToMillisecondsF();
|
||||
ASSERT_GE(ms, 3);
|
||||
ASSERT_LE(ms, 7);
|
||||
checked = true;
|
||||
fml::MessageLoop::GetCurrent().Terminate();
|
||||
},
|
||||
ftl::TimePoint::Now() + ftl::TimeDelta::FromMilliseconds(5));
|
||||
fxl::TimePoint::Now() + fxl::TimeDelta::FromMilliseconds(5));
|
||||
loop.Run();
|
||||
});
|
||||
thread.join();
|
||||
@@ -191,10 +191,10 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithIncreasingDeltas)) {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
for (int target_ms = 0 + 2; target_ms < count + 2; target_ms++) {
|
||||
auto begin = ftl::TimePoint::Now();
|
||||
auto begin = fxl::TimePoint::Now();
|
||||
loop.GetTaskRunner()->PostDelayedTask(
|
||||
[begin, target_ms, &checked]() {
|
||||
auto delta = ftl::TimePoint::Now() - begin;
|
||||
auto delta = fxl::TimePoint::Now() - begin;
|
||||
auto ms = delta.ToMillisecondsF();
|
||||
ASSERT_GE(ms, target_ms - 2);
|
||||
ASSERT_LE(ms, target_ms + 2);
|
||||
@@ -203,7 +203,7 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithIncreasingDeltas)) {
|
||||
fml::MessageLoop::GetCurrent().Terminate();
|
||||
}
|
||||
},
|
||||
ftl::TimeDelta::FromMilliseconds(target_ms));
|
||||
fxl::TimeDelta::FromMilliseconds(target_ms));
|
||||
}
|
||||
loop.Run();
|
||||
});
|
||||
@@ -218,10 +218,10 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) {
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
auto& loop = fml::MessageLoop::GetCurrent();
|
||||
for (int target_ms = count + 2; target_ms > 0 + 2; target_ms--) {
|
||||
auto begin = ftl::TimePoint::Now();
|
||||
auto begin = fxl::TimePoint::Now();
|
||||
loop.GetTaskRunner()->PostDelayedTask(
|
||||
[begin, target_ms, &checked]() {
|
||||
auto delta = ftl::TimePoint::Now() - begin;
|
||||
auto delta = fxl::TimePoint::Now() - begin;
|
||||
auto ms = delta.ToMillisecondsF();
|
||||
ASSERT_GE(ms, target_ms - 2);
|
||||
ASSERT_LE(ms, target_ms + 2);
|
||||
@@ -230,7 +230,7 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) {
|
||||
fml::MessageLoop::GetCurrent().Terminate();
|
||||
}
|
||||
},
|
||||
ftl::TimeDelta::FromMilliseconds(target_ms));
|
||||
fxl::TimeDelta::FromMilliseconds(target_ms));
|
||||
}
|
||||
loop.Run();
|
||||
});
|
||||
|
||||
@@ -7,26 +7,26 @@
|
||||
#include <codecvt>
|
||||
#include <string>
|
||||
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace fml {
|
||||
namespace jni {
|
||||
|
||||
static JavaVM* g_jvm = nullptr;
|
||||
|
||||
#define ASSERT_NO_EXCEPTION() FTL_CHECK(env->ExceptionCheck() == JNI_FALSE);
|
||||
#define ASSERT_NO_EXCEPTION() FXL_CHECK(env->ExceptionCheck() == JNI_FALSE);
|
||||
|
||||
void InitJavaVM(JavaVM* vm) {
|
||||
FTL_DCHECK(g_jvm == nullptr);
|
||||
FXL_DCHECK(g_jvm == nullptr);
|
||||
g_jvm = vm;
|
||||
}
|
||||
|
||||
JNIEnv* AttachCurrentThread() {
|
||||
FTL_DCHECK(g_jvm != nullptr)
|
||||
FXL_DCHECK(g_jvm != nullptr)
|
||||
<< "Trying to attach to current thread without calling InitJavaVM first.";
|
||||
JNIEnv* env = nullptr;
|
||||
jint ret = g_jvm->AttachCurrentThread(&env, nullptr);
|
||||
FTL_DCHECK(JNI_OK == ret);
|
||||
FXL_DCHECK(JNI_OK == ret);
|
||||
return env;
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ std::vector<std::string> StringArrayToVector(JNIEnv* env, jobjectArray array) {
|
||||
ScopedJavaLocalRef<jobjectArray> VectorToStringArray(
|
||||
JNIEnv* env,
|
||||
const std::vector<std::string>& vector) {
|
||||
FTL_DCHECK(env);
|
||||
FXL_DCHECK(env);
|
||||
ScopedJavaLocalRef<jclass> string_clazz(env,
|
||||
env->FindClass("java/lang/String"));
|
||||
FTL_DCHECK(!string_clazz.is_null());
|
||||
FXL_DCHECK(!string_clazz.is_null());
|
||||
jobjectArray joa =
|
||||
env->NewObjectArray(vector.size(), string_clazz.obj(), NULL);
|
||||
ASSERT_NO_EXCEPTION();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "flutter/fml/platform/android/scoped_java_ref.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
namespace jni {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "flutter/fml/platform/android/jni_weak_ref.h"
|
||||
|
||||
#include "flutter/fml/platform/android/jni_util.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace fml {
|
||||
namespace jni {
|
||||
@@ -20,7 +20,7 @@ JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(
|
||||
|
||||
JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj)
|
||||
: obj_(env->NewWeakGlobalRef(obj)) {
|
||||
FTL_DCHECK(obj_);
|
||||
FXL_DCHECK(obj_);
|
||||
}
|
||||
|
||||
JavaObjectWeakGlobalRef::~JavaObjectWeakGlobalRef() {
|
||||
@@ -47,7 +47,7 @@ ScopedJavaLocalRef<jobject> GetRealObject(JNIEnv* env, jweak obj) {
|
||||
if (obj) {
|
||||
real = env->NewLocalRef(obj);
|
||||
if (!real)
|
||||
FTL_DLOG(ERROR) << "The real object has been deleted!";
|
||||
FXL_DLOG(ERROR) << "The real object has been deleted!";
|
||||
}
|
||||
return ScopedJavaLocalRef<jobject>(env, real);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "flutter/fml/platform/linux/timerfd.h"
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -33,8 +33,8 @@ MessageLoopAndroid::MessageLoopAndroid()
|
||||
: looper_(AcquireLooperForThread()),
|
||||
timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)),
|
||||
running_(false) {
|
||||
FTL_CHECK(looper_.is_valid());
|
||||
FTL_CHECK(timer_fd_.is_valid());
|
||||
FXL_CHECK(looper_.is_valid());
|
||||
FXL_CHECK(timer_fd_.is_valid());
|
||||
|
||||
static const int kWakeEvents = ALOOPER_EVENT_INPUT;
|
||||
|
||||
@@ -52,16 +52,16 @@ MessageLoopAndroid::MessageLoopAndroid()
|
||||
read_event_fd, // callback
|
||||
this // baton
|
||||
);
|
||||
FTL_CHECK(add_result == 1);
|
||||
FXL_CHECK(add_result == 1);
|
||||
}
|
||||
|
||||
MessageLoopAndroid::~MessageLoopAndroid() {
|
||||
int remove_result = ::ALooper_removeFd(looper_.get(), timer_fd_.get());
|
||||
FTL_CHECK(remove_result == 1);
|
||||
FXL_CHECK(remove_result == 1);
|
||||
}
|
||||
|
||||
void MessageLoopAndroid::Run() {
|
||||
FTL_DCHECK(looper_.get() == ALooper_forThread());
|
||||
FXL_DCHECK(looper_.get() == ALooper_forThread());
|
||||
|
||||
running_ = true;
|
||||
|
||||
@@ -83,9 +83,9 @@ void MessageLoopAndroid::Terminate() {
|
||||
ALooper_wake(looper_.get());
|
||||
}
|
||||
|
||||
void MessageLoopAndroid::WakeUp(ftl::TimePoint time_point) {
|
||||
void MessageLoopAndroid::WakeUp(fxl::TimePoint time_point) {
|
||||
bool result = TimerRearm(timer_fd_.get(), time_point);
|
||||
FTL_DCHECK(result);
|
||||
FXL_DCHECK(result);
|
||||
}
|
||||
|
||||
void MessageLoopAndroid::OnEventFired() {
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include <atomic>
|
||||
|
||||
#include "flutter/fml/message_loop_impl.h"
|
||||
#include "lib/ftl/files/unique_fd.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/unique_object.h"
|
||||
#include "lib/fxl/files/unique_fd.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/unique_object.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -24,8 +24,8 @@ struct UniqueLooperTraits {
|
||||
|
||||
class MessageLoopAndroid : public MessageLoopImpl {
|
||||
private:
|
||||
ftl::UniqueObject<ALooper*, UniqueLooperTraits> looper_;
|
||||
ftl::UniqueFD timer_fd_;
|
||||
fxl::UniqueObject<ALooper*, UniqueLooperTraits> looper_;
|
||||
fxl::UniqueFD timer_fd_;
|
||||
bool running_;
|
||||
|
||||
MessageLoopAndroid();
|
||||
@@ -36,13 +36,13 @@ class MessageLoopAndroid : public MessageLoopImpl {
|
||||
|
||||
void Terminate() override;
|
||||
|
||||
void WakeUp(ftl::TimePoint time_point) override;
|
||||
void WakeUp(fxl::TimePoint time_point) override;
|
||||
|
||||
void OnEventFired();
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(MessageLoopAndroid);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopAndroid);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "flutter/fml/platform/android/scoped_java_ref.h"
|
||||
|
||||
#include "flutter/fml/platform/android/jni_util.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
|
||||
namespace fml {
|
||||
namespace jni {
|
||||
@@ -14,13 +14,13 @@ static const int kDefaultLocalFrameCapacity = 16;
|
||||
|
||||
ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env) : env_(env) {
|
||||
int failed = env_->PushLocalFrame(kDefaultLocalFrameCapacity);
|
||||
FTL_DCHECK(!failed);
|
||||
FXL_DCHECK(!failed);
|
||||
}
|
||||
|
||||
ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity)
|
||||
: env_(env) {
|
||||
int failed = env_->PushLocalFrame(capacity);
|
||||
FTL_DCHECK(!failed);
|
||||
FXL_DCHECK(!failed);
|
||||
}
|
||||
|
||||
ScopedJavaLocalFrame::~ScopedJavaLocalFrame() {
|
||||
@@ -31,7 +31,7 @@ JavaRef<jobject>::JavaRef() : obj_(NULL) {}
|
||||
|
||||
JavaRef<jobject>::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) {
|
||||
if (obj) {
|
||||
FTL_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType);
|
||||
FXL_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ JNIEnv* JavaRef<jobject>::SetNewLocalRef(JNIEnv* env, jobject obj) {
|
||||
if (!env) {
|
||||
env = AttachCurrentThread();
|
||||
} else {
|
||||
FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
}
|
||||
if (obj)
|
||||
obj = env->NewLocalRef(obj);
|
||||
@@ -55,7 +55,7 @@ void JavaRef<jobject>::SetNewGlobalRef(JNIEnv* env, jobject obj) {
|
||||
if (!env) {
|
||||
env = AttachCurrentThread();
|
||||
} else {
|
||||
FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
}
|
||||
if (obj)
|
||||
obj = env->NewGlobalRef(obj);
|
||||
@@ -66,7 +66,7 @@ void JavaRef<jobject>::SetNewGlobalRef(JNIEnv* env, jobject obj) {
|
||||
|
||||
void JavaRef<jobject>::ResetLocalRef(JNIEnv* env) {
|
||||
if (obj_) {
|
||||
FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread.
|
||||
env->DeleteLocalRef(obj_);
|
||||
obj_ = NULL;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <jni.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
namespace jni {
|
||||
@@ -27,7 +27,7 @@ class ScopedJavaLocalFrame {
|
||||
// it's safe to cache the non-threadsafe JNIEnv* inside this object.
|
||||
JNIEnv* env_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame);
|
||||
};
|
||||
|
||||
// Forward declare the generic java reference template class.
|
||||
@@ -65,7 +65,7 @@ class JavaRef<jobject> {
|
||||
private:
|
||||
jobject obj_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(JavaRef);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef);
|
||||
};
|
||||
|
||||
// Generic base class for ScopedJavaLocalRef and ScopedJavaGlobalRef. Useful
|
||||
@@ -83,7 +83,7 @@ class JavaRef : public JavaRef<jobject> {
|
||||
JavaRef(JNIEnv* env, T obj) : JavaRef<jobject>(env, obj) {}
|
||||
|
||||
private:
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(JavaRef);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef);
|
||||
};
|
||||
|
||||
// Holds a local reference to a Java object. The local reference is scoped
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -40,7 +40,7 @@ class CFRef {
|
||||
private:
|
||||
T instance_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(CFRef);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(CFRef);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "flutter/fml/message_loop_impl.h"
|
||||
#include "flutter/fml/platform/darwin/cf_utils.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -29,13 +29,13 @@ class MessageLoopDarwin : public MessageLoopImpl {
|
||||
|
||||
void Terminate() override;
|
||||
|
||||
void WakeUp(ftl::TimePoint time_point) override;
|
||||
void WakeUp(fxl::TimePoint time_point) override;
|
||||
|
||||
static void OnTimerFire(CFRunLoopTimerRef timer, MessageLoopDarwin* loop);
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(MessageLoopDarwin);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopDarwin);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define FLUTTER_FML_PLATFORM_DARWIN_PLATFORM_VERSION_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_
|
||||
|
||||
#include "flutter/fml/mapping.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -23,7 +23,7 @@ class ResourceMappingDarwin : public Mapping {
|
||||
private:
|
||||
FileMapping actual_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <Block.h>
|
||||
|
||||
#include "lib/ftl/compiler_specific.h"
|
||||
#include "lib/fxl/compiler_specific.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -72,7 +72,7 @@ class ScopedBlock {
|
||||
block_ = temp;
|
||||
}
|
||||
|
||||
B release() FTL_WARN_UNUSED_RESULT {
|
||||
B release() FXL_WARN_UNUSED_RESULT {
|
||||
B temp = block_;
|
||||
block_ = nullptr;
|
||||
return temp;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
// singled out because it is most typically included from other header files.
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#include "lib/ftl/compiler_specific.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/compiler_specific.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
@class NSAutoreleasePool;
|
||||
|
||||
@@ -81,7 +81,7 @@ class scoped_nsprotocol {
|
||||
// scoped_nsprotocol<>::release() is like scoped_ptr<>::release. It is NOT a
|
||||
// wrapper for [object_ release]. To force a scoped_nsprotocol<> to call
|
||||
// [object_ release], use scoped_nsprotocol<>::reset().
|
||||
NST release() FTL_WARN_UNUSED_RESULT {
|
||||
NST release() FXL_WARN_UNUSED_RESULT {
|
||||
NST temp = object_;
|
||||
object_ = nil;
|
||||
return temp;
|
||||
@@ -155,7 +155,7 @@ template <>
|
||||
class scoped_nsobject<NSAutoreleasePool> {
|
||||
private:
|
||||
explicit scoped_nsobject(NSAutoreleasePool* object = nil);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "flutter/fml/platform/linux/timerfd.h"
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -18,15 +18,15 @@ MessageLoopLinux::MessageLoopLinux()
|
||||
: epoll_fd_(HANDLE_EINTR(::epoll_create(1 /* unused */))),
|
||||
timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)),
|
||||
running_(false) {
|
||||
FTL_CHECK(epoll_fd_.is_valid());
|
||||
FTL_CHECK(timer_fd_.is_valid());
|
||||
FXL_CHECK(epoll_fd_.is_valid());
|
||||
FXL_CHECK(timer_fd_.is_valid());
|
||||
bool added_source = AddOrRemoveTimerSource(true);
|
||||
FTL_CHECK(added_source);
|
||||
FXL_CHECK(added_source);
|
||||
}
|
||||
|
||||
MessageLoopLinux::~MessageLoopLinux() {
|
||||
bool removed_source = AddOrRemoveTimerSource(false);
|
||||
FTL_CHECK(removed_source);
|
||||
FXL_CHECK(removed_source);
|
||||
}
|
||||
|
||||
bool MessageLoopLinux::AddOrRemoveTimerSource(bool add) {
|
||||
@@ -73,12 +73,12 @@ void MessageLoopLinux::Run() {
|
||||
|
||||
void MessageLoopLinux::Terminate() {
|
||||
running_ = false;
|
||||
WakeUp(ftl::TimePoint::Now());
|
||||
WakeUp(fxl::TimePoint::Now());
|
||||
}
|
||||
|
||||
void MessageLoopLinux::WakeUp(ftl::TimePoint time_point) {
|
||||
void MessageLoopLinux::WakeUp(fxl::TimePoint time_point) {
|
||||
bool result = TimerRearm(timer_fd_.get(), time_point);
|
||||
FTL_DCHECK(result);
|
||||
FXL_DCHECK(result);
|
||||
}
|
||||
|
||||
void MessageLoopLinux::OnEventFired() {
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include <atomic>
|
||||
|
||||
#include "flutter/fml/message_loop_impl.h"
|
||||
#include "lib/ftl/files/unique_fd.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/files/unique_fd.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
class MessageLoopLinux : public MessageLoopImpl {
|
||||
private:
|
||||
ftl::UniqueFD epoll_fd_;
|
||||
ftl::UniqueFD timer_fd_;
|
||||
fxl::UniqueFD epoll_fd_;
|
||||
fxl::UniqueFD timer_fd_;
|
||||
bool running_;
|
||||
|
||||
MessageLoopLinux();
|
||||
@@ -27,7 +27,7 @@ class MessageLoopLinux : public MessageLoopImpl {
|
||||
|
||||
void Terminate() override;
|
||||
|
||||
void WakeUp(ftl::TimePoint time_point) override;
|
||||
void WakeUp(fxl::TimePoint time_point) override;
|
||||
|
||||
void OnEventFired();
|
||||
|
||||
@@ -35,7 +35,7 @@ class MessageLoopLinux : public MessageLoopImpl {
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(MessageLoopLinux);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopLinux);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lib/ftl/files/path.h"
|
||||
#include "lib/fxl/files/path.h"
|
||||
|
||||
namespace fml {
|
||||
namespace paths {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lib/ftl/files/eintr_wrapper.h"
|
||||
#include "lib/fxl/files/eintr_wrapper.h"
|
||||
|
||||
#if FML_TIMERFD_AVAILABLE == 0
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace fml {
|
||||
#define NSEC_PER_SEC 1000000000
|
||||
#endif
|
||||
|
||||
bool TimerRearm(int fd, ftl::TimePoint time_point) {
|
||||
bool TimerRearm(int fd, fxl::TimePoint time_point) {
|
||||
const uint64_t nano_secs = time_point.ToEpochDelta().ToNanoseconds();
|
||||
|
||||
struct itimerspec spec = {};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_FML_PLATFORM_LINUX_TIMER_FD_H_
|
||||
#define FLUTTER_FML_PLATFORM_LINUX_TIMER_FD_H_
|
||||
|
||||
#include "lib/ftl/time/time_point.h"
|
||||
#include "lib/fxl/time/time_point.h"
|
||||
|
||||
// clang-format off
|
||||
#if __has_include(<sys/timerfd.h>)
|
||||
@@ -41,7 +41,7 @@ int timerfd_settime(int ufc,
|
||||
namespace fml {
|
||||
|
||||
/// Rearms the timer to expire at the given time point.
|
||||
bool TimerRearm(int fd, ftl::TimePoint time_point);
|
||||
bool TimerRearm(int fd, fxl::TimePoint time_point);
|
||||
|
||||
/// Drains the timer FD and retuns true if it has expired. This may be false in
|
||||
/// case the timer read is non-blocking and this routine was called before the
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace fml {
|
||||
|
||||
MessageLoopWin::MessageLoopWin()
|
||||
: timer_(CreateWaitableTimer(NULL, FALSE, NULL)) {
|
||||
FTL_CHECK(timer_.is_valid());
|
||||
FXL_CHECK(timer_.is_valid());
|
||||
}
|
||||
|
||||
MessageLoopWin::~MessageLoopWin() = default;
|
||||
@@ -17,23 +17,23 @@ void MessageLoopWin::Run() {
|
||||
running_ = true;
|
||||
|
||||
while (running_) {
|
||||
FTL_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0);
|
||||
FXL_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0);
|
||||
RunExpiredTasksNow();
|
||||
}
|
||||
}
|
||||
|
||||
void MessageLoopWin::Terminate() {
|
||||
running_ = false;
|
||||
WakeUp(ftl::TimePoint::Now());
|
||||
WakeUp(fxl::TimePoint::Now());
|
||||
}
|
||||
|
||||
void MessageLoopWin::WakeUp(ftl::TimePoint time_point) {
|
||||
void MessageLoopWin::WakeUp(fxl::TimePoint time_point) {
|
||||
LARGE_INTEGER due_time = {0};
|
||||
ftl::TimePoint now = ftl::TimePoint::Now();
|
||||
fxl::TimePoint now = fxl::TimePoint::Now();
|
||||
if (time_point > now) {
|
||||
due_time.QuadPart = (time_point - now).ToNanoseconds() / -100;
|
||||
}
|
||||
FTL_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE));
|
||||
FXL_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE));
|
||||
}
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "flutter/fml/message_loop_impl.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/unique_object.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/unique_object.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -24,7 +24,7 @@ class MessageLoopWin : public MessageLoopImpl {
|
||||
};
|
||||
|
||||
bool running_;
|
||||
ftl::UniqueObject<HANDLE, UniqueHandleTraits> timer_;
|
||||
fxl::UniqueObject<HANDLE, UniqueHandleTraits> timer_;
|
||||
|
||||
MessageLoopWin();
|
||||
|
||||
@@ -34,11 +34,11 @@ class MessageLoopWin : public MessageLoopImpl {
|
||||
|
||||
void Terminate() override;
|
||||
|
||||
void WakeUp(ftl::TimePoint time_point) override;
|
||||
void WakeUp(fxl::TimePoint time_point) override;
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(MessageLoopWin);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopWin);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "lib/ftl/files/path.h"
|
||||
#include "lib/fxl/files/path.h"
|
||||
|
||||
namespace fml {
|
||||
namespace paths {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_FML_TASK_OBSERVER_H_
|
||||
#define FLUTTER_FML_TASK_OBSERVER_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
|
||||
@@ -11,24 +11,24 @@
|
||||
|
||||
namespace fml {
|
||||
|
||||
TaskRunner::TaskRunner(ftl::RefPtr<MessageLoopImpl> loop)
|
||||
TaskRunner::TaskRunner(fxl::RefPtr<MessageLoopImpl> loop)
|
||||
: loop_(std::move(loop)) {
|
||||
FTL_CHECK(loop_);
|
||||
FXL_CHECK(loop_);
|
||||
}
|
||||
|
||||
TaskRunner::~TaskRunner() = default;
|
||||
|
||||
void TaskRunner::PostTask(ftl::Closure task) {
|
||||
loop_->PostTask(std::move(task), ftl::TimePoint::Now());
|
||||
void TaskRunner::PostTask(fxl::Closure task) {
|
||||
loop_->PostTask(std::move(task), fxl::TimePoint::Now());
|
||||
}
|
||||
|
||||
void TaskRunner::PostTaskForTime(ftl::Closure task,
|
||||
ftl::TimePoint target_time) {
|
||||
void TaskRunner::PostTaskForTime(fxl::Closure task,
|
||||
fxl::TimePoint target_time) {
|
||||
loop_->PostTask(std::move(task), target_time);
|
||||
}
|
||||
|
||||
void TaskRunner::PostDelayedTask(ftl::Closure task, ftl::TimeDelta delay) {
|
||||
loop_->PostTask(std::move(task), ftl::TimePoint::Now() + delay);
|
||||
void TaskRunner::PostDelayedTask(fxl::Closure task, fxl::TimeDelta delay) {
|
||||
loop_->PostTask(std::move(task), fxl::TimePoint::Now() + delay);
|
||||
}
|
||||
|
||||
bool TaskRunner::RunsTasksOnCurrentThread() {
|
||||
|
||||
@@ -5,34 +5,34 @@
|
||||
#ifndef FLUTTER_FML_TASK_RUNNER_H_
|
||||
#define FLUTTER_FML_TASK_RUNNER_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/memory/ref_counted.h"
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/memory/ref_counted.h"
|
||||
#include "lib/fxl/tasks/task_runner.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
class MessageLoopImpl;
|
||||
|
||||
class TaskRunner : public ftl::TaskRunner {
|
||||
class TaskRunner : public fxl::TaskRunner {
|
||||
public:
|
||||
void PostTask(ftl::Closure task) override;
|
||||
void PostTask(fxl::Closure task) override;
|
||||
|
||||
void PostTaskForTime(ftl::Closure task, ftl::TimePoint target_time) override;
|
||||
void PostTaskForTime(fxl::Closure task, fxl::TimePoint target_time) override;
|
||||
|
||||
void PostDelayedTask(ftl::Closure task, ftl::TimeDelta delay) override;
|
||||
void PostDelayedTask(fxl::Closure task, fxl::TimeDelta delay) override;
|
||||
|
||||
bool RunsTasksOnCurrentThread() override;
|
||||
|
||||
private:
|
||||
ftl::RefPtr<MessageLoopImpl> loop_;
|
||||
fxl::RefPtr<MessageLoopImpl> loop_;
|
||||
|
||||
TaskRunner(ftl::RefPtr<MessageLoopImpl> loop);
|
||||
TaskRunner(fxl::RefPtr<MessageLoopImpl> loop);
|
||||
|
||||
~TaskRunner();
|
||||
|
||||
FRIEND_MAKE_REF_COUNTED(TaskRunner);
|
||||
FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner);
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(TaskRunner);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(TaskRunner);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "flutter/fml/thread.h"
|
||||
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
@@ -16,13 +16,13 @@
|
||||
#include <string>
|
||||
|
||||
#include "flutter/fml/message_loop.h"
|
||||
#include "lib/ftl/synchronization/waitable_event.h"
|
||||
#include "lib/fxl/synchronization/waitable_event.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
Thread::Thread(const std::string& name) : joined_(false) {
|
||||
ftl::AutoResetWaitableEvent latch;
|
||||
ftl::RefPtr<ftl::TaskRunner> runner;
|
||||
fxl::AutoResetWaitableEvent latch;
|
||||
fxl::RefPtr<fxl::TaskRunner> runner;
|
||||
thread_ = std::make_unique<std::thread>([&latch, &runner, name]() -> void {
|
||||
SetCurrentThreadName(name);
|
||||
fml::MessageLoop::EnsureInitializedForCurrentThread();
|
||||
@@ -39,7 +39,7 @@ Thread::~Thread() {
|
||||
Join();
|
||||
}
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> Thread::GetTaskRunner() const {
|
||||
fxl::RefPtr<fxl::TaskRunner> Thread::GetTaskRunner() const {
|
||||
return task_runner_;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
#include "lib/fxl/tasks/task_runner.h"
|
||||
|
||||
namespace fml {
|
||||
|
||||
@@ -20,18 +20,18 @@ class Thread {
|
||||
|
||||
~Thread();
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> GetTaskRunner() const;
|
||||
fxl::RefPtr<fxl::TaskRunner> GetTaskRunner() const;
|
||||
|
||||
void Join();
|
||||
|
||||
private:
|
||||
std::unique_ptr<std::thread> thread_;
|
||||
ftl::RefPtr<ftl::TaskRunner> task_runner_;
|
||||
fxl::RefPtr<fxl::TaskRunner> task_runner_;
|
||||
std::atomic_bool joined_;
|
||||
|
||||
static void SetCurrentThreadName(const std::string& name);
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Thread);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Thread);
|
||||
};
|
||||
|
||||
} // namespace fml
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
#define FML_THREAD_LOCAL_PTHREADS OS_MACOSX || OS_LINUX || OS_ANDROID
|
||||
|
||||
@@ -55,11 +55,11 @@ class ThreadLocal {
|
||||
ThreadLocalDestroyCallback destroy_;
|
||||
intptr_t value_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(Box);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(Box);
|
||||
};
|
||||
|
||||
static inline void ThreadLocalDestroy(void* value) {
|
||||
FTL_CHECK(value != nullptr);
|
||||
FXL_CHECK(value != nullptr);
|
||||
auto box = reinterpret_cast<Box*>(value);
|
||||
box->DestroyValue();
|
||||
delete box;
|
||||
@@ -71,14 +71,14 @@ class ThreadLocal {
|
||||
ThreadLocal(ThreadLocalDestroyCallback destroy) : destroy_(destroy) {
|
||||
auto callback =
|
||||
reinterpret_cast<void (*)(void*)>(&ThreadLocal::ThreadLocalDestroy);
|
||||
FTL_CHECK(pthread_key_create(&_key, callback) == 0);
|
||||
FXL_CHECK(pthread_key_create(&_key, callback) == 0);
|
||||
}
|
||||
|
||||
void Set(intptr_t value) {
|
||||
auto box = reinterpret_cast<Box*>(pthread_getspecific(_key));
|
||||
if (box == nullptr) {
|
||||
box = new Box(destroy_, value);
|
||||
FTL_CHECK(pthread_setspecific(_key, box) == 0);
|
||||
FXL_CHECK(pthread_setspecific(_key, box) == 0);
|
||||
} else {
|
||||
box->SetValue(value);
|
||||
}
|
||||
@@ -99,14 +99,14 @@ class ThreadLocal {
|
||||
delete reinterpret_cast<Box*>(pthread_getspecific(_key));
|
||||
|
||||
// Finally, collect the key
|
||||
FTL_CHECK(pthread_key_delete(_key) == 0);
|
||||
FXL_CHECK(pthread_key_delete(_key) == 0);
|
||||
}
|
||||
|
||||
private:
|
||||
pthread_key_t _key;
|
||||
ThreadLocalDestroyCallback destroy_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal);
|
||||
};
|
||||
|
||||
#else // FML_THREAD_LOCAL_PTHREADS
|
||||
@@ -144,7 +144,7 @@ class ThreadLocal {
|
||||
ThreadLocalDestroyCallback destroy_;
|
||||
intptr_t value_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal);
|
||||
};
|
||||
|
||||
#endif // FML_THREAD_LOCAL_PTHREADS
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
#ifndef TRACE_EVENT_HIDE_MACROS
|
||||
|
||||
@@ -115,7 +115,7 @@ class ScopedInstantEnd {
|
||||
private:
|
||||
const std::string label_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd);
|
||||
FXL_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd);
|
||||
};
|
||||
|
||||
} // namespace tracing
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_LIB_IO_DART_IO_H_
|
||||
#define FLUTTER_LIB_IO_DART_IO_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -14,7 +14,7 @@ class DartIO {
|
||||
static void InitForIsolate();
|
||||
|
||||
private:
|
||||
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartIO);
|
||||
FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartIO);
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -19,11 +19,11 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Scene);
|
||||
|
||||
DART_BIND_ALL(Scene, FOR_EACH_BINDING)
|
||||
|
||||
ftl::RefPtr<Scene> Scene::create(std::unique_ptr<flow::Layer> rootLayer,
|
||||
fxl::RefPtr<Scene> Scene::create(std::unique_ptr<flow::Layer> rootLayer,
|
||||
uint32_t rasterizerTracingThreshold,
|
||||
bool checkerboardRasterCacheImages,
|
||||
bool checkerboardOffscreenLayers) {
|
||||
return ftl::MakeRefCounted<Scene>(std::move(rootLayer),
|
||||
return fxl::MakeRefCounted<Scene>(std::move(rootLayer),
|
||||
rasterizerTracingThreshold,
|
||||
checkerboardRasterCacheImages,
|
||||
checkerboardOffscreenLayers);
|
||||
|
||||
@@ -18,14 +18,14 @@ class DartLibraryNatives;
|
||||
|
||||
namespace blink {
|
||||
|
||||
class Scene : public ftl::RefCountedThreadSafe<Scene>,
|
||||
class Scene : public fxl::RefCountedThreadSafe<Scene>,
|
||||
public tonic::DartWrappable {
|
||||
DEFINE_WRAPPERTYPEINFO();
|
||||
FRIEND_MAKE_REF_COUNTED(Scene);
|
||||
|
||||
public:
|
||||
~Scene() override;
|
||||
static ftl::RefPtr<Scene> create(std::unique_ptr<flow::Layer> rootLayer,
|
||||
static fxl::RefPtr<Scene> create(std::unique_ptr<flow::Layer> rootLayer,
|
||||
uint32_t rasterizerTracingThreshold,
|
||||
bool checkerboardRasterCacheImages,
|
||||
bool checkerboardOffscreenLayers);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "flutter/lib/ui/painting/matrix.h"
|
||||
#include "flutter/lib/ui/painting/shader.h"
|
||||
#include "flutter/lib/ui/window/window.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_args.h"
|
||||
#include "lib/tonic/dart_binding_macros.h"
|
||||
@@ -178,12 +178,12 @@ void SceneBuilder::pushPhysicalModel(const RRect& rrect,
|
||||
|
||||
void SceneBuilder::addLayer(std::unique_ptr<flow::ContainerLayer> layer,
|
||||
const SkRect& cullRect) {
|
||||
FTL_DCHECK(layer);
|
||||
FXL_DCHECK(layer);
|
||||
|
||||
m_cullRects.push(cullRect);
|
||||
|
||||
if (!m_rootLayer) {
|
||||
FTL_DCHECK(!m_currentLayer);
|
||||
FXL_DCHECK(!m_currentLayer);
|
||||
m_rootLayer = std::move(layer);
|
||||
m_currentLayer = m_rootLayer.get();
|
||||
return;
|
||||
@@ -270,11 +270,11 @@ void SceneBuilder::setCheckerboardOffscreenLayers(bool checkerboard) {
|
||||
m_checkerboardOffscreenLayers = checkerboard;
|
||||
}
|
||||
|
||||
ftl::RefPtr<Scene> SceneBuilder::build() {
|
||||
fxl::RefPtr<Scene> SceneBuilder::build() {
|
||||
m_currentLayer = nullptr;
|
||||
int32_t threshold = m_currentRasterizerTracingThreshold;
|
||||
m_currentRasterizerTracingThreshold = 0;
|
||||
ftl::RefPtr<Scene> scene = Scene::create(std::move(m_rootLayer), threshold,
|
||||
fxl::RefPtr<Scene> scene = Scene::create(std::move(m_rootLayer), threshold,
|
||||
m_checkerboardRasterCacheImages,
|
||||
m_checkerboardOffscreenLayers);
|
||||
ClearDartWrapper();
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
class SceneBuilder : public ftl::RefCountedThreadSafe<SceneBuilder>,
|
||||
class SceneBuilder : public fxl::RefCountedThreadSafe<SceneBuilder>,
|
||||
public tonic::DartWrappable {
|
||||
DEFINE_WRAPPERTYPEINFO();
|
||||
FRIEND_MAKE_REF_COUNTED(SceneBuilder);
|
||||
|
||||
public:
|
||||
static ftl::RefPtr<SceneBuilder> create() {
|
||||
return ftl::MakeRefCounted<SceneBuilder>();
|
||||
static fxl::RefPtr<SceneBuilder> create() {
|
||||
return fxl::MakeRefCounted<SceneBuilder>();
|
||||
}
|
||||
|
||||
~SceneBuilder() override;
|
||||
@@ -69,7 +69,7 @@ class SceneBuilder : public ftl::RefCountedThreadSafe<SceneBuilder>,
|
||||
void setCheckerboardRasterCacheImages(bool checkerboard);
|
||||
void setCheckerboardOffscreenLayers(bool checkerboard);
|
||||
|
||||
ftl::RefPtr<Scene> build();
|
||||
fxl::RefPtr<Scene> build();
|
||||
|
||||
static void RegisterNatives(tonic::DartLibraryNatives* natives);
|
||||
|
||||
|
||||
@@ -31,18 +31,18 @@ void SceneHost::RegisterNatives(tonic::DartLibraryNatives* natives) {
|
||||
}
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
ftl::RefPtr<SceneHost> SceneHost::create(
|
||||
ftl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
||||
return ftl::MakeRefCounted<SceneHost>(export_token_handle);
|
||||
fxl::RefPtr<SceneHost> SceneHost::create(
|
||||
fxl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
||||
return fxl::MakeRefCounted<SceneHost>(export_token_handle);
|
||||
}
|
||||
|
||||
SceneHost::SceneHost(ftl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
||||
SceneHost::SceneHost(fxl::RefPtr<zircon::dart::Handle> export_token_handle) {
|
||||
export_node_holder_ =
|
||||
ftl::MakeRefCounted<flow::ExportNodeHolder>(export_token_handle);
|
||||
fxl::MakeRefCounted<flow::ExportNodeHolder>(export_token_handle);
|
||||
}
|
||||
#else
|
||||
ftl::RefPtr<SceneHost> SceneHost::create(Dart_Handle export_token_handle) {
|
||||
return ftl::MakeRefCounted<SceneHost>(export_token_handle);
|
||||
fxl::RefPtr<SceneHost> SceneHost::create(Dart_Handle export_token_handle) {
|
||||
return fxl::MakeRefCounted<SceneHost>(export_token_handle);
|
||||
}
|
||||
|
||||
SceneHost::SceneHost(Dart_Handle export_token_handle) {}
|
||||
|
||||
@@ -19,23 +19,23 @@ class DartLibraryNatives;
|
||||
|
||||
namespace blink {
|
||||
|
||||
class SceneHost : public ftl::RefCountedThreadSafe<SceneHost>,
|
||||
class SceneHost : public fxl::RefCountedThreadSafe<SceneHost>,
|
||||
public tonic::DartWrappable {
|
||||
DEFINE_WRAPPERTYPEINFO();
|
||||
FRIEND_MAKE_REF_COUNTED(SceneHost);
|
||||
|
||||
public:
|
||||
#if defined(OS_FUCHSIA)
|
||||
static ftl::RefPtr<SceneHost> create(
|
||||
ftl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
static fxl::RefPtr<SceneHost> create(
|
||||
fxl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
#else
|
||||
static ftl::RefPtr<SceneHost> create(Dart_Handle export_token_handle);
|
||||
static fxl::RefPtr<SceneHost> create(Dart_Handle export_token_handle);
|
||||
#endif
|
||||
|
||||
~SceneHost() override;
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
const ftl::RefPtr<flow::ExportNodeHolder>& export_node_holder() const {
|
||||
const fxl::RefPtr<flow::ExportNodeHolder>& export_node_holder() const {
|
||||
return export_node_holder_;
|
||||
}
|
||||
#endif
|
||||
@@ -46,11 +46,11 @@ class SceneHost : public ftl::RefCountedThreadSafe<SceneHost>,
|
||||
|
||||
private:
|
||||
#if defined(OS_FUCHSIA)
|
||||
ftl::RefPtr<flow::ExportNodeHolder> export_node_holder_;
|
||||
fxl::RefPtr<flow::ExportNodeHolder> export_node_holder_;
|
||||
#endif
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
explicit SceneHost(ftl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
explicit SceneHost(fxl::RefPtr<zircon::dart::Handle> export_token_handle);
|
||||
#else
|
||||
explicit SceneHost(Dart_Handle export_token_handle);
|
||||
#endif
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "dart/runtime/include/dart_api.h"
|
||||
#include "dart/runtime/include/dart_tools_api.h"
|
||||
#include "flutter/common/settings.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/ftl/logging.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/fxl/logging.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
#include "lib/tonic/dart_microtask_queue.h"
|
||||
@@ -100,7 +100,7 @@ static void InitDartAsync(Dart_Handle builtin_library,
|
||||
schedule_microtask =
|
||||
GetClosure(builtin_library, "_getScheduleMicrotaskClosure");
|
||||
} else {
|
||||
FTL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
|
||||
FXL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate);
|
||||
Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
|
||||
Dart_Handle method_name =
|
||||
Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "dart/runtime/include/dart_api.h"
|
||||
#include "lib/tonic/dart_library_natives.h"
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -22,7 +22,7 @@ class DartRuntimeHooks {
|
||||
static void RegisterNatives(tonic::DartLibraryNatives* natives);
|
||||
|
||||
private:
|
||||
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks);
|
||||
FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks);
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "flutter/lib/ui/text/paragraph.h"
|
||||
#include "flutter/lib/ui/text/paragraph_builder.h"
|
||||
#include "flutter/lib/ui/window/window.h"
|
||||
#include "lib/ftl/build_config.h"
|
||||
#include "lib/fxl/build_config.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/logging/dart_error.h"
|
||||
|
||||
@@ -73,7 +73,7 @@ void DartUI::InitForGlobal() {
|
||||
}
|
||||
|
||||
void DartUI::InitForIsolate() {
|
||||
FTL_DCHECK(g_natives);
|
||||
FXL_DCHECK(g_natives);
|
||||
DART_CHECK_VALID(Dart_SetNativeResolver(Dart_LookupLibrary(ToDart("dart:ui")),
|
||||
GetNativeFunction, GetSymbol));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef FLUTTER_LIB_UI_DART_UI_H_
|
||||
#define FLUTTER_LIB_UI_DART_UI_H_
|
||||
|
||||
#include "lib/ftl/macros.h"
|
||||
#include "lib/fxl/macros.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -15,7 +15,7 @@ class DartUI {
|
||||
static void InitForIsolate();
|
||||
|
||||
private:
|
||||
FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI);
|
||||
FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI);
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -69,15 +69,15 @@ void Canvas::RegisterNatives(tonic::DartLibraryNatives* natives) {
|
||||
FOR_EACH_BINDING(DART_REGISTER_NATIVE)});
|
||||
}
|
||||
|
||||
ftl::RefPtr<Canvas> Canvas::Create(PictureRecorder* recorder,
|
||||
fxl::RefPtr<Canvas> Canvas::Create(PictureRecorder* recorder,
|
||||
double left,
|
||||
double top,
|
||||
double right,
|
||||
double bottom) {
|
||||
if (!recorder)
|
||||
Dart_ThrowException(ToDart("Canvas constructor called with non-genuine PictureRecorder."));
|
||||
FTL_DCHECK(!recorder->isRecording()); // verified by Dart code
|
||||
ftl::RefPtr<Canvas> canvas = ftl::MakeRefCounted<Canvas>(
|
||||
FXL_DCHECK(!recorder->isRecording()); // verified by Dart code
|
||||
fxl::RefPtr<Canvas> canvas = fxl::MakeRefCounted<Canvas>(
|
||||
recorder->BeginRecording(SkRect::MakeLTRB(left, top, right, bottom)));
|
||||
recorder->set_canvas(canvas);
|
||||
return canvas;
|
||||
|
||||
@@ -25,13 +25,13 @@ class DartLibraryNatives;
|
||||
namespace blink {
|
||||
class CanvasImage;
|
||||
|
||||
class Canvas : public ftl::RefCountedThreadSafe<Canvas>,
|
||||
class Canvas : public fxl::RefCountedThreadSafe<Canvas>,
|
||||
public tonic::DartWrappable {
|
||||
DEFINE_WRAPPERTYPEINFO();
|
||||
FRIEND_MAKE_REF_COUNTED(Canvas);
|
||||
|
||||
public:
|
||||
static ftl::RefPtr<Canvas> Create(PictureRecorder* recorder,
|
||||
static fxl::RefPtr<Canvas> Create(PictureRecorder* recorder,
|
||||
double left,
|
||||
double top,
|
||||
double right,
|
||||
|
||||
@@ -31,16 +31,16 @@ void CanvasGradient::RegisterNatives(tonic::DartLibraryNatives* natives) {
|
||||
FOR_EACH_BINDING(DART_REGISTER_NATIVE)});
|
||||
}
|
||||
|
||||
ftl::RefPtr<CanvasGradient> CanvasGradient::Create() {
|
||||
return ftl::MakeRefCounted<CanvasGradient>();
|
||||
fxl::RefPtr<CanvasGradient> CanvasGradient::Create() {
|
||||
return fxl::MakeRefCounted<CanvasGradient>();
|
||||
}
|
||||
|
||||
void CanvasGradient::initLinear(const tonic::Float32List& end_points,
|
||||
const tonic::Int32List& colors,
|
||||
const tonic::Float32List& color_stops,
|
||||
SkShader::TileMode tile_mode) {
|
||||
FTL_DCHECK(end_points.num_elements() == 4);
|
||||
FTL_DCHECK(colors.num_elements() == color_stops.num_elements() ||
|
||||
FXL_DCHECK(end_points.num_elements() == 4);
|
||||
FXL_DCHECK(colors.num_elements() == color_stops.num_elements() ||
|
||||
color_stops.data() == nullptr);
|
||||
|
||||
static_assert(sizeof(SkPoint) == sizeof(float) * 2,
|
||||
@@ -60,7 +60,7 @@ void CanvasGradient::initRadial(double center_x,
|
||||
const tonic::Int32List& colors,
|
||||
const tonic::Float32List& color_stops,
|
||||
SkShader::TileMode tile_mode) {
|
||||
FTL_DCHECK(colors.num_elements() == color_stops.num_elements() ||
|
||||
FXL_DCHECK(colors.num_elements() == color_stops.num_elements() ||
|
||||
color_stops.data() == nullptr);
|
||||
|
||||
static_assert(sizeof(SkColor) == sizeof(int32_t),
|
||||
|
||||
@@ -25,7 +25,7 @@ class CanvasGradient : public Shader {
|
||||
|
||||
public:
|
||||
~CanvasGradient() override;
|
||||
static ftl::RefPtr<CanvasGradient> Create();
|
||||
static fxl::RefPtr<CanvasGradient> Create();
|
||||
|
||||
void initLinear(const tonic::Float32List& end_points,
|
||||
const tonic::Int32List& colors,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user