Index: sky/engine/core/painting/MaskFilter.dart |
diff --git a/sky/engine/core/painting/MaskFilter.dart b/sky/engine/core/painting/MaskFilter.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c7014509bac72f29d91c4b5570f41c2fc84f769b |
--- /dev/null |
+++ b/sky/engine/core/painting/MaskFilter.dart |
@@ -0,0 +1,27 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Extends the generated _MaskFilter interface via the CustomDart attribute. |
+ |
eseidel
2015/06/02 20:49:45
Do we need "part dart:sky" lines at the top of the
Matt Perry
2015/06/02 21:03:42
Not for this one - CustomDart files are appended t
|
+/// Blur styles. These mirror SkBlurStyle and must be kept in sync. |
+enum BlurStyle { |
+ normal, /// Fuzzy inside and outside. |
eseidel
2015/06/02 20:49:45
Is this the correct Dart enum naming style?
Matt Perry
2015/06/02 21:03:42
According to https://www.dartlang.org/articles/sty
|
+ solid, /// Solid inside, fuzzy outside. |
+ outer, /// Nothing inside, fuzzy outside. |
+ inner, /// Fuzzy inside, nothing outside. |
+} |
+ |
+class MaskFilter extends _MaskFilter { |
+ MaskFilter.Blur(BlurStyle style, double sigma, |
+ {bool ignoreTransform: false, bool highQuality: false}) |
+ : super(style.index, sigma, _makeBlurFlags(ignoreTransform, highQuality)); |
+ |
+ // Convert constructor parameters to the SkBlurMaskFilter::BlurFlags type. |
+ static int _makeBlurFlags(bool ignoreTransform, bool highQuality) { |
+ int flags = 0; |
+ if (ignoreTransform) flags |= 0x01; |
+ if (highQuality) flags |= 0x02; |
+ return flags; |
+ } |
+} |