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

Commit 8b4aedc

Browse files
committed
[fuchsia] Add tests for Fuchsia-specific layer behavior.
Inspect commands going to Scenic and make sure they match what is expected. Also, restructure code to need less member variables, and other cleanups based on review feedback.
1 parent b2921e9 commit 8b4aedc

12 files changed

+824
-73
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ FILE: ../../../flutter/flow/layers/color_filter_layer_unittests.cc
4949
FILE: ../../../flutter/flow/layers/container_layer.cc
5050
FILE: ../../../flutter/flow/layers/container_layer.h
5151
FILE: ../../../flutter/flow/layers/container_layer_unittests.cc
52+
FILE: ../../../flutter/flow/layers/fuchsia_layer_unittests.cc
5253
FILE: ../../../flutter/flow/layers/image_filter_layer.cc
5354
FILE: ../../../flutter/flow/layers/image_filter_layer.h
5455
FILE: ../../../flutter/flow/layers/image_filter_layer_unittests.cc

flow/BUILD.gn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ source_set("flow") {
8888

8989
if (using_fuchsia_sdk) {
9090
public_deps += [
91+
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
9192
"$fuchsia_sdk_root/fidl:fuchsia.ui.gfx",
9293
"$fuchsia_sdk_root/pkg:scenic_cpp",
9394
]
@@ -159,6 +160,10 @@ executable("flow_unittests") {
159160
"texture_unittests.cc",
160161
]
161162

163+
if (is_fuchsia) {
164+
sources += [ "layers/fuchsia_layer_unittests.cc" ]
165+
}
166+
162167
deps = [
163168
":flow",
164169
":flow_fixtures",
@@ -170,6 +175,10 @@ executable("flow_unittests") {
170175
"//third_party/googletest:gtest",
171176
"//third_party/skia",
172177
]
178+
179+
if (is_fuchsia) {
180+
deps += [ "//build/fuchsia/pkg:sys_cpp_testing" ]
181+
}
173182
}
174183

175184
if (is_fuchsia) {

flow/layers/child_scene_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) {
5151
FML_DCHECK(view_holder);
5252

5353
view_holder->UpdateScene(context, offset_, size_,
54-
sk_float_round2int(context.alphaf() * 255),
54+
SkScalarRoundToInt(context.alphaf() * 255),
5555
hit_testable_);
5656
}
5757

0 commit comments

Comments
 (0)