Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4c4ef98

Browse files
authored
[fuchsia] Rename scenic_lib => scenic (#5648)
TEST=Compiled and ran flutter app on Fuchsia, verified it rendered and responded to input.
1 parent f0c21f3 commit 4c4ef98

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

flow/export_node.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ExportNodeHolder::ExportNodeHolder(
1717
}
1818

1919
void ExportNodeHolder::Bind(SceneUpdateContext& context,
20-
scenic_lib::ContainerNode& container,
20+
scenic::ContainerNode& container,
2121
const SkPoint& offset,
2222
bool hit_testable) {
2323
export_node_->Bind(context, container, offset, hit_testable);
@@ -40,12 +40,12 @@ ExportNode::~ExportNode() {
4040
}
4141

4242
void ExportNode::Bind(SceneUpdateContext& context,
43-
scenic_lib::ContainerNode& container,
43+
scenic::ContainerNode& container,
4444
const SkPoint& offset,
4545
bool hit_testable) {
4646
if (export_token_) {
4747
// Happens first time we bind.
48-
node_.reset(new scenic_lib::EntityNode(container.session()));
48+
node_.reset(new scenic::EntityNode(container.session()));
4949
node_->Export(std::move(export_token_));
5050

5151
// Add ourselves to the context so it can call Dispose() on us if the Scenic

flow/export_node.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "lib/fxl/build_config.h"
1515
#include "lib/fxl/macros.h"
1616
#include "lib/fxl/memory/ref_counted.h"
17-
#include "lib/ui/scenic/client/resources.h"
17+
#include "lib/ui/scenic/cpp/resources.h"
1818
#include "third_party/flutter/fml/task_runner.h"
1919
#include "third_party/skia/include/core/SkPoint.h"
2020

@@ -31,7 +31,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe<ExportNodeHolder> {
3131

3232
// Calls Bind() on the wrapped ExportNode.
3333
void Bind(SceneUpdateContext& context,
34-
scenic_lib::ContainerNode& container,
34+
scenic::ContainerNode& container,
3535
const SkPoint& offset,
3636
bool hit_testable);
3737

@@ -58,7 +58,7 @@ class ExportNode {
5858
// Binds the export token to the entity node and adds it as a child of
5959
// the specified container. Must be called on the Rasterizer thread.
6060
void Bind(SceneUpdateContext& context,
61-
scenic_lib::ContainerNode& container,
61+
scenic::ContainerNode& container,
6262
const SkPoint& offset,
6363
bool hit_testable);
6464

@@ -73,7 +73,7 @@ class ExportNode {
7373
// Member variables can only be read or modified on Rasterizer thread.
7474
SceneUpdateContext* scene_update_context_ = nullptr;
7575
zx::eventpair export_token_;
76-
std::unique_ptr<scenic_lib::EntityNode> node_;
76+
std::unique_ptr<scenic::EntityNode> node_;
7777

7878
FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode);
7979
};

flow/layers/clip_path_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
3333
// TODO(MZ-140): Must be able to specify paths as shapes to nodes.
3434
// Treating the shape as a rectangle for now.
3535
auto bounds = clip_path_.getBounds();
36-
scenic_lib::Rectangle shape(context.session(), // session
36+
scenic::Rectangle shape(context.session(), // session
3737
bounds.width(), // width
3838
bounds.height() // height
3939
);

flow/layers/clip_rect_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
2424
void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
2525
FXL_DCHECK(needs_system_composite());
2626

27-
scenic_lib::Rectangle shape(context.session(), // session
27+
scenic::Rectangle shape(context.session(), // session
2828
clip_rect_.width(), // width
2929
clip_rect_.height() // height
3030
);

flow/layers/clip_rrect_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
2525
FXL_DCHECK(needs_system_composite());
2626

2727
// TODO(MZ-137): Need to be able to express the radii as vectors.
28-
scenic_lib::RoundedRectangle shape(
28+
scenic::RoundedRectangle shape(
2929
context.session(), // session
3030
clip_rrect_.width(), // width
3131
clip_rrect_.height(), // height

flow/layers/layer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#if defined(OS_FUCHSIA)
2828

2929
#include "flutter/flow/scene_update_context.h" //nogncheck
30-
#include "lib/ui/scenic/client/resources.h" //nogncheck
31-
#include "lib/ui/scenic/client/session.h" //nogncheck
30+
#include "lib/ui/scenic/cpp/resources.h" //nogncheck
31+
#include "lib/ui/scenic/cpp/session.h" //nogncheck
3232

3333
#endif // defined(OS_FUCHSIA)
3434

flow/layers/layer_tree.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame,
3737

3838
#if defined(OS_FUCHSIA)
3939
void LayerTree::UpdateScene(SceneUpdateContext& context,
40-
scenic_lib::ContainerNode& container) {
40+
scenic::ContainerNode& container) {
4141
TRACE_EVENT0("flutter", "LayerTree::UpdateScene");
4242
const auto& metrics = context.metrics();
4343
SceneUpdateContext::Transform transform(context, // context

flow/layers/layer_tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LayerTree {
2929

3030
#if defined(OS_FUCHSIA)
3131
void UpdateScene(SceneUpdateContext& context,
32-
scenic_lib::ContainerNode& container);
32+
scenic::ContainerNode& container);
3333
#endif
3434

3535
void Paint(CompositorContext::ScopedFrame& frame) const;

flow/scene_update_context.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace flow {
1313

14-
SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session,
14+
SceneUpdateContext::SceneUpdateContext(scenic::Session* session,
1515
SurfaceProducer* surface_producer)
1616
: session_(session), surface_producer_(surface_producer) {
1717
FXL_DCHECK(surface_producer_ != nullptr);
@@ -40,7 +40,7 @@ void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) {
4040
export_nodes_.erase(export_node);
4141
}
4242

43-
void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
43+
void SceneUpdateContext::CreateFrame(scenic::EntityNode& entity_node,
4444
const SkRRect& rrect,
4545
SkColor color,
4646
const SkRect& paint_bounds,
@@ -56,7 +56,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
5656
// and possibly for its texture.
5757
// TODO(MZ-137): Need to be able to express the radii as vectors.
5858
SkRect shape_bounds = rrect.getBounds();
59-
scenic_lib::RoundedRectangle shape(
59+
scenic::RoundedRectangle shape(
6060
session_, // session
6161
rrect.width(), // width
6262
rrect.height(), // height
@@ -65,7 +65,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
6565
rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius
6666
rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius
6767
);
68-
scenic_lib::ShapeNode shape_node(session_);
68+
scenic::ShapeNode shape_node(session_);
6969
shape_node.SetShape(shape);
7070
shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(),
7171
shape_bounds.height() * 0.5f + shape_bounds.top(),
@@ -93,9 +93,9 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
9393
if (inner_bounds != shape_bounds && rrect.contains(inner_bounds)) {
9494
SetShapeColor(shape_node, color);
9595

96-
scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(),
96+
scenic::Rectangle inner_shape(session_, inner_bounds.width(),
9797
inner_bounds.height());
98-
scenic_lib::ShapeNode inner_node(session_);
98+
scenic::ShapeNode inner_node(session_);
9999
inner_node.SetShape(inner_shape);
100100
inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(),
101101
inner_bounds.height() * 0.5f + inner_bounds.top(),
@@ -112,16 +112,16 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node,
112112
}
113113

114114
void SceneUpdateContext::SetShapeTextureOrColor(
115-
scenic_lib::ShapeNode& shape_node,
115+
scenic::ShapeNode& shape_node,
116116
SkColor color,
117117
SkScalar scale_x,
118118
SkScalar scale_y,
119119
const SkRect& paint_bounds,
120120
std::vector<Layer*> paint_layers) {
121-
scenic_lib::Image* image = GenerateImageIfNeeded(
121+
scenic::Image* image = GenerateImageIfNeeded(
122122
color, scale_x, scale_y, paint_bounds, std::move(paint_layers));
123123
if (image != nullptr) {
124-
scenic_lib::Material material(session_);
124+
scenic::Material material(session_);
125125
material.SetTexture(*image);
126126
shape_node.SetMaterial(material);
127127
return;
@@ -130,18 +130,18 @@ void SceneUpdateContext::SetShapeTextureOrColor(
130130
SetShapeColor(shape_node, color);
131131
}
132132

133-
void SceneUpdateContext::SetShapeColor(scenic_lib::ShapeNode& shape_node,
133+
void SceneUpdateContext::SetShapeColor(scenic::ShapeNode& shape_node,
134134
SkColor color) {
135135
if (SkColorGetA(color) == 0)
136136
return;
137137

138-
scenic_lib::Material material(session_);
138+
scenic::Material material(session_);
139139
material.SetColor(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color),
140140
SkColorGetA(color));
141141
shape_node.SetMaterial(material);
142142
}
143143

144-
scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded(
144+
scenic::Image* SceneUpdateContext::GenerateImageIfNeeded(
145145
SkColor color,
146146
SkScalar scale_x,
147147
SkScalar scale_y,
@@ -219,10 +219,10 @@ SceneUpdateContext::Entity::~Entity() {
219219
}
220220

221221
SceneUpdateContext::Clip::Clip(SceneUpdateContext& context,
222-
scenic_lib::Shape& shape,
222+
scenic::Shape& shape,
223223
const SkRect& shape_bounds)
224224
: Entity(context) {
225-
scenic_lib::ShapeNode shape_node(context.session());
225+
scenic::ShapeNode shape_node(context.session());
226226
shape_node.SetShape(shape);
227227
shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(),
228228
shape_bounds.height() * 0.5f + shape_bounds.top(),

flow/scene_update_context.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "lib/fxl/build_config.h"
1414
#include "lib/fxl/logging.h"
1515
#include "lib/fxl/macros.h"
16-
#include "lib/ui/scenic/client/resources.h"
16+
#include "lib/ui/scenic/cpp/resources.h"
1717
#include "third_party/skia/include/core/SkRect.h"
1818
#include "third_party/skia/include/core/SkSurface.h"
1919

@@ -40,7 +40,7 @@ class SceneUpdateContext {
4040
virtual void SignalWritesFinished(
4141
std::function<void(void)> on_writes_committed) = 0;
4242

43-
virtual scenic_lib::Image* GetImage() = 0;
43+
virtual scenic::Image* GetImage() = 0;
4444

4545
virtual sk_sp<SkSurface> GetSkiaSurface() const = 0;
4646
};
@@ -62,19 +62,19 @@ class SceneUpdateContext {
6262
~Entity();
6363

6464
SceneUpdateContext& context() { return context_; }
65-
scenic_lib::EntityNode& entity_node() { return entity_node_; }
65+
scenic::EntityNode& entity_node() { return entity_node_; }
6666

6767
private:
6868
SceneUpdateContext& context_;
6969
Entity* const previous_entity_;
7070

71-
scenic_lib::EntityNode entity_node_;
71+
scenic::EntityNode entity_node_;
7272
};
7373

7474
class Clip : public Entity {
7575
public:
7676
Clip(SceneUpdateContext& context,
77-
scenic_lib::Shape& shape,
77+
scenic::Shape& shape,
7878
const SkRect& shape_bounds);
7979
~Clip();
8080
};
@@ -111,12 +111,12 @@ class SceneUpdateContext {
111111
SkRect paint_bounds_;
112112
};
113113

114-
SceneUpdateContext(scenic_lib::Session* session,
114+
SceneUpdateContext(scenic::Session* session,
115115
SurfaceProducer* surface_producer);
116116

117117
~SceneUpdateContext();
118118

119-
scenic_lib::Session* session() { return session_; }
119+
scenic::Session* session() { return session_; }
120120

121121
bool has_metrics() const { return !!metrics_; }
122122
void set_metrics(fuchsia::ui::gfx::MetricsPtr metrics) {
@@ -157,19 +157,19 @@ class SceneUpdateContext {
157157
std::vector<Layer*> layers;
158158
};
159159

160-
void CreateFrame(scenic_lib::EntityNode& entity_node,
160+
void CreateFrame(scenic::EntityNode& entity_node,
161161
const SkRRect& rrect,
162162
SkColor color,
163163
const SkRect& paint_bounds,
164164
std::vector<Layer*> paint_layers);
165-
void SetShapeTextureOrColor(scenic_lib::ShapeNode& shape_node,
165+
void SetShapeTextureOrColor(scenic::ShapeNode& shape_node,
166166
SkColor color,
167167
SkScalar scale_x,
168168
SkScalar scale_y,
169169
const SkRect& paint_bounds,
170170
std::vector<Layer*> paint_layers);
171-
void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color);
172-
scenic_lib::Image* GenerateImageIfNeeded(SkColor color,
171+
void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color);
172+
scenic::Image* GenerateImageIfNeeded(SkColor color,
173173
SkScalar scale_x,
174174
SkScalar scale_y,
175175
const SkRect& paint_bounds,
@@ -179,7 +179,7 @@ class SceneUpdateContext {
179179
float top_scale_x_ = 1.f;
180180
float top_scale_y_ = 1.f;
181181

182-
scenic_lib::Session* const session_;
182+
scenic::Session* const session_;
183183
SurfaceProducer* const surface_producer_;
184184

185185
fuchsia::ui::gfx::MetricsPtr metrics_;

0 commit comments

Comments
 (0)