diff --git a/BUILD.gn b/BUILD.gn index 17fcaf2d33a76e9653ba6e31c1594c97b0d73bba..06c4503fc66d09062505e781f83574cdcbbca285 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2,11 +2,11 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# This target will be built if no target is specified when invoking ninja. group("flutter") { testonly = true deps = [ + "//flutter/flow", "//flutter/glue", ] diff --git a/flow/BUILD.gn b/flow/BUILD.gn index f993e6e0bd143053879dcfaa66acb4c8e3d0a579..73f69c02d1f6569095c83a8e7b1a3a1a163c5c8f 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -47,9 +47,17 @@ source_set("flow") { deps = [ "//flutter/glue", + "//flutter/skia", "//lib/ftl", "//mojo/services/gfx/composition/interfaces", - "//mojo/skia", - "//flutter/skia", ] + + if (is_fuchsia) { + # TODO(abarth): In principle, we should add "//mojo/public/c/gpu" as a + # dependency, but that doesn't work currently because GPU support on Fuchsia + # is still a work in progress. + include_dirs = [ + "//mojo/public/c/gpu", + ] + } } diff --git a/flow/layers/child_scene_layer.cc b/flow/layers/child_scene_layer.cc index 84db5ab9b593a79b1bbb93aa7e4000e9e8ba8d0d..de9cb370708a5f0c3c9e02aec3ed016914567f28 100644 --- a/flow/layers/child_scene_layer.cc +++ b/flow/layers/child_scene_layer.cc @@ -4,13 +4,37 @@ #include "flutter/flow/layers/child_scene_layer.h" -#include "mojo/skia/type_converters.h" - namespace flow { +namespace { + +mojo::TransformPtr GetTransformFromSkMatrix(const SkMatrix& input) { + // Expand 3x3 to 4x4. + auto output = mojo::Transform::New(); + output->matrix.resize(16u); + output->matrix[0] = input[0]; + output->matrix[1] = input[1]; + output->matrix[2] = 0.f; + output->matrix[3] = input[2]; + output->matrix[4] = input[3]; + output->matrix[5] = input[4]; + output->matrix[6] = 0.f; + output->matrix[7] = input[5]; + output->matrix[8] = 0.f; + output->matrix[9] = 0.f; + output->matrix[10] = 1.f; + output->matrix[11] = 0.f; + output->matrix[12] = input[6]; + output->matrix[13] = input[7]; + output->matrix[14] = 0.f; + output->matrix[15] = input[8]; + return output.Pass(); +} // TODO(abarth): We need to figure out how to allocate these ids sensibly. static uint32_t next_id = 10; +} // namespace + ChildSceneLayer::ChildSceneLayer() : device_pixel_ratio_(1.0f) {} ChildSceneLayer::~ChildSceneLayer() {} @@ -42,7 +66,7 @@ void ChildSceneLayer::UpdateScene(mojo::gfx::composition::SceneUpdate* update, child_node->content_clip = mojo::RectF::New(); child_node->content_clip->width = physical_size_.width(); child_node->content_clip->height = physical_size_.height(); - child_node->content_transform = mojo::Transform::From(transform_); + child_node->content_transform = GetTransformFromSkMatrix(transform_); update->nodes.insert(id, child_node.Pass()); container->child_node_ids.push_back(id); } diff --git a/flow/open_gl.h b/flow/open_gl.h index b9beaad67867a7a977038e5b6abd4e57c17cb619..9058355d8a0aa24116d3d82470084b55bb59b42d 100644 --- a/flow/open_gl.h +++ b/flow/open_gl.h @@ -7,19 +7,19 @@ #include "lib/ftl/build_config.h" -#if OS_IOS +#if defined(OS_IOS) #include -#elif OS_MACOSX +#elif defined(OS_MACOSX) #include -#elif OS_ANDROID +#elif defined(OS_ANDROID) || defined(OS_FUCHSIA) #include -#elif OS_LINUX +#elif defined(OS_LINUX) #include diff --git a/skia/BUILD.gn b/skia/BUILD.gn index c8b2ef38559ad8b793d0c9e119a3ad23b6c48df0..ea05bcbe0938ea7d15968df87d6b28acea2d40be 100644 --- a/skia/BUILD.gn +++ b/skia/BUILD.gn @@ -2,6 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +if (is_fuchsia) { + +group("skia") { + # TODO(abarth): Switch the non-Fuchsia build over to using Skia's BUILD.gn + # files as well. + public_deps = [ "//third_party/skia" ] +} + +} else { + import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/test.gni") @@ -553,3 +563,5 @@ source_set("skia_opts") { visibility = [ ":skia" ] } + +} # if (is_fuchsia)