diff --git a/flow/export_node.cc b/flow/export_node.cc index b4d37d61d65fc4f76d69584aed4a110a5ff947c4..9b4b62faea5c2e5b75889bf38835e54eb24dfdbd 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -17,7 +17,7 @@ ExportNodeHolder::ExportNodeHolder( } void ExportNodeHolder::Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable) { export_node_->Bind(context, container, offset, hit_testable); @@ -40,12 +40,12 @@ ExportNode::~ExportNode() { } void ExportNode::Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable) { if (export_token_) { // Happens first time we bind. - node_.reset(new scenic_lib::EntityNode(container.session())); + node_.reset(new scenic::EntityNode(container.session())); node_->Export(std::move(export_token_)); // Add ourselves to the context so it can call Dispose() on us if the Scenic diff --git a/flow/export_node.h b/flow/export_node.h index e6a11175e561e7cfc838180197598d8456032338..335d3ba92aba3e5f0de38833c2bb4a4485b3d849 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -14,7 +14,7 @@ #include "lib/fxl/build_config.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" -#include "lib/ui/scenic/client/resources.h" +#include "lib/ui/scenic/cpp/resources.h" #include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" @@ -31,7 +31,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { // Calls Bind() on the wrapped ExportNode. void Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -58,7 +58,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, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -73,7 +73,7 @@ class ExportNode { // Member variables can only be read or modified on Rasterizer thread. SceneUpdateContext* scene_update_context_ = nullptr; zx::eventpair export_token_; - std::unique_ptr node_; + std::unique_ptr node_; FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 06dd30bd3630a206110697d56a179daa7966ce59..e5547a39a90d32188ec4bd3db0e2c3ab447f3a04 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -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(); - scenic_lib::Rectangle shape(context.session(), // session + scenic::Rectangle shape(context.session(), // session bounds.width(), // width bounds.height() // height ); diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 4abdbdaf6921769b015f9d276d103d5e356a2860..0e613793426fd5c8047d83071332bf3983c662c0 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -24,7 +24,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); - scenic_lib::Rectangle shape(context.session(), // session + scenic::Rectangle shape(context.session(), // session clip_rect_.width(), // width clip_rect_.height() // height ); diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index cef687dfcfb8aa259e6db73cd51763915ce7882a..67ec489d6b6c7f8c35550cc41cff2b30b37782d2 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -25,7 +25,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. - scenic_lib::RoundedRectangle shape( + scenic::RoundedRectangle shape( context.session(), // session clip_rrect_.width(), // width clip_rrect_.height(), // height diff --git a/flow/layers/layer.h b/flow/layers/layer.h index cf7ad71c36fae37e268f7d7e6fc63da5b25d9612..87539d3e98b5dbf200da52498a221b7819101abf 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -27,8 +27,8 @@ #if defined(OS_FUCHSIA) #include "flutter/flow/scene_update_context.h" //nogncheck -#include "lib/ui/scenic/client/resources.h" //nogncheck -#include "lib/ui/scenic/client/session.h" //nogncheck +#include "lib/ui/scenic/cpp/resources.h" //nogncheck +#include "lib/ui/scenic/cpp/session.h" //nogncheck #endif // defined(OS_FUCHSIA) diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index 67ec443dbd9bbbfa9c1061ee17d06be277837326..d5bacbd865c37078a943eea232b464be862810c5 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -37,7 +37,7 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) void LayerTree::UpdateScene(SceneUpdateContext& context, - scenic_lib::ContainerNode& container) { + scenic::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); const auto& metrics = context.metrics(); SceneUpdateContext::Transform transform(context, // context diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 548c99f0ce6b564d621eb718062c5449cc1623fc..522fe6a34f393193957259a0002af56b44cc6c7d 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -29,7 +29,7 @@ class LayerTree { #if defined(OS_FUCHSIA) void UpdateScene(SceneUpdateContext& context, - scenic_lib::ContainerNode& container); + scenic::ContainerNode& container); #endif void Paint(CompositorContext::ScopedFrame& frame) const; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index b9d6801cc82ee9241e8d5f31430ab11d83351219..dc72f28deef4438dbf84d3d704626df173fc6ca9 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -11,7 +11,7 @@ namespace flow { -SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, +SceneUpdateContext::SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { FXL_DCHECK(surface_producer_ != nullptr); @@ -40,7 +40,7 @@ void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { export_nodes_.erase(export_node); } -void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, +void SceneUpdateContext::CreateFrame(scenic::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, @@ -56,7 +56,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::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(); - scenic_lib::RoundedRectangle shape( + scenic::RoundedRectangle shape( session_, // session rrect.width(), // width rrect.height(), // height @@ -65,7 +65,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius ); - scenic_lib::ShapeNode shape_node(session_); + scenic::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(), @@ -93,9 +93,9 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, if (inner_bounds != shape_bounds && rrect.contains(inner_bounds)) { SetShapeColor(shape_node, color); - scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(), + scenic::Rectangle inner_shape(session_, inner_bounds.width(), inner_bounds.height()); - scenic_lib::ShapeNode inner_node(session_); + scenic::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(), @@ -112,16 +112,16 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, } void SceneUpdateContext::SetShapeTextureOrColor( - scenic_lib::ShapeNode& shape_node, + scenic::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers) { - scenic_lib::Image* image = GenerateImageIfNeeded( + scenic::Image* image = GenerateImageIfNeeded( color, scale_x, scale_y, paint_bounds, std::move(paint_layers)); if (image != nullptr) { - scenic_lib::Material material(session_); + scenic::Material material(session_); material.SetTexture(*image); shape_node.SetMaterial(material); return; @@ -130,18 +130,18 @@ void SceneUpdateContext::SetShapeTextureOrColor( SetShapeColor(shape_node, color); } -void SceneUpdateContext::SetShapeColor(scenic_lib::ShapeNode& shape_node, +void SceneUpdateContext::SetShapeColor(scenic::ShapeNode& shape_node, SkColor color) { if (SkColorGetA(color) == 0) return; - scenic_lib::Material material(session_); + scenic::Material material(session_); material.SetColor(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), SkColorGetA(color)); shape_node.SetMaterial(material); } -scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded( +scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( SkColor color, SkScalar scale_x, SkScalar scale_y, @@ -219,10 +219,10 @@ SceneUpdateContext::Entity::~Entity() { } SceneUpdateContext::Clip::Clip(SceneUpdateContext& context, - scenic_lib::Shape& shape, + scenic::Shape& shape, const SkRect& shape_bounds) : Entity(context) { - scenic_lib::ShapeNode shape_node(context.session()); + scenic::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/flow/scene_update_context.h b/flow/scene_update_context.h index 46210431ed8ee69718df37e8296e51e90e5ddd69..23beb0a887dae10cb55359146a96ab9341e82489 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -13,7 +13,7 @@ #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/fxl/macros.h" -#include "lib/ui/scenic/client/resources.h" +#include "lib/ui/scenic/cpp/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -40,7 +40,7 @@ class SceneUpdateContext { virtual void SignalWritesFinished( std::function on_writes_committed) = 0; - virtual scenic_lib::Image* GetImage() = 0; + virtual scenic::Image* GetImage() = 0; virtual sk_sp GetSkiaSurface() const = 0; }; @@ -62,19 +62,19 @@ class SceneUpdateContext { ~Entity(); SceneUpdateContext& context() { return context_; } - scenic_lib::EntityNode& entity_node() { return entity_node_; } + scenic::EntityNode& entity_node() { return entity_node_; } private: SceneUpdateContext& context_; Entity* const previous_entity_; - scenic_lib::EntityNode entity_node_; + scenic::EntityNode entity_node_; }; class Clip : public Entity { public: Clip(SceneUpdateContext& context, - scenic_lib::Shape& shape, + scenic::Shape& shape, const SkRect& shape_bounds); ~Clip(); }; @@ -111,12 +111,12 @@ class SceneUpdateContext { SkRect paint_bounds_; }; - SceneUpdateContext(scenic_lib::Session* session, + SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer); ~SceneUpdateContext(); - scenic_lib::Session* session() { return session_; } + scenic::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } void set_metrics(fuchsia::ui::gfx::MetricsPtr metrics) { @@ -157,19 +157,19 @@ class SceneUpdateContext { std::vector layers; }; - void CreateFrame(scenic_lib::EntityNode& entity_node, + void CreateFrame(scenic::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeTextureOrColor(scenic_lib::ShapeNode& shape_node, + void SetShapeTextureOrColor(scenic::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color); - scenic_lib::Image* GenerateImageIfNeeded(SkColor color, + void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color); + scenic::Image* GenerateImageIfNeeded(SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, @@ -179,7 +179,7 @@ class SceneUpdateContext { float top_scale_x_ = 1.f; float top_scale_y_ = 1.f; - scenic_lib::Session* const session_; + scenic::Session* const session_; SurfaceProducer* const surface_producer_; fuchsia::ui::gfx::MetricsPtr metrics_;