2724 Commits

Author SHA1 Message Date
Greg Spencer
d19a6fab13
Track lock key down state instead of lock state (#20836)
This converts the GTK keyboard code to track the key down states of the lock modifiers NumLock and CapsLock so that they represent the actual "down" state of the key, rather than the lock state itself.

GTK tracks the lock state, and Flutter expects the down state.
2020-09-13 14:44:25 -07:00
Chris Bracken
08dabe9601
Clean up C++ includes (#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Emmanuel Garcia
2b30bec2db
Fix comment indentation (#21114) 2020-09-11 17:50:26 -07:00
Chris Bracken
16b900b63e
Prefer C++ standard headers to their C counterpart (#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Emmanuel Garcia
85a7afa913
Add a new raster status kSkipAndRetry frame (#21059) 2020-09-11 16:29:11 -07:00
Jason Simmons
22982407d4
Check for a valid SkSL cache directory before calling VisitFiles (#21118)
The directory may be invalid when running shell_unittests because
some tests call SetCacheDirectoryPath and then delete the directory.
Later tests that try to use that cache base path will be unable to
open the directory.
2020-09-11 16:23:25 -07:00
Chris Bracken
fd17e0846b
Fix linter errors in mock_engine (#21102)
Make a single-param ctor explicit in order to prevent surprising
implicit conversions.

Add a check for zero message-size and don't malloc/memcpy the incoming
message in those cases.

Add braces where they were missing.
2020-09-11 10:27:00 -07:00
Chris Bracken
36f7f3ca82
Copyright header hygiene improvements (#21089)
Add copyright headers in a few files where they were missing.

Trim trailing blank comment line where present, for consistency with
other engine code.

Use the standard libtxt copyright header in one file where it differed
(extra (C) and comma compared to other files in libtxt).

This also amends tools/const_finder/test/const_finder_test.dart to look
for a const an additional four lines down to account for the copyright
header added to the test fixture.
2020-09-11 08:55:37 -07:00
stuartmorgan
51d6502e13
Minor windows.h cleanup (#21082)
- Standardize on lowercase for windows.h
- Don't define NOMINMAX before including windows.h in (some) public
  wrapper headers, since it causes a warning when combined with setting
  NOMINMAX at the build level, which is the more robust way to avoid
  issues with min/max and windows.h
2020-09-10 21:11:07 -07:00
stuartmorgan
4eb069fe20
Remove deprecated methods from FlutterViewController (#21081)
The template now uses the FlutterEngine versions.
2020-09-10 21:10:28 -07:00
stuartmorgan
83cc9230c4
Clean up deprecated EncodableValue code (#20981)
Removes the older pointer-based versions of APIs taking EncodableValues for which there are now reference-based versions.
2020-09-10 21:08:52 -07:00
Damian Wrobel
e831433a20
Add missing <cstring> header (#21069)
Fixes the following compilation errors:

../../flutter/shell/platform/linux/fl_value.cc:267:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(uint8_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:284:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(int32_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:294:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(int64_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:304:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(double) * data_length);
  ^

../../flutter/shell/platform/linux/fl_string_codec.cc:29:28: error: use of undeclared identifier 'strlen'
  return g_bytes_new(text, strlen(text));
                           ^

../../flutter/shell/platform/linux/fl_standard_message_codec.cc:512:23: error: use of undeclared identifier 'strlen'
      size_t length = strlen(text);
                      ^

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2020-09-10 09:24:54 -07:00
Sebastian Roth
fee6f9e533
Annotate valuePublishedByPlugin with nullable (#19267) 2020-09-09 19:45:02 -07:00
David Worsham
a52397e05f
fuchsia: Compile disabled RasterThreadMerger code (#20984) 2020-09-09 18:40:01 -07:00
Alexander Brusher
cd580e2099
Adds increment/decrement actions to fuchsia accessibility bridge. (#21049) 2020-09-09 18:34:38 -07:00
stuartmorgan
b55829887e
Rename Registrar to PluginRegistrar in Win/GLFW C API (#21058) 2020-09-09 17:15:03 -07:00
kele86838437
ab0d4b43be
Update Androidx import (#19059) 2020-09-09 16:10:03 -07:00
chunhtai
2a12d78c17
Fixed ios layout change to not refocus semantics object if the focus … (#21029)
* Fixed ios layout change to not refocus semantics object if the focus is outside of flutter

* update

* addressing comments
2020-09-09 15:39:21 -07:00
chenjianguang
5271340b88
Fix usage of WeakPtr valid check (#20106) 2020-09-09 15:34:24 -07:00
Yuqian Li
00978035cd
Open a fresh dir during LoadSkSLs (#21050)
Fixes https://github.com/flutter/flutter/issues/65258

The following devicelab tests should pass after this patch:

- flutter_gallery_sksl_warmup__transition_perf_e2e_ios32
- flutter_gallery_sksl_warmup_ios32__transition_perf
2020-09-09 15:33:33 -07:00
linxuebin
564367b297
Increase thread priority before engine init (#20922)
We get huge ANRs in not pure flutter app.
We found that 0.15% of the engine initialization took more than 10 seconds, every 10 million starts.
2020-09-09 14:07:34 -07:00
Zachary Anderson
f7c7b41f0a
Revert "Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)" (#21043)
This reverts commit 575a51948d81756c778352b40f639fa557325fd7.
2020-09-09 09:25:17 -07:00
Chinmay Garde
f0fb74b8fb
Avoid crashing and display error if the process cannot be prepared for JIT mode Dart VM. (#20980) 2020-09-08 13:41:31 -07:00
xster
09a5bf7acf
Tweak the mdns error message (#20991) 2020-09-08 10:54:42 -07:00
Clement Skau
575a51948d
Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)
Lazy async stacks were already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

This change does the same with the engine defaults, which makes this be enabled
by-default in JIT mode as well.

See go/dart-10x-faster-async for more information.

This is a re-land: A fix for what we believe to have caused the last revert has landed upstream in Dart in dart-lang/sdk@0004589

[0] flutter/flutter@3478232
2020-09-07 10:55:48 +02:00
Gary Qian
242d522077
[Android R] Sync keyboard animation with view insets vs Android 11/R/API 30 WindowInsetsAnimation (#20843) 2020-09-04 02:06:30 -07:00
xster
b22a8c69d9
Let FlutterActivity/Fragment/FragmentActivity have an app bundle path override instead of eager resolving during construction (#20769) 2020-09-03 17:31:30 -07:00
Emmanuel Garcia
367c6dbd12
Don't use GetTaskQueueId() in rasterizer as it breaks Fuchsia (#20983) 2020-09-03 16:40:01 -07:00
Jim Graham
841401db8c
restore FML_DCHECK removed due to a code reviewing error (#20953) 2020-09-03 14:46:28 -07:00
Alexander Brusher
30b829e7ed
Populates fuchsia node actions in semantics updates. (#20451) 2020-09-03 14:38:36 -07:00
0xZero
ac8b9c4c52
Member variables should appear before the |WeakPtrFactory|. (#20899) 2020-09-03 14:34:01 -07:00
Guokai-Cheng
e284598d6d
Ensure the destructor is called since it destroys the EGLSurface before creating a new onscreen surface. (#20916) 2020-09-03 14:32:48 -07:00
Jason Simmons
d368b8763a
Log the results when ShellTest.Screenshot fails (#20932)
This test has been flaky on LUCI recently.

See https://github.com/flutter/flutter/issues/65026
2020-09-03 14:13:55 -07:00
gaaclarke
5047e5adbe
Started printing out error messages when the observatory won't be reachable because of permissions problems. (#20960) 2020-09-03 14:05:47 -07:00
LongCatIsLooong
9d6152ccc7
Fix iOS text field input keyboard flickering & crash (#20805) 2020-09-03 13:55:02 -07:00
Emmanuel Garcia
3f05b521b9
Always set the callback during Rasterizer setup (#20976) 2020-09-03 10:48:46 -07:00
Nathan Rogers
68b7b8401a
[fuchsia] Send trace events to system tracing on all configurations (#20974)
This change reverts https://github.com/flutter/engine/pull/15900.  The
design of the expected consumer of the original PR changed, and the
feature ended up going unused.  Since the unexpected difference in trace
event routing behavior has mostly ended up as a source of confusion,
change things back to route trace events to Fuchsia system tracing on
all configurations.
2020-09-03 10:21:36 -07:00
Emmanuel Garcia
efb339f300
Only clear GL context after changing the thread configuration (#20965) 2020-09-02 22:10:02 -07:00
Emmanuel Garcia
61e057aa59
Clear GL context before Gr context (#20957) 2020-09-02 15:08:16 -07:00
Dan Field
634e499bcc
Use hint freed specifically for image disposal (#20754)
* Use hint freed specifically for image disposal
2020-09-02 13:41:58 -07:00
Emmanuel Garcia
615e668014
Clear the GL context only after submitting the frame (#20931)
* Clear the GL context only after submitting the frame
* Fix Screenshot test
2020-09-02 08:46:11 -07:00
Gary Qian
15bf1bbf6f
[Android R] Integrate DisplayCutouts into viewportMetrics (#20921) 2020-09-02 05:18:35 -07:00
Yuqian Li
5585ed9903
Revert "Create root isolate asynchronously (#20142)" (#20937)
This reverts commit 95f2b72728ee7e51800f1784e458e45dac675b3a.
2020-09-01 22:05:53 -07:00
Jim Graham
96efe39272
Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (#20936)
This reverts commit 58a62076559585b167c89531dfb81092d744a552.
2020-09-01 21:21:07 -07:00
Emmanuel Garcia
49d6805324
Ensure all images are closed in FlutterImageView (#20842) 2020-09-01 16:57:45 -07:00
Alexander Brusher
58a6207655
Adds fuchsia node roles to accessibility bridge updates. (#20385) 2020-09-01 13:33:02 -07:00
chenjianguang
95f2b72728
Create root isolate asynchronously (#20142)
## Description
As the related issue refer, the application may be doing too much work on its main thread even in a simple hello_world demo.
That is because the creation of `Engine` on the ui thread takes a noticeable time, and it is blocking the platform thread in order to run `Shell::Setup` synchronously.
The cost of `Engine`'s constructor is mainly about the creating of root isolate. Actually, there used to be another time-consuming process, the default font manager setup, which was resolved by https://github.com/flutter/engine/pull/18225. 
Similar to https://github.com/flutter/engine/pull/18225, this pr move the creation of root isolate out from creating `Engine`. After this action, the main thread blocking is quite an acceptable slice.

## Related Issues
https://github.com/flutter/flutter/issues/40563 could be resolved by this pr.
2020-09-01 13:31:00 -07:00
stuartmorgan
80190580d5
Default C++ wrapper templates to EncodableValue (#20760)
The C++ wrapper makes heavy use of templates to support arbitrary types
in the platform channel classes, but in practice EncodableValue is what
essentially all code will use. This defaults those template types to
reduce boilerplate in plugin code (e.g., allowing the use of
MethodChannel<> instead of MethodChannel<EncodableValue>).
2020-09-01 10:56:46 -07:00
Jason Simmons
d67923feb1
Pass text input key events to the EventResponder if they do not yield characters (#20912)
If the InputConnectionAdaptor receives a key event that does not move
the caret or produce a text character (such as the back button), then
the event should be given to the EventResponder which will forward it
to the view.

Fixes https://github.com/flutter/flutter/issues/64864
2020-08-31 17:56:09 -07:00
Jason Simmons
1bd9b8e85b
Reset Shell::weak_factory_gpu_ on the raster thread (#20869) 2020-08-31 16:03:02 -07:00