-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ImageFilter and BackdropFilter to CanvasKit backend #13768
Add ImageFilter and BackdropFilter to CanvasKit backend #13768
Conversation
// found in the LICENSE file. | ||
|
||
part of engine; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add comments to the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -1055,7 +1055,7 @@ class Paint { | |||
_paintData = _paintData.clone(); | |||
_frozen = false; | |||
} | |||
_paintData.color = value.runtimeType == Color ? value : Color(value.value); | |||
_paintData.color = value.runtimeType == Color ? value : Color(value.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was incorrectly indented before
skPaint.callMethod( | ||
'setImageFilter', <js.JsObject>[skImageFilter.skImageFilter]); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: does the order of method calls make a difference? If so may be we should document it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order doesn't matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Harry!
Only a few comments on documentation.
} | ||
|
||
double get sigmaX => throw UnimplementedError( | ||
'CanvasKit backend doesn\'t support ImageFilter.sigmaX'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have these in ui
. Can you please move them under src/engine
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -9,7 +9,7 @@ const bool experimentalUseSkia = | |||
bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false); | |||
|
|||
/// The URL to use when downloading the CanvasKit script and associated wasm. | |||
const String canvasKitBaseUrl = 'https://unpkg.com/canvaskit-wasm@0.7.0/bin/'; | |||
const String canvasKitBaseUrl = 'https://particles.skia.org/static/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this make our tests unstable? Maybe host our own copy on a firebase static site? This way we can control when to upload a new version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are currently no CanvasKit tests. We can worry about this when we enable testing for CanvasKit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, one more thing to add to our testing strategy :)
This shows how it looks with a Cupertino dialog (ignore ugly fonts):