diff --git a/BUILD.gn b/BUILD.gn index 91709a0e558a9511d4ba747aacd7df3fa2bd13c9..699af81e24c7313b5fc23d77da78a494445228f7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -48,7 +48,6 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_engine", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", - "//garnet/public/lib/fxl:fxl_unittests", ] } } diff --git a/DEPS b/DEPS index a4419555160c8e4725f30e70c62f76987711e2ed..e8e8c5e343e6f051b551017b1bb038b55e6dad8b 100644 --- a/DEPS +++ b/DEPS @@ -122,9 +122,6 @@ deps = { # build. Eventually, we'll manage these dependencies together with Fuchsia # and not have to specific specific hashes. - 'src/garnet': - Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', - 'src/third_party/tonic': Var('fuchsia_git') + '/tonic' + '@' + '57d508b12462db686573edcbc97891d90cf92f90', diff --git a/common/BUILD.gn b/common/BUILD.gn index 47cd7d3d626446d722b558bde8befd1010f35b28..c0212e3528920b68b6230aea54dbd6b130a252a6 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -18,7 +18,6 @@ source_set("common") { deps = [ "$flutter_root/fml", - "//garnet/public/lib/fxl", ] public_configs = [ diff --git a/common/settings.h b/common/settings.h index 547673529ee1e13ab412370c0c825da44e10805f..124529b90c57d696a9833b058951f46aedfc5d9b 100644 --- a/common/settings.h +++ b/common/settings.h @@ -12,13 +12,13 @@ #include #include +#include "flutter/fml/closure.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/functional/closure.h" namespace blink { using TaskObserverAdd = - std::function; + std::function; using TaskObserverRemove = std::function; struct Settings { @@ -70,10 +70,10 @@ struct Settings { TaskObserverRemove task_observer_remove; // The main isolate is current when this callback is made. This is a good spot // to perform native Dart bindings for libraries not built in. - fxl::Closure root_isolate_create_callback; + fml::closure root_isolate_create_callback; // The isolate is not current and may have already been destroyed when this // call is made. - fxl::Closure root_isolate_shutdown_callback; + fml::closure root_isolate_shutdown_callback; bool enable_software_rendering = false; bool skia_deterministic_rendering_on_cpu = false; bool verbose_logging = false; diff --git a/common/task_runners.cc b/common/task_runners.cc index 1a09daec1815c14e48f7d4edf14d8f6469f8ad16..bb62c8e9c04e3976bd06fdd0f5e14b5f16aec151 100644 --- a/common/task_runners.cc +++ b/common/task_runners.cc @@ -9,10 +9,10 @@ namespace blink { TaskRunners::TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io) : label_(std::move(label)), platform_(std::move(platform)), gpu_(std::move(gpu)), @@ -25,19 +25,19 @@ const std::string& TaskRunners::GetLabel() const { return label_; } -fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { +fml::RefPtr TaskRunners::GetPlatformTaskRunner() const { return platform_; } -fxl::RefPtr TaskRunners::GetUITaskRunner() const { +fml::RefPtr TaskRunners::GetUITaskRunner() const { return ui_; } -fxl::RefPtr TaskRunners::GetIOTaskRunner() const { +fml::RefPtr TaskRunners::GetIOTaskRunner() const { return io_; } -fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { +fml::RefPtr TaskRunners::GetGPUTaskRunner() const { return gpu_; } diff --git a/common/task_runners.h b/common/task_runners.h index f41ae147ebad0765176dac007fdd90c328b9250e..642a8a158f12d374717f1bc77ac5da50a150bab8 100644 --- a/common/task_runners.h +++ b/common/task_runners.h @@ -7,40 +7,41 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/task_runner.h" namespace blink { class TaskRunners { public: TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io); ~TaskRunners(); const std::string& GetLabel() const; - fxl::RefPtr GetPlatformTaskRunner() const; + fml::RefPtr GetPlatformTaskRunner() const; - fxl::RefPtr GetUITaskRunner() const; + fml::RefPtr GetUITaskRunner() const; - fxl::RefPtr GetIOTaskRunner() const; + fml::RefPtr GetIOTaskRunner() const; - fxl::RefPtr GetGPUTaskRunner() const; + fml::RefPtr GetGPUTaskRunner() const; bool IsValid() const; private: const std::string label_; - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; + fml::RefPtr platform_; + fml::RefPtr gpu_; + fml::RefPtr ui_; + fml::RefPtr io_; }; + } // namespace blink #endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index a63dfad95ddfc04275a1e3edb11b6f900306969f..77853058e14a57add78e112fe7efdf96b9a6f0b0 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -58,10 +58,6 @@ source_set("flow") { "texture.h", ] - public_deps = [ - "//garnet/public/lib/fxl", - ] - public_configs = [ "$flutter_root:config" ] deps = [ diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 14c2449dbecd066cab008912abcd2c7f4de3956a..5a6700ff3186f5589abaddf23a6e9ac0dd15401f 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" @@ -44,7 +44,7 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); + FML_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; CompositorContext(); @@ -81,7 +81,7 @@ class CompositorContext { void EndFrame(ScopedFrame& frame, bool enable_instrumentation); - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); + FML_DISALLOW_COPY_AND_ASSIGN(CompositorContext); }; } // namespace flow diff --git a/flow/debug_print.h b/flow/debug_print.h index 78a28fe38562ddaa06a90015adfbf537b6fc8caa..d58dcbed28bed35d69088f736a1bf3cc4f64e0a9 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -7,7 +7,7 @@ #include "flutter/flow/matrix_decomposition.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/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" diff --git a/flow/export_node.cc b/flow/export_node.cc index 9b4b62faea5c2e5b75889bf38835e54eb24dfdbd..e837f525f35c41a47277219947d696b07fe20d97 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,16 +4,16 @@ #include "flutter/flow/export_node.h" -#include "lib/fxl/functional/make_copyable.h" +#include "flutter/fml/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle) + fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle) : gpu_task_runner_(std::move(gpu_task_runner)), export_node_(std::make_unique(export_token_handle)) { - FXL_DCHECK(gpu_task_runner_); + FML_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, @@ -25,18 +25,18 @@ void ExportNodeHolder::Bind(SceneUpdateContext& context, ExportNodeHolder::~ExportNodeHolder() { gpu_task_runner_->PostTask( - fxl::MakeCopyable([export_node = std::move(export_node_)]() { + fml::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); } -ExportNode::ExportNode(fxl::RefPtr export_token_handle) +ExportNode::ExportNode(fml::RefPtr export_token_handle) : export_token_(export_token_handle->ReleaseHandle()) {} ExportNode::~ExportNode() { // Ensure that we properly released the node. - FXL_DCHECK(!node_); - FXL_DCHECK(scene_update_context_ == nullptr); + FML_DCHECK(!node_); + FML_DCHECK(scene_update_context_ == nullptr); } void ExportNode::Bind(SceneUpdateContext& context, @@ -57,9 +57,9 @@ void ExportNode::Bind(SceneUpdateContext& context, if (node_) { container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); - node_->SetHitTestBehavior(hit_testable - ? fuchsia::ui::gfx::HitTestBehavior::kDefault - : fuchsia::ui::gfx::HitTestBehavior::kSuppress); + node_->SetHitTestBehavior( + hit_testable ? fuchsia::ui::gfx::HitTestBehavior::kDefault + : fuchsia::ui::gfx::HitTestBehavior::kSuppress); } } @@ -70,7 +70,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). - FXL_DCHECK(scene_update_context_ || !node_); + FML_DCHECK(scene_update_context_ || !node_); if (remove_from_scene_update_context && scene_update_context_) { scene_update_context_->RemoveExportNode(this); diff --git a/flow/export_node.h b/flow/export_node.h index 335d3ba92aba3e5f0de38833c2bb4a4485b3d849..c7a3db98aacc6338a832e18fae414f60f456a3ec 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -11,9 +11,9 @@ #include "dart-pkg/zircon/sdk_ext/handle.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" @@ -23,10 +23,10 @@ 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 fxl::RefCountedThreadSafe { +class ExportNodeHolder : public fml::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle); + ExportNodeHolder(fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -38,12 +38,12 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: - fxl::RefPtr gpu_task_runner_; + fml::RefPtr gpu_task_runner_; std::unique_ptr export_node_; - FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); - FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); + FML_FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); }; // Represents a node which is being exported from the session. @@ -51,7 +51,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { // must be created and destroyed by the rasterizer thread. class ExportNode { public: - ExportNode(fxl::RefPtr export_token_handle); + ExportNode(fml::RefPtr export_token_handle); ~ExportNode(); @@ -75,7 +75,7 @@ class ExportNode { zx::eventpair export_token_; std::unique_ptr node_; - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; } // namespace flow diff --git a/flow/instrumentation.cc b/flow/instrumentation.cc index e3e9fbd5ec26b8176be6063a105789a4279eaf02..a032a0ab327776bb7aba898a56c603cde5364817 100644 --- a/flow/instrumentation.cc +++ b/flow/instrumentation.cc @@ -14,28 +14,28 @@ namespace flow { static const size_t kMaxSamples = 120; static const size_t kMaxFrameMarkers = 8; -Stopwatch::Stopwatch() : start_(fxl::TimePoint::Now()), current_sample_(0) { - const fxl::TimeDelta delta = fxl::TimeDelta::Zero(); +Stopwatch::Stopwatch() : start_(fml::TimePoint::Now()), current_sample_(0) { + const fml::TimeDelta delta = fml::TimeDelta::Zero(); laps_.resize(kMaxSamples, delta); } Stopwatch::~Stopwatch() = default; void Stopwatch::Start() { - start_ = fxl::TimePoint::Now(); + start_ = fml::TimePoint::Now(); current_sample_ = (current_sample_ + 1) % kMaxSamples; } void Stopwatch::Stop() { - laps_[current_sample_] = fxl::TimePoint::Now() - start_; + laps_[current_sample_] = fml::TimePoint::Now() - start_; } -void Stopwatch::SetLapTime(const fxl::TimeDelta& delta) { +void Stopwatch::SetLapTime(const fml::TimeDelta& delta) { current_sample_ = (current_sample_ + 1) % kMaxSamples; laps_[current_sample_] = delta; } -const fxl::TimeDelta& Stopwatch::LastLap() const { +const fml::TimeDelta& Stopwatch::LastLap() const { return laps_[(current_sample_ - 1) % kMaxSamples]; } @@ -51,8 +51,8 @@ static inline double UnitHeight(double frame_time_ms, return unitHeight; } -fxl::TimeDelta Stopwatch::MaxDelta() const { - fxl::TimeDelta max_delta; +fml::TimeDelta Stopwatch::MaxDelta() const { + fml::TimeDelta max_delta; for (size_t i = 0; i < kMaxSamples; i++) { if (laps_[i] > max_delta) max_delta = laps_[i]; @@ -148,8 +148,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { x + width * (static_cast(current_sample_) / kMaxSamples); const auto marker_rect = SkRect::MakeLTRB( - sample_x, y, - sample_x + width * sample_unit_width, bottom); + sample_x, y, sample_x + width * sample_unit_width, bottom); canvas.drawRect(marker_rect, paint); } diff --git a/flow/instrumentation.h b/flow/instrumentation.h index 1692c8aec495557d8a567080fee0fc203f569de9..19f3b0cfd8bc85be3e65bc25e0066e0e43a1efcf 100644 --- a/flow/instrumentation.h +++ b/flow/instrumentation.h @@ -7,9 +7,9 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/fxl/time/time_point.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" +#include "flutter/fml/time/time_point.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -22,11 +22,11 @@ class Stopwatch { ~Stopwatch(); - const fxl::TimeDelta& LastLap() const; + const fml::TimeDelta& LastLap() const; - fxl::TimeDelta CurrentLap() const { return fxl::TimePoint::Now() - start_; } + fml::TimeDelta CurrentLap() const { return fml::TimePoint::Now() - start_; } - fxl::TimeDelta MaxDelta() const; + fml::TimeDelta MaxDelta() const; void Visualize(SkCanvas& canvas, const SkRect& rect) const; @@ -34,14 +34,14 @@ class Stopwatch { void Stop(); - void SetLapTime(const fxl::TimeDelta& delta); + void SetLapTime(const fml::TimeDelta& delta); private: - fxl::TimePoint start_; - std::vector laps_; + fml::TimePoint start_; + std::vector laps_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(Stopwatch); + FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch); }; class Counter { @@ -57,7 +57,7 @@ class Counter { private: size_t count_; - FXL_DISALLOW_COPY_AND_ASSIGN(Counter); + FML_DISALLOW_COPY_AND_ASSIGN(Counter); }; class CounterValues { @@ -80,7 +80,7 @@ class CounterValues { std::vector values_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(CounterValues); + FML_DISALLOW_COPY_AND_ASSIGN(CounterValues); }; } // namespace flow diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc index 5186284fcce35313eb7e0ff0682f86d238346a8e..b8d04803f1935bf0a0edb12afe62c3ebf787e60e 100644 --- a/flow/layers/backdrop_filter_layer.cc +++ b/flow/layers/backdrop_filter_layer.cc @@ -14,7 +14,7 @@ BackdropFilterLayer::~BackdropFilterLayer() = default; void BackdropFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, SkCanvas::SaveLayerRec{&paint_bounds(), nullptr, filter_.get(), 0}); diff --git a/flow/layers/backdrop_filter_layer.h b/flow/layers/backdrop_filter_layer.h index 00b1a22240541b2e052dbd2f9b980f78bc8789d5..a54f844a429e113fae0c63318e7ccd9a44f3c063 100644 --- a/flow/layers/backdrop_filter_layer.h +++ b/flow/layers/backdrop_filter_layer.h @@ -21,7 +21,7 @@ class BackdropFilterLayer : public ContainerLayer { private: sk_sp filter_; - FXL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); }; } // namespace flow diff --git a/flow/layers/child_scene_layer.cc b/flow/layers/child_scene_layer.cc index 8b36ce09c64a3f1aaaf531d58cee0c250507fd01..744aee5e878883ed55b0eaf0e05234ae2d321939 100644 --- a/flow/layers/child_scene_layer.cc +++ b/flow/layers/child_scene_layer.cc @@ -19,7 +19,7 @@ void ChildSceneLayer::Paint(PaintContext& context) const { } void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-191): Set clip. // It's worth asking whether all children should be clipped implicitly diff --git a/flow/layers/child_scene_layer.h b/flow/layers/child_scene_layer.h index d28009095c02127480bce86e1df700d3f2e23e8a..b52ceb28b2d4f7c5968d16052ba26fb2aeaa7b1d 100644 --- a/flow/layers/child_scene_layer.h +++ b/flow/layers/child_scene_layer.h @@ -21,7 +21,7 @@ class ChildSceneLayer : public Layer { void set_size(const SkSize& size) { size_ = size; } void set_export_node_holder( - fxl::RefPtr export_node_holder) { + fml::RefPtr export_node_holder) { export_node_holder_ = std::move(export_node_holder); } @@ -36,10 +36,10 @@ class ChildSceneLayer : public Layer { private: SkPoint offset_; SkSize size_; - fxl::RefPtr export_node_holder_; + fml::RefPtr export_node_holder_; bool hit_testable_ = true; - FXL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); }; } // namespace flow diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 5a234aa5ee103f923c44b226337eef6d0ca9a40f..3c71823c48503b1baf8a5aa1334a66f53be4afdf 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -29,7 +29,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_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. @@ -48,7 +48,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { void ClipPathLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipPath(clip_path_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 818285af8d098acd1cde1627e38c2f7149b469e8..33b043029ba10c0ec674f5557f7a5dffc3645c42 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -28,7 +28,7 @@ class ClipPathLayer : public ContainerLayer { SkPath clip_path_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; } // namespace flow diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 6f345678f87a39e1712c0a246c53216bc352184b..bc9ce7d099badcd7e2b14641839842086a83338d 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -23,7 +23,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); scenic::Rectangle shape(context.session(), // session clip_rect_.width(), // width @@ -39,7 +39,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, clip_behavior_ != Clip::hardEdge); context.canvas.clipRect(paint_bounds()); diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index 0744076ec478b5fedb348bfa047725f76ed39ad3..576e6a5d029a75f66e82d848358e6c0aad3fae47 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -27,7 +27,7 @@ class ClipRectLayer : public ContainerLayer { SkRect clip_rect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; } // namespace flow diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index d21ce637f7f75e854447375cb3c378ae59c12cb7..046a0d45404ef3108acddc9705c27e494fd6df88 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -23,7 +23,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. scenic::RoundedRectangle shape( @@ -46,7 +46,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRRect(clip_rrect_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 7888a15ef838f94237a281ec2cb40cba8fa312cb..7e8f0934a337ff6f08298ba8f61de0cb673d9ba2 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -28,7 +28,7 @@ class ClipRRectLayer : public ContainerLayer { SkRRect clip_rrect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; } // namespace flow diff --git a/flow/layers/color_filter_layer.cc b/flow/layers/color_filter_layer.cc index 6b1330eb405935573baac4da7dc83905733bb333..a3c678aa1539e3c34b62b3f83c3ff7d5d04130bb 100644 --- a/flow/layers/color_filter_layer.cc +++ b/flow/layers/color_filter_layer.cc @@ -12,7 +12,7 @@ ColorFilterLayer::~ColorFilterLayer() = default; void ColorFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); sk_sp color_filter = SkColorFilter::MakeModeFilter(color_, blend_mode_); diff --git a/flow/layers/color_filter_layer.h b/flow/layers/color_filter_layer.h index dcd7543b55d5391eae8e8d45a46954ae6fbc2328..e129bad66f000b6e1a8e713c97a5c3b7e83be85e 100644 --- a/flow/layers/color_filter_layer.h +++ b/flow/layers/color_filter_layer.h @@ -24,7 +24,7 @@ class ColorFilterLayer : public ContainerLayer { SkColor color_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); }; } // namespace flow diff --git a/flow/layers/container_layer.cc b/flow/layers/container_layer.cc index b437d4369bf1148f46510a5020ae5a870b7d436f..f398c96ad1afe5504592f2f95569750ceb05b625 100644 --- a/flow/layers/container_layer.cc +++ b/flow/layers/container_layer.cc @@ -38,7 +38,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context, } void ContainerLayer::PaintChildren(PaintContext& context) const { - FXL_DCHECK(needs_painting()); + FML_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) { - FXL_DCHECK(needs_system_composite()); + FML_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 diff --git a/flow/layers/container_layer.h b/flow/layers/container_layer.h index 9b30d28c9f44a22960affe48d1029419619423e5..0da0a7185963ed9df3dbae97ad08c88be23817e3 100644 --- a/flow/layers/container_layer.h +++ b/flow/layers/container_layer.h @@ -38,7 +38,7 @@ class ContainerLayer : public Layer { private: std::vector> layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); }; } // namespace flow diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index 031bf24d9b26236c7da84278ff91a13ced5f3f59..33fac9704bb662b9a1358646535d829e448d8a17 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -72,7 +72,7 @@ void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, } void DefaultLayerBuilder::PushClipPath(const SkPath& path, Clip clip_behavior) { - FXL_DCHECK(clip_behavior != Clip::none); + FML_DCHECK(clip_behavior != Clip::none); SkRect cullRect; if (!cullRect.intersect(path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); @@ -178,7 +178,7 @@ void DefaultLayerBuilder::PushTexture(const SkPoint& offset, void DefaultLayerBuilder::PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) { if (!current_layer_) { return; @@ -211,7 +211,7 @@ std::unique_ptr DefaultLayerBuilder::TakeLayer() { void DefaultLayerBuilder::PushLayer(std::unique_ptr layer, const SkRect& cullRect) { - FXL_DCHECK(layer); + FML_DCHECK(layer); cull_rects_.push(cullRect); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index d5a2643a5a3895b88b88d850172ab1d4ffa32eb5..0dd87a3dd75a8ac8c67bab2fb95cd695ef5d5e88 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/container_layer.h" #include "flutter/flow/layers/layer_builder.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -76,7 +76,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushChildScene(const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) override; #endif // defined(OS_FUCHSIA) @@ -95,7 +95,7 @@ class DefaultLayerBuilder final : public LayerBuilder { void PushLayer(std::unique_ptr layer, const SkRect& cullRect); - FXL_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d1a4f0ba13905bf9555fac2ffba6527289529758..173c2890b6ae88a16fa804253f4b044900a6c668 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,10 +11,10 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "flutter/fml/trace_event.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" @@ -112,7 +112,7 @@ class Layer { bool needs_system_composite_; SkRect paint_bounds_; - FXL_DISALLOW_COPY_AND_ASSIGN(Layer); + FML_DISALLOW_COPY_AND_ASSIGN(Layer); }; } // namespace flow diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 3cb6ea1fb40ced33611216349087c3d849f6c8ee..c1b34bf306434eda7d27f6f41bf63485699017ad 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/flow/skia_gpu_object.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkImageFilter.h" @@ -74,7 +74,7 @@ class LayerBuilder { virtual void PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) = 0; #endif // defined(OS_FUCHSIA) @@ -99,7 +99,7 @@ class LayerBuilder { bool checkerboard_raster_cache_images_ = false; bool checkerboard_offscreen_layers_ = false; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 522fe6a34f393193957259a0002af56b44cc6c7d..bae883ca207be807cc51b6ad5ba71b2eda02008d 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -11,8 +11,8 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSize.h" @@ -46,11 +46,11 @@ class LayerTree { void set_frame_size(const SkISize& frame_size) { frame_size_ = frame_size; } - void set_construction_time(const fxl::TimeDelta& delta) { + void set_construction_time(const fml::TimeDelta& delta) { construction_time_ = delta; } - const fxl::TimeDelta& construction_time() const { return construction_time_; } + const fml::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 @@ -74,12 +74,12 @@ class LayerTree { private: SkISize frame_size_; // Physical pixels. std::unique_ptr root_layer_; - fxl::TimeDelta construction_time_; + fml::TimeDelta construction_time_; uint32_t rasterizer_tracing_threshold_; bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); + FML_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; } // namespace flow diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index e6916f07620364b162bff28434ae970144fa6e60..84b8bd64c0224d91ea2961a5b6b949b2ab111b89 100644 --- a/flow/layers/opacity_layer.cc +++ b/flow/layers/opacity_layer.cc @@ -12,7 +12,7 @@ OpacityLayer::~OpacityLayer() = default; void OpacityLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkPaint paint; paint.setAlpha(alpha_); diff --git a/flow/layers/opacity_layer.h b/flow/layers/opacity_layer.h index 2ec0a1acf9a0750ad0effc04a4920dcdac69ffb8..b27829385046bda24df8b840f646c62ecbf5bbfa 100644 --- a/flow/layers/opacity_layer.h +++ b/flow/layers/opacity_layer.h @@ -24,7 +24,7 @@ class OpacityLayer : public ContainerLayer { private: int alpha_; - FXL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); + FML_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); }; } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 77448107147a49ab71461ed7f5984b4a555580e7..3296a308bddbd8046cf8f8fc3042f3024d9cc60c 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_ #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -24,7 +24,7 @@ class PerformanceOverlayLayer : public Layer { private: int options_; - FXL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); }; } // namespace flow diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index 8f9e59d6f1ac2f87e10747c8b0122f406e7eec0a..53a7d29f30df414a2d3424d33ec95cd08a7fc9bb 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -64,7 +64,7 @@ void PhysicalShapeLayer::Preroll(PrerollContext* context, #if defined(OS_FUCHSIA) void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); SceneUpdateContext::Frame frame(context, frameRRect_, color_, elevation_); for (auto& layer : layers()) { @@ -80,7 +80,7 @@ void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { void PhysicalShapeLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); if (elevation_ != 0) { DrawShadow(&context.canvas, path_, shadow_color_, elevation_, diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index bef944e7f34a97bd6d1da5638ce343454ad5e4da..3cbf15a609ad1c78bfd5edd01f2e960faf478a01 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,7 +4,7 @@ #include "flutter/flow/layers/picture_layer.h" -#include "lib/fxl/logging.h" +#include "flutter/fml/logging.h" namespace flow { @@ -34,8 +34,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_.get()); - FXL_DCHECK(needs_painting()); + FML_DCHECK(picture_.get()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.translate(offset_.x(), offset_.y()); diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index c67929b7cb45502ae912460b177bff66d6d967d2..12e2807c33d23ae57f4d59e834b07e0d102e26a4 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -41,7 +41,7 @@ class PictureLayer : public Layer { bool will_change_ = false; RasterCacheResult raster_cache_result_; - FXL_DISALLOW_COPY_AND_ASSIGN(PictureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PictureLayer); }; } // namespace flow diff --git a/flow/layers/shader_mask_layer.cc b/flow/layers/shader_mask_layer.cc index 4ed67334b8326904525d94bc29202a34f6cbe81d..3ea69322fcd2f2fe66dbeb2f4fc4502db52f1ada 100644 --- a/flow/layers/shader_mask_layer.cc +++ b/flow/layers/shader_mask_layer.cc @@ -12,7 +12,7 @@ ShaderMaskLayer::~ShaderMaskLayer() = default; void ShaderMaskLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, paint_bounds(), nullptr); PaintChildren(context); diff --git a/flow/layers/shader_mask_layer.h b/flow/layers/shader_mask_layer.h index 0b9e728cdda11b5ec4c6739f8aae77f87b8903ee..ed059722fea55313ecf9f9dc756bdc9053ccdd36 100644 --- a/flow/layers/shader_mask_layer.h +++ b/flow/layers/shader_mask_layer.h @@ -29,7 +29,7 @@ class ShaderMaskLayer : public ContainerLayer { SkRect mask_rect_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); }; } // namespace flow diff --git a/flow/layers/texture_layer.h b/flow/layers/texture_layer.h index 75f0fe66abaecd148c7647ba9255eecb3dd3ba92..93581c3472b0e24835732ff5d1864c78b1746bb4 100644 --- a/flow/layers/texture_layer.h +++ b/flow/layers/texture_layer.h @@ -31,7 +31,7 @@ class TextureLayer : public Layer { SkSize size_; int64_t texture_id_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TextureLayer); }; } // namespace flow diff --git a/flow/layers/transform_layer.cc b/flow/layers/transform_layer.cc index be6a6f81c478c556bfd9377918629bd2f4978b9e..a70cc299dd9a431ca9cdb4645063d03954555e92 100644 --- a/flow/layers/transform_layer.cc +++ b/flow/layers/transform_layer.cc @@ -24,7 +24,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void TransformLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_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) const { TRACE_EVENT0("flutter", "TransformLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.concat(transform_); diff --git a/flow/layers/transform_layer.h b/flow/layers/transform_layer.h index 47fd7d5cefc0c5088cf741ae44deb8624e70b858..f8209302aa170d60776ce7132982ca87c9696c5c 100644 --- a/flow/layers/transform_layer.h +++ b/flow/layers/transform_layer.h @@ -27,7 +27,7 @@ class TransformLayer : public ContainerLayer { private: SkMatrix transform_; - FXL_DISALLOW_COPY_AND_ASSIGN(TransformLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TransformLayer); }; } // namespace flow diff --git a/flow/matrix_decomposition.h b/flow/matrix_decomposition.h index 1392ed8aad020445541bae6bbc9ad2d2aaf62fce..d65d12a77e67444c20f57625c9acceff25bf79cc 100644 --- a/flow/matrix_decomposition.h +++ b/flow/matrix_decomposition.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ #define FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/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_; - FXL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); + FML_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); }; } // namespace flow diff --git a/flow/matrix_decomposition_unittests.cc b/flow/matrix_decomposition_unittests.cc index df8009088151291979f4fe81b15295c345210e1e..130f290d583990770c0181947d5ad432c9652f9d 100644 --- a/flow/matrix_decomposition_unittests.cc +++ b/flow/matrix_decomposition_unittests.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #if defined(OS_WIN) #define _USE_MATH_DEFINES diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 33d5a99d2c6d5a57b1f500d1e2dce4e27c26d4e2..a3aef6e3d14107a6941fec2d8ff00e17c205b1d9 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -7,8 +7,8 @@ #include #include "flutter/flow/paint_utils.h" +#include "flutter/fml/logging.h" #include "flutter/fml/trace_event.h" -#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkImage.h" @@ -21,7 +21,7 @@ void RasterCacheResult::draw(SkCanvas& canvas) const { SkAutoCanvasRestore auto_restore(&canvas, true); SkIRect bounds = RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix()); - FXL_DCHECK(bounds.size() == image_->dimensions()); + FML_DCHECK(bounds.size() == image_->dimensions()); canvas.resetMatrix(); canvas.drawImage(image_, bounds.fLeft, bounds.fTop); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index e72e7437098f4100b5eace38bbd0c1153e0cb4f6..348ab8000da399209db0db81a47a0f67fb6bb85d 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -10,8 +10,8 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/weak_ptr.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -79,9 +79,9 @@ class RasterCache { const size_t threshold_; RasterCacheKey::Map cache_; bool checkerboard_images_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; - FXL_DISALLOW_COPY_AND_ASSIGN(RasterCache); + FML_DISALLOW_COPY_AND_ASSIGN(RasterCache); }; } // namespace flow diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index c6f4c759378f011ed2ac0d82b76e07954137f60b..3f20072df8e3bbac588b39d5422d7afc9f027637 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -7,8 +7,8 @@ #include #include "flutter/flow/matrix_decomposition.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" @@ -21,7 +21,7 @@ class RasterCacheKey { matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX()); matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY()); #ifndef SUPPORT_FRACTIONAL_TRANSLATION - FXL_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); + FML_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); #endif } diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index c4cb57e59afea1c34380900967eb8b89544e4b0f..576bde7fa1aff1e0ee25b9b22404b350fe0aa7a9 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -14,7 +14,7 @@ namespace flow { SceneUpdateContext::SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { - FXL_DCHECK(surface_producer_ != nullptr); + FML_DCHECK(surface_producer_ != nullptr); } SceneUpdateContext::~SceneUpdateContext() { @@ -27,7 +27,7 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - FXL_DCHECK(top_entity_); + FML_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } @@ -161,7 +161,7 @@ scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( auto surface = surface_producer_->ProduceSurface(physical_size); if (!surface) { - FXL_LOG(ERROR) << "Could not acquire a surface from the surface producer " + FML_LOG(ERROR) << "Could not acquire a surface from the surface producer " "of size: " << physical_size.width() << "x" << physical_size.height(); return nullptr; @@ -185,7 +185,7 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); std::vector> surfaces_to_submit; for (auto& task : paint_tasks_) { - FXL_DCHECK(task.surface); + FML_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), @@ -214,7 +214,7 @@ SceneUpdateContext::Entity::Entity(SceneUpdateContext& context) } SceneUpdateContext::Entity::~Entity() { - FXL_DCHECK(context_.top_entity_ == this); + FML_DCHECK(context_.top_entity_ == this); context_.top_entity_ = previous_entity_; } @@ -302,7 +302,7 @@ SceneUpdateContext::Frame::~Frame() { } void SceneUpdateContext::Frame::AddPaintedLayer(Layer* layer) { - FXL_DCHECK(layer->needs_painting()); + FML_DCHECK(layer->needs_painting()); paint_layers_.push_back(layer); paint_bounds_.join(layer->paint_bounds()); } diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 23beb0a887dae10cb55359146a96ab9341e82489..ac9659476ce4e8b7e0d97f4ce23b5a1b4d938553 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -10,9 +10,9 @@ #include #include "flutter/flow/compositor_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -142,7 +142,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. - FXL_WARN_UNUSED_RESULT + FML_WARN_UNUSED_RESULT std::vector> ExecutePaintTasks( CompositorContext::ScopedFrame& frame); @@ -170,10 +170,10 @@ class SceneUpdateContext { std::vector paint_layers); void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color); scenic::Image* GenerateImageIfNeeded(SkColor color, - SkScalar scale_x, - SkScalar scale_y, - const SkRect& paint_bounds, - std::vector paint_layers); + SkScalar scale_x, + SkScalar scale_y, + const SkRect& paint_bounds, + std::vector paint_layers); Entity* top_entity_ = nullptr; float top_scale_x_ = 1.f; @@ -189,7 +189,7 @@ class SceneUpdateContext { // Save ExportNodes so we can dispose them in our destructor. std::set export_nodes_; - FXL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); + FML_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); }; } // namespace flow diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc index ce2312f921580e96255db5a3e713eb780b808f40..bf9d9a8ec599f1cb18dca72d06486adce8d74f4d 100644 --- a/flow/skia_gpu_object.cc +++ b/flow/skia_gpu_object.cc @@ -8,8 +8,8 @@ namespace flow { -SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay) +SkiaUnrefQueue::SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay) : task_runner_(std::move(task_runner)), drain_delay_(delay), drain_pending_(false) {} @@ -24,7 +24,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) { if (!drain_pending_) { drain_pending_ = true; task_runner_->PostDelayedTask( - [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + [strong = fml::Ref(this)]() { strong->Drain(); }, drain_delay_); } } diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h index 4711f80c6f4fdd51674fedb05d8fb1b06aecf348..7379b7936ec42bf579cfa3f450cf686795ccc0a1 100644 --- a/flow/skia_gpu_object.h +++ b/flow/skia_gpu_object.h @@ -8,16 +8,16 @@ #include #include +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/task_runner.h" -#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" namespace flow { // A queue that holds Skia objects that must be destructed on the the given task // runner. -class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { +class SkiaUnrefQueue : public fml::RefCountedThreadSafe { public: void Unref(SkRefCnt* object); @@ -29,20 +29,20 @@ class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { void Drain(); private: - const fxl::RefPtr task_runner_; - const fxl::TimeDelta drain_delay_; + const fml::RefPtr task_runner_; + const fml::TimeDelta drain_delay_; std::mutex mutex_; std::deque objects_; bool drain_pending_; - SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay); + SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay); ~SkiaUnrefQueue(); - FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); - FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FML_FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); }; /// An object whose deallocation needs to be performed on an specific unref @@ -55,9 +55,9 @@ class SkiaGPUObject { SkiaGPUObject() = default; - SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + SkiaGPUObject(sk_sp object, fml::RefPtr queue) : object_(std::move(object)), queue_(std::move(queue)) { - FXL_DCHECK(queue_ && object_); + FML_DCHECK(queue_ && object_); } SkiaGPUObject(SkiaGPUObject&&) = default; @@ -73,14 +73,14 @@ class SkiaGPUObject { queue_->Unref(object_.release()); } queue_ = nullptr; - FXL_DCHECK(object_ == nullptr); + FML_DCHECK(object_ == nullptr); } private: sk_sp object_; - fxl::RefPtr queue_; + fml::RefPtr queue_; - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); }; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index 0e8b3eaeb2cb2dd1bc12ffbd19205fc7a757e533..92e0130da35ff33bcea9e7f10488bcbb4f75b1b9 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -7,8 +7,8 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -38,7 +38,7 @@ class Texture { private: int64_t id_; - FXL_DISALLOW_COPY_AND_ASSIGN(Texture); + FML_DISALLOW_COPY_AND_ASSIGN(Texture); }; class TextureRegistry { @@ -64,7 +64,7 @@ class TextureRegistry { private: std::map> mapping_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); + FML_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); }; } // namespace flow diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 0551319ea25956dd979b63bc2f82d3249319028e..6d605ddf59f1ab2d902c136301934f8a1995117b 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,8 +4,11 @@ source_set("fml") { sources = [ + "arraysize.h", "build_config.h", "closure.h", + "command_line.cc", + "command_line.h", "compiler_specific.h", "eintr_wrapper.h", "export.h", @@ -18,6 +21,7 @@ source_set("fml") { "log_settings_state.cc", "logging.cc", "logging.h", + "make_copyable.h", "mapping.cc", "mapping.h", "memory/ref_counted.h", @@ -35,6 +39,8 @@ source_set("fml") { "native_library.h", "paths.cc", "paths.h", + "string_view.cc", + "string_view.h", "synchronization/thread_annotations.h", "synchronization/thread_checker.h", "synchronization/waitable_event.cc", @@ -55,7 +61,6 @@ source_set("fml") { ] deps = [ - "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", # These need to be in sync with the Fuchsia buildroot. @@ -141,6 +146,7 @@ source_set("fml") { "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", "platform/posix/native_library_posix.cc", + "platform/posix/paths_posix.cc", ] } } @@ -149,9 +155,11 @@ executable("fml_unittests") { testonly = true sources = [ + "command_line_unittest.cc", "memory/ref_counted_unittest.cc", "memory/weak_ptr_unittest.cc", "message_loop_unittests.cc", + "string_view_unittest.cc", "synchronization/thread_annotations_unittest.cc", "synchronization/thread_checker_unittest.cc", "synchronization/waitable_event_unittest.cc", @@ -165,7 +173,6 @@ executable("fml_unittests") { deps = [ "$flutter_root/fml", "$flutter_root/testing", - "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", ] } diff --git a/fml/arraysize.h b/fml/arraysize.h new file mode 100644 index 0000000000000000000000000000000000000000..8457369884a976e37e4cb6f45d45f186bd69a148 --- /dev/null +++ b/fml/arraysize.h @@ -0,0 +1,16 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_FML_ARRAYSIZE_H_ +#define FLUTTER_FML_ARRAYSIZE_H_ + +#include + +#ifndef arraysize +template +char (&ArraySizeHelper(T (&array)[N]))[N]; +#define arraysize(array) (sizeof(ArraySizeHelper(array))) +#endif + +#endif // FLUTTER_FML_ARRAYSIZE_H_ diff --git a/fml/command_line.cc b/fml/command_line.cc new file mode 100644 index 0000000000000000000000000000000000000000..24012867edc84e4c9c2416bc20acc0e291d82071 --- /dev/null +++ b/fml/command_line.cc @@ -0,0 +1,165 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "flutter/fml/command_line.h" + +namespace fml { + +// CommandLine ----------------------------------------------------------------- + +CommandLine::Option::Option(const std::string& name) : name(name) {} + +CommandLine::Option::Option(const std::string& name, const std::string& value) + : name(name), value(value) {} + +CommandLine::CommandLine() = default; + +CommandLine::CommandLine(const CommandLine& from) = default; + +CommandLine::CommandLine(CommandLine&& from) = default; + +CommandLine::CommandLine(const std::string& argv0, + const std::vector