diff --git a/engine/src/flutter/flow/BUILD.gn b/engine/src/flutter/flow/BUILD.gn index 6f6b7e2a0db..5ca69747d2e 100644 --- a/engine/src/flutter/flow/BUILD.gn +++ b/engine/src/flutter/flow/BUILD.gn @@ -72,8 +72,8 @@ source_set("flow") { ] deps += [ - "//apps/mozart/lib/scene:client", - "//apps/mozart/services/scene", + "//apps/mozart/lib/scenic:client", + "//apps/mozart/services/scenic", "//garnet/public/lib/fidl/dart/sdk_ext", ] diff --git a/engine/src/flutter/flow/export_node.cc b/engine/src/flutter/flow/export_node.cc index 055de7e595d..69922882f96 100644 --- a/engine/src/flutter/flow/export_node.cc +++ b/engine/src/flutter/flow/export_node.cc @@ -16,7 +16,7 @@ ExportNodeHolder::ExportNodeHolder( } void ExportNodeHolder::Bind(SceneUpdateContext& context, - mozart::client::ContainerNode& container, + scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { ASSERT_IS_GPU_THREAD; @@ -41,14 +41,14 @@ ExportNode::~ExportNode() { } void ExportNode::Bind(SceneUpdateContext& context, - mozart::client::ContainerNode& container, + scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { ASSERT_IS_GPU_THREAD; if (export_token_) { // Happens first time we bind. - node_.reset(new mozart::client::EntityNode(container.session())); + node_.reset(new scenic_lib::EntityNode(container.session())); node_->Export(std::move(export_token_)); // Add ourselves to the context so it can call Dispose() on us if the Mozart @@ -61,8 +61,8 @@ void ExportNode::Bind(SceneUpdateContext& context, container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); node_->SetHitTestBehavior(hit_testable - ? mozart2::HitTestBehavior::kDefault - : mozart2::HitTestBehavior::kSuppress); + ? scenic::HitTestBehavior::kDefault + : scenic::HitTestBehavior::kSuppress); } } diff --git a/engine/src/flutter/flow/export_node.h b/engine/src/flutter/flow/export_node.h index 0056732e424..cd635132a28 100644 --- a/engine/src/flutter/flow/export_node.h +++ b/engine/src/flutter/flow/export_node.h @@ -9,7 +9,7 @@ #include -#include "apps/mozart/lib/scene/client/resources.h" +#include "apps/mozart/lib/scenic/client/resources.h" #include "flutter/flow/scene_update_context.h" #include "lib/fidl/dart/sdk_ext/src/handle.h" #include "lib/ftl/build_config.h" @@ -31,7 +31,7 @@ class ExportNodeHolder : public ftl::RefCountedThreadSafe { // Calls Bind() on the wrapped ExportNode. void Bind(SceneUpdateContext& context, - mozart::client::ContainerNode& container, + scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -57,7 +57,7 @@ class ExportNode { // Binds the export token to the entity node and adds it as a child of // the specified container. Must be called on the Rasterizer thread. void Bind(SceneUpdateContext& context, - mozart::client::ContainerNode& container, + scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -72,7 +72,7 @@ class ExportNode { // Member variables can only be read or modified on Rasterizer thread. SceneUpdateContext* scene_update_context_ = nullptr; mx::eventpair export_token_; - std::unique_ptr node_; + std::unique_ptr node_; FTL_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; diff --git a/engine/src/flutter/flow/layers/clip_path_layer.cc b/engine/src/flutter/flow/layers/clip_path_layer.cc index 39f0e17885b..1291abadf24 100644 --- a/engine/src/flutter/flow/layers/clip_path_layer.cc +++ b/engine/src/flutter/flow/layers/clip_path_layer.cc @@ -6,7 +6,7 @@ #if defined(OS_FUCHSIA) -#include "apps/mozart/lib/scene/session_helpers.h" // nogncheck +#include "apps/mozart/lib/scenic/fidl_helpers.h" // nogncheck #endif // defined(OS_FUCHSIA) @@ -33,7 +33,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { // TODO(MZ-140): Must be able to specify paths as shapes to nodes. // Treating the shape as a rectangle for now. auto bounds = clip_path_.getBounds(); - mozart::client::Rectangle shape(context.session(), // session + scenic_lib::Rectangle shape(context.session(), // session bounds.width(), // width bounds.height() // height ); diff --git a/engine/src/flutter/flow/layers/clip_rect_layer.cc b/engine/src/flutter/flow/layers/clip_rect_layer.cc index e8a08253bb6..789c1d1fd8d 100644 --- a/engine/src/flutter/flow/layers/clip_rect_layer.cc +++ b/engine/src/flutter/flow/layers/clip_rect_layer.cc @@ -24,7 +24,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { FTL_DCHECK(needs_system_composite()); - mozart::client::Rectangle shape(context.session(), // session + scenic_lib::Rectangle shape(context.session(), // session clip_rect_.width(), // width clip_rect_.height() // height ); diff --git a/engine/src/flutter/flow/layers/clip_rrect_layer.cc b/engine/src/flutter/flow/layers/clip_rrect_layer.cc index f26670b2870..0e239e12d87 100644 --- a/engine/src/flutter/flow/layers/clip_rrect_layer.cc +++ b/engine/src/flutter/flow/layers/clip_rrect_layer.cc @@ -25,7 +25,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { FTL_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. - mozart::client::RoundedRectangle shape( + scenic_lib::RoundedRectangle shape( context.session(), // session clip_rrect_.width(), // width clip_rrect_.height(), // height diff --git a/engine/src/flutter/flow/layers/layer.h b/engine/src/flutter/flow/layers/layer.h index e374f5e9fad..177adc16c8d 100644 --- a/engine/src/flutter/flow/layers/layer.h +++ b/engine/src/flutter/flow/layers/layer.h @@ -25,8 +25,8 @@ #if defined(OS_FUCHSIA) -#include "apps/mozart/lib/scene/client/resources.h" //nogncheck -#include "apps/mozart/lib/scene/client/session.h" //nogncheck +#include "apps/mozart/lib/scenic/client/resources.h" //nogncheck +#include "apps/mozart/lib/scenic/client/session.h" //nogncheck #include "flutter/flow/scene_update_context.h" //nogncheck #endif // defined(OS_FUCHSIA) diff --git a/engine/src/flutter/flow/layers/layer_tree.cc b/engine/src/flutter/flow/layers/layer_tree.cc index 23716102ba1..000a841d543 100644 --- a/engine/src/flutter/flow/layers/layer_tree.cc +++ b/engine/src/flutter/flow/layers/layer_tree.cc @@ -40,7 +40,7 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) void LayerTree::UpdateScene(SceneUpdateContext& context, - mozart::client::ContainerNode& container) { + scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, diff --git a/engine/src/flutter/flow/layers/layer_tree.h b/engine/src/flutter/flow/layers/layer_tree.h index e85f8165e54..bf7ceb22ba3 100644 --- a/engine/src/flutter/flow/layers/layer_tree.h +++ b/engine/src/flutter/flow/layers/layer_tree.h @@ -36,7 +36,7 @@ class LayerTree { } void UpdateScene(SceneUpdateContext& context, - mozart::client::ContainerNode& container); + scenic_lib::ContainerNode& container); #endif void Paint(CompositorContext::ScopedFrame& frame); diff --git a/engine/src/flutter/flow/scene_update_context.cc b/engine/src/flutter/flow/scene_update_context.cc index 5264db36e59..5bbadf224b1 100644 --- a/engine/src/flutter/flow/scene_update_context.cc +++ b/engine/src/flutter/flow/scene_update_context.cc @@ -12,7 +12,7 @@ namespace flow { -SceneUpdateContext::SceneUpdateContext(mozart::client::Session* session, +SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { FTL_DCHECK(surface_producer_ != nullptr); @@ -48,7 +48,7 @@ void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { export_nodes_.erase(export_node); } -void SceneUpdateContext::CreateFrame(mozart::client::EntityNode& entity_node, +void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, @@ -64,7 +64,7 @@ void SceneUpdateContext::CreateFrame(mozart::client::EntityNode& entity_node, // and possibly for its texture. // TODO(MZ-137): Need to be able to express the radii as vectors. SkRect shape_bounds = rrect.getBounds(); - mozart::client::RoundedRectangle shape( + scenic_lib::RoundedRectangle shape( session_, // session rrect.width(), // width rrect.height(), // height @@ -73,7 +73,7 @@ void SceneUpdateContext::CreateFrame(mozart::client::EntityNode& entity_node, rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius ); - mozart::client::ShapeNode shape_node(session_); + scenic_lib::ShapeNode shape_node(session_); shape_node.SetShape(shape); shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(), shape_bounds.height() * 0.5f + shape_bounds.top(), @@ -101,9 +101,9 @@ void SceneUpdateContext::CreateFrame(mozart::client::EntityNode& entity_node, if (inner_bounds != shape_bounds && rrect.contains(inner_bounds)) { SetShapeColor(shape_node, color); - mozart::client::Rectangle inner_shape(session_, inner_bounds.width(), + scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(), inner_bounds.height()); - mozart::client::ShapeNode inner_node(session_); + scenic_lib::ShapeNode inner_node(session_); inner_node.SetShape(inner_shape); inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(), inner_bounds.height() * 0.5f + inner_bounds.top(), @@ -120,16 +120,16 @@ void SceneUpdateContext::CreateFrame(mozart::client::EntityNode& entity_node, } void SceneUpdateContext::SetShapeTextureOrColor( - mozart::client::ShapeNode& shape_node, + scenic_lib::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers) { - mozart::client::Image* image = GenerateImageIfNeeded( + scenic_lib::Image* image = GenerateImageIfNeeded( color, scale_x, scale_y, paint_bounds, std::move(paint_layers)); if (image != nullptr) { - mozart::client::Material material(session_); + scenic_lib::Material material(session_); material.SetTexture(*image); shape_node.SetMaterial(material); return; @@ -138,18 +138,18 @@ void SceneUpdateContext::SetShapeTextureOrColor( SetShapeColor(shape_node, color); } -void SceneUpdateContext::SetShapeColor(mozart::client::ShapeNode& shape_node, +void SceneUpdateContext::SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color) { if (SkColorGetA(color) == 0) return; - mozart::client::Material material(session_); + scenic_lib::Material material(session_); material.SetColor(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), SkColorGetA(color)); shape_node.SetMaterial(material); } -mozart::client::Image* SceneUpdateContext::GenerateImageIfNeeded( +scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded( SkColor color, SkScalar scale_x, SkScalar scale_y, @@ -227,10 +227,10 @@ SceneUpdateContext::Entity::~Entity() { } SceneUpdateContext::Clip::Clip(SceneUpdateContext& context, - mozart::client::Shape& shape, + scenic_lib::Shape& shape, const SkRect& shape_bounds) : Entity(context) { - mozart::client::ShapeNode shape_node(context.session()); + scenic_lib::ShapeNode shape_node(context.session()); shape_node.SetShape(shape); shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(), shape_bounds.height() * 0.5f + shape_bounds.top(), diff --git a/engine/src/flutter/flow/scene_update_context.h b/engine/src/flutter/flow/scene_update_context.h index 0606c0e25e7..a8c13f1a983 100644 --- a/engine/src/flutter/flow/scene_update_context.h +++ b/engine/src/flutter/flow/scene_update_context.h @@ -8,7 +8,7 @@ #include #include -#include "apps/mozart/lib/scene/client/resources.h" +#include "apps/mozart/lib/scenic/client/resources.h" #include "flutter/flow/compositor_context.h" #include "lib/ftl/build_config.h" #include "lib/ftl/logging.h" @@ -39,7 +39,7 @@ class SceneUpdateContext { virtual void SignalWritesFinished( std::function on_writes_committed) = 0; - virtual mozart::client::Image* GetImage() = 0; + virtual scenic_lib::Image* GetImage() = 0; virtual sk_sp GetSkiaSurface() const = 0; }; @@ -59,19 +59,19 @@ class SceneUpdateContext { ~Entity(); SceneUpdateContext& context() { return context_; } - mozart::client::EntityNode& entity_node() { return entity_node_; } + scenic_lib::EntityNode& entity_node() { return entity_node_; } private: SceneUpdateContext& context_; Entity* const previous_entity_; - mozart::client::EntityNode entity_node_; + scenic_lib::EntityNode entity_node_; }; class Clip : public Entity { public: Clip(SceneUpdateContext& context, - mozart::client::Shape& shape, + scenic_lib::Shape& shape, const SkRect& shape_bounds); ~Clip(); }; @@ -108,15 +108,15 @@ class SceneUpdateContext { SkRect paint_bounds_; }; - SceneUpdateContext(mozart::client::Session* session, + SceneUpdateContext(scenic_lib::Session* session, SurfaceProducer* surface_producer); ~SceneUpdateContext(); - mozart::client::Session* session() { return session_; } + scenic_lib::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } - void set_metrics(mozart2::MetricsPtr metrics) { + void set_metrics(scenic::MetricsPtr metrics) { metrics_ = std::move(metrics); } @@ -153,19 +153,19 @@ class SceneUpdateContext { std::vector layers; }; - void CreateFrame(mozart::client::EntityNode& entity_node, + void CreateFrame(scenic_lib::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeTextureOrColor(mozart::client::ShapeNode& shape_node, + void SetShapeTextureOrColor(scenic_lib::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeColor(mozart::client::ShapeNode& shape_node, SkColor color); - mozart::client::Image* GenerateImageIfNeeded( + void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color); + scenic_lib::Image* GenerateImageIfNeeded( SkColor color, SkScalar scale_x, SkScalar scale_y, @@ -176,10 +176,10 @@ class SceneUpdateContext { float top_scale_x_ = 1.f; float top_scale_y_ = 1.f; - mozart::client::Session* const session_; + scenic_lib::Session* const session_; SurfaceProducer* const surface_producer_; - mozart2::MetricsPtr metrics_; + scenic::MetricsPtr metrics_; std::vector paint_tasks_;