From 61a326b42b4b06066c7a599b7d441d252e05583d Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 4 Oct 2019 13:44:46 -0700 Subject: [PATCH 1/2] unbreak unopt fuchsia --- shell/platform/fuchsia/flutter/BUILD.gn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index de9cfa561e708..9ce49f4f634c0 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/shell/platform/fuchsia/flutter/BUILD.gn @@ -7,6 +7,7 @@ assert(is_fuchsia) import("//build/fuchsia/sdk.gni") import("$flutter_root/common/config.gni") import("$flutter_root/shell/gpu/gpu.gni") +import("$flutter_root/testing/testing.gni") import("$flutter_root/tools/fuchsia/common_libs.gni") import("$flutter_root/tools/fuchsia/dart.gni") import("$flutter_root/tools/fuchsia/fuchsia_archive.gni") @@ -241,6 +242,10 @@ jit_runner("flutter_jit_product_runner") { product = true } +test_fixtures("flutter_runner_fixtures") { + fixtures = [] +} + executable("flutter_runner_unittests") { testonly = true @@ -268,6 +273,7 @@ executable("flutter_runner_unittests") { deps = [ ":aot", + ":flutter_runner_fixtures", "//build/fuchsia/fidl:fuchsia.accessibility.semantics", "//build/fuchsia/fidl:fuchsia.modular", "//build/fuchsia/pkg:async-loop-cpp", From 0276d4229c8edcc9392d1b4efdbba86e93ee05a5 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 7 Oct 2019 14:23:32 -0700 Subject: [PATCH 2/2] Update docs --- lib/ui/painting.dart | 61 +++++++++++++++++++++++++++-- lib/web_ui/lib/src/ui/painting.dart | 61 +++++++++++++++++++++++++++-- 2 files changed, 116 insertions(+), 6 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 84e5769b2a68e..fd3786f626680 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2493,9 +2493,64 @@ class ColorFilter { _matrix = null, _type = _TypeMode; - /// Construct a color filter that transforms a color by a 4x5 matrix. The - /// matrix is in row-major order and the translation column is specified in - /// unnormalized, 0...255, space. + /// Construct a color filter that transforms a color by a 4x5 matrix. + /// + /// Every pixel's color value, repsented as an `[R, G, B, A]`, is matrix + /// multiplied to create a new color: + /// + /// ``` + /// | R' | | a00 a01 a02 a03 a04 | | R | + /// | G' | = | a10 a11 a22 a33 a44 | * | G | + /// | B' | | a20 a21 a22 a33 a44 | | B | + /// | A' | | a30 a31 a22 a33 a44 | | A | + /// ``` + /// + /// The matrix is in row-major order and the translation column is specified + /// in unnormalized, 0...255, space. For example, the identity matrix is: + /// + /// ``` + /// const ColorMatrix identity = ColorFilter.matrix([ + /// 1, 0, 0, 0, 0, + /// 0, 1, 0, 0, 0, + /// 0, 0, 1, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// ## Examples + /// + /// An inversion color matrix: + /// + /// ``` + /// const ColorFilter invert = ColorFilter.matrix([ + /// -1, 0, 0, 0, 255, + /// 0, -1, 0, 0, 255, + /// 0, 0, -1, 0, 255, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// A sepia-toned color matrix (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#sepiaEquivalent)): + /// + /// ``` + /// const ColorFilter sepia = ColorFilter.matrix([ + /// 0.393, 0.769, 0.189, 0, 0, + /// 0.349, 0.686, 0.168, 0, 0, + /// 0.272, 0.534, 0.131, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// A greyscale color filter (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#grayscaleEquivalent)): + /// + /// ``` + /// const ColorFilter greyscale = ColorFilter.matrix([ + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` const ColorFilter.matrix(List matrix) : _color = null, _blendMode = null, diff --git a/lib/web_ui/lib/src/ui/painting.dart b/lib/web_ui/lib/src/ui/painting.dart index 09190abbff289..071ff6b0c1147 100644 --- a/lib/web_ui/lib/src/ui/painting.dart +++ b/lib/web_ui/lib/src/ui/painting.dart @@ -1400,9 +1400,64 @@ class ColorFilter { : _color = color, _blendMode = blendMode; - /// Construct a color filter that transforms a color by a 4x5 matrix. The - /// matrix is in row-major order and the translation column is specified in - /// unnormalized, 0...255, space. + /// Construct a color filter that transforms a color by a 4x5 matrix. + /// + /// Every pixel's color value, repsented as an `[R, G, B, A]`, is matrix + /// multiplied to create a new color: + /// + /// ``` + /// | R' | | a00 a01 a02 a03 a04 | | R | + /// | G' | = | a10 a11 a22 a33 a44 | * | G | + /// | B' | | a20 a21 a22 a33 a44 | | B | + /// | A' | | a30 a31 a22 a33 a44 | | A | + /// ``` + /// + /// The matrix is in row-major order and the translation column is specified + /// in unnormalized, 0...255, space. For example, the identity matrix is: + /// + /// ``` + /// const ColorMatrix identity = ColorFilter.matrix([ + /// 1, 0, 0, 0, 0, + /// 0, 1, 0, 0, 0, + /// 0, 0, 1, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// ## Examples + /// + /// An inversion color matrix: + /// + /// ``` + /// const ColorFilter invert = ColorFilter.matrix([ + /// -1, 0, 0, 0, 255, + /// 0, -1, 0, 0, 255, + /// 0, 0, -1, 0, 255, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// A sepia-toned color matrix (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#sepiaEquivalent)): + /// + /// ``` + /// const ColorFilter sepia = ColorFilter.matrix([ + /// 0.393, 0.769, 0.189, 0, 0, + /// 0.349, 0.686, 0.168, 0, 0, + /// 0.272, 0.534, 0.131, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` + /// + /// A greyscale color filter (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#grayscaleEquivalent)): + /// + /// ``` + /// const ColorFilter greyscale = ColorFilter.matrix([ + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0.2126, 0.7152, 0.0722, 0, 0, + /// 0, 0, 0, 1, 0, + /// ]); + /// ``` const ColorFilter.matrix(List matrix) : _color = null, _blendMode = null;