460 Commits

Author SHA1 Message Date
Jason Simmons
59c2536d34 Set a pending dimension change in the animator only if the viewport's physical width/height changed (flutter/engine#4400)
Fixes https://github.com/flutter/flutter/issues/13183
2017-11-29 10:55:45 -08:00
ethanblake4
955b41aaba Fix: use firstRequestedOrientation in fallthrough case (flutter/engine#4392) 2017-11-27 00:09:56 -08:00
Sigurd Meldgaard
2338eae934 Move texture registry to platform view (flutter/engine#4388)
* Move texture registry ownership to platform view

This enables the texture registry to survive activity pause on Android.

* Remove debug info

* Formatted

* Set texture registry on initial rasterizer

* Remove unneccessary std::move
2017-11-22 14:39:03 +01:00
Sigurd Meldgaard
f3bf571559 Revert "Move texture registry ownership to platform view (#4348)" (flutter/engine#4387)
This reverts commit 2c2ddf97d3bc0b385a4f2e38e6a52066efbe4f25.
2017-11-22 14:12:25 +01:00
Sigurd Meldgaard
2c2ddf97d3 Move texture registry ownership to platform view (flutter/engine#4348)
* Move texture registry ownership to platform view

This enables the texture registry to survive activity pause on Android.
2017-11-22 09:55:45 +01:00
Martin Kustermann
9f29a0f744 Enable flutter engine to also work with .*so files on android (flutter/engine#4298)
* Enable flutter engine to also work with .*so files on android

We would like to be able to use native tools (e.g. simpleperf, gdb) with
precompiled flutter apps.  The native tools work much better with *.so
files instead of the custom formats the Dart VM uses by default.

This CL adds support for being able to load the flutter app from an *.so
file on Android.

* Add sanity check to ensure we have either shared library or instruction snapshot (but not both)
2017-11-21 13:14:50 +01:00
Chris Bracken
dc4ecd943b Use iOS scale when computing render buffer size (#4171) (flutter/engine#4373)
When checking whether render buffer size has changed, apply the device
scale factor used to convert points to pixels to ensure we're not
needlessly re-allocating render buffer storage.

Adds trace + debug log to make this easier to detect in future.

Originally introduced in 72c28f3a01bd9e6bed256edc4629705d96a7cead, but
rolled back in d539abd7c5fe5291bab81b32e6e5697c1b6681b6 to test whether
it was responsible for regressions to
flutter_gallery_ios__transition_perf benchmarks:
  * average_frame_build_time_millis
  * missed_frame_build_budget_count

Re-landed in 1a7ca91e3938abd5720b3553dfb2045a6b805a3b, and reverted in
79b9bdbbf4d3193620be35e3ea3e1a162b553627 after it appeared to regress
the above two benchmarks. After recent changes to microtask execution
order which fixed https://github.com/flutter/flutter/issues/9998,
re-introducing this fix results in benchmark improvements to the above
two benchmarks in local testing.
2017-11-20 14:15:26 -08:00
Sigurd Meldgaard
75ba5f9a2e Avoid double retain of Texture on ios. (flutter/engine#4354)
The "raw" pointer is already managed by ARC.
2017-11-17 13:49:57 +01:00
Jason Simmons
d396b92cc8 Removed unused declaration of Animator::RequestDrawOnVSync (flutter/engine#4367) 2017-11-15 17:44:46 -08:00
Brian Osman
1d2ad93157 Prevent Skia from trying to use stencil buffers (flutter/engine#4362)
Fixes flutter/flutter#13018

When linear blending was disabled, we started rendering directly to FBO0 again. We can't attach stencil there, and the profile graph code triggers a path that (by default) uses it. This option forces us to use alternate rendering methods.

Note that the graph rendering code is constructing a fairly complex path. It would probably be much faster to render as a simpler series of drawRect calls for each box (which would get batched inside Skia).
2017-11-15 13:10:56 -05:00
Chinmay Garde
90988d60e1 Allow embedders to respond to platform messages from the Dart application. (flutter/engine#4361)
This updated the native embedder API in a non-ABI breaking way.
2017-11-14 15:51:19 -08:00
Brian Osman
59fc5fe74f Disable linear blending, use SkColorSpaceXformCanvas instead (flutter/engine#4355)
This retains gamut correction (adjusting colors for screens with different capabilities), but does all blending and interpolation with sRGB-encoded values. That matches the behavior expected by most users, as well as the behavior of nearly all other systems. It also greatly simplifies the EGL code.

A future Skia change will make this behavior more of a first-class citizen, so some of these implementation details will change again, but the behavior will not. The bulk of this change (elimination of complication from the GL surface code) is permanent - it's just the SkColorSpaceXformCanvas that will be replaced.
2017-11-14 13:33:26 -05:00
Zachary Anderson
cfef71d946 [Android] Cleanup in FlutterActivityDelegate (flutter/engine#4357) 2017-11-13 14:13:04 -08:00
Zachary Anderson
69f6500182 View destroy listener (flutter/engine#4347)
[Android] Allow persisting a FlutterNativeView across activities.
2017-11-13 13:56:48 -08:00
Jason Simmons
63b797fd55 Delete the native view when destroying the FlutterView (flutter/engine#4356)
Fixes https://github.com/flutter/flutter/issues/12996
2017-11-13 13:16:48 -08:00
Mikkel Nygaard Ravn
025a7673b2 Align iOS event channel semantics to Android counterpart (flutter/engine#4353) 2017-11-13 15:34:29 +01:00
Mikkel Nygaard Ravn
0f1c5d268d Make EventChannel survive hot restart on Android (flutter/engine#4350) 2017-11-13 07:47:36 +01:00
Jason Simmons
1503dd45a8 Log stack traces from exceptions thrown by calls from native into Java (flutter/engine#4346) 2017-11-09 13:04:12 -08:00
Zachary Anderson
9809d5f8e7 [Android] Pulls the native platform view out of FlutterView (flutter/engine#4338) 2017-11-09 12:10:00 -08:00
Jason Simmons
d519c2cbf2 Allow rendering of frames in a paused animator during a change to screen dimensions (flutter/engine#4333)
Fixes https://github.com/flutter/flutter/issues/12886
2017-11-09 10:04:51 -08:00
Chris Bracken
6f144d0bde Revert "Roll Fuchsia buildtools to 85907c59e97527d79bbfdfd849d8e85c24959cc5 (#4331)" (flutter/engine#4340)
With the update to HEAD of the Fuchsia buildtools repo, the new clang
toolchain picked up caused link-time breakage in android x86_64
libFlutter.so builds.

Sample log:
https://build.chromium.org/p/client.flutter/builders/Linux%20Engine/builds/1974/steps/build%20android_debug_x64/logs/stdio

Sample failure:
FAILED: libflutter.so libflutter.so.TOC lib.stripped/libflutter.so
../../third_party/android_tools/ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld.gold: error: obj/flutter/shell/platform/android/libflutter/android_context_gl.o: unsupported reloc 42 against global symbol std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id

This reverts commit fecc7aa281821e01037089846744b5331e3cbd22.
2017-11-08 16:48:00 -08:00
Chris Bracken
fecc7aa281 Roll Fuchsia buildtools to 85907c59e97527d79bbfdfd849d8e85c24959cc5 (flutter/engine#4331)
* Roll Fuchsia buildtools to 85907c59e97527d79bbfdfd849d8e85c24959cc5

This also updates Flutter buildroot to a6e52dbb776c45cc8c57d7143b8eb8b2e762fdfb
which disables -Wtautological-constant-compare temporarily until
https://reviews.llvm.org/D39462 lands in clang. This is in line with
Fuchsia's compiler options.

* Apply clang-format diffs

No logical changes. This applies clang-format from the latest Fuchsia
buildtools to the engine codebase.
2017-11-08 11:18:17 -08:00
Chris Bracken
5ef7ef761f Respond to safe area inset changes (flutter/engine#4330)
On iOS 11 and above, update viewport padding and notify the framework
when changes to safe area insets occur.
2017-11-07 18:26:59 -08:00
Chris Bracken
f3291e79e4 Temporaribly disable bottom safe area padding on iOS (flutter/engine#4322)
There are two different sets of view insets that applications may want
to track in order to avoid unwanted interaction with system UI:

1. OS UI that effectively shrinks the Flutter view from a UX point of
   view: e.g., when the keyboard opens, it occludes the bottom of the
   screen and the view should be adjusted such that the bottom, for the
   purposes of scrolling is just above the keyboard.
2. OS UI that is overlaid over the application, but into which the
   application should draw. e.g., the Home indicator on the iPhone X
   typically appears near the bottom of the screen, overlaid over app
   content. Content should be rendered within this 'safe area' but apps
   should avoid requiring user interaction there. For example, list
   views may want to include some small amount of additional padding to
   ensure the last list item can scroll above this area.

Since Flutter does not currently distinguish between these two cases,
this patch disables the bottom safe area inset until API is added to
support these separately.
2017-11-03 14:20:46 -07:00
Ian Hickson
55fb84e01b Support multiple values in SystemChrome.setPreferredOrientations (flutter/engine#4320) 2017-11-03 10:28:31 -07:00
Chris Bracken
5c6abf1dbb Correct behaviour for rangeForCharacterAtIndex (flutter/engine#4319)
Previously it always fell through to a zero-length character range at
the specified position.
2017-11-02 15:16:06 -07:00
xster
088fd801f3 Make the text selection code more defensive (flutter/engine#4291)
* Make the text selection code more defensive

* format

* Move validation to a method

* Fix math

* rename
2017-11-02 03:36:52 -07:00
Chinmay Garde
d0ec6228a5 Add texture support (eg video, camera) (flutter/engine#4159) 2017-11-02 10:57:29 +01:00
Michael Goderbauer
dcec1fed2c Identify text fields as such to a11y on Android (flutter/engine#4299)
* Identify text fields as such to a11y on Android

* Add focus flag
2017-11-01 12:59:03 -07:00
Zachary Anderson
7e6e6f48db [ios] Adds an API for running Dart code without a PlatformViewIOS (flutter/engine#4294) 2017-11-01 12:16:51 -07:00
P.Y. Laligand
c0f56ceaa4 Refer to Flutter's base via the build argument. (flutter/engine#4305)
This fixes the Fuchsia build.
2017-10-31 17:28:35 -07:00
Chris Bracken
1f58a96098 Use safe area padding on hide keyboard on iOS (flutter/engine#4304)
On hide keyboard, reset the bottom padding to the safe area inset on
devices running iOS 11 or higher.
2017-10-31 17:17:38 -07:00
Chinmay Garde
0ac48e7bd8 Add fml::WeakPtr and update users in Shell. (flutter/engine#4296) 2017-10-31 16:55:36 -07:00
Chinmay Garde
34624184ee Ensure that public framework headers can be cleanly imported from outside the engine root. (flutter/engine#4303) 2017-10-31 16:25:02 -07:00
Chris Bracken
285c6840ab Support iPhone X safe area insets (flutter/engine#4302)
This change exposes the view safe area insets (introduced in iOS 11) to
the framework via MediaQuery.of(context).padding. Safe area insets are
the view insets (padding) inside of which content can be relied on to
display without truncation/clipping, as would occur with e.g. the iPhone
X sensor notch.

As this API was added in iOS 11, we place it behind a runtime guard
checking OS level.

Until the runtime support for @avialable lands in the next Fuchsia
buildtools rev, ignore -Wunguarded-availability-new around the safe area
insets check and use an FML runtime check instead.
2017-10-31 14:30:07 -07:00
Michael Goderbauer
3a386bd49e Android SeekBars announce their value (flutter/engine#4289)
* Android SeekBars announce their value

* style
2017-10-31 10:03:30 -07:00
Chinmay Garde
a55c58db9a Test that the embedder can be launched and shut down correctly. (flutter/engine#4281) 2017-10-30 14:15:32 -07:00
Chinmay Garde
b94a941d3a Fix iOS build to account for Shell rasterizer registration updates. (flutter/engine#4295) 2017-10-30 13:54:41 -07:00
Chinmay Garde
3dd5e0aceb Avoid registering both the platform view and the rasterizer in the shell. (flutter/engine#4293)
Instead, the rasterizer can be accessed via the platform view.
2017-10-30 13:28:39 -07:00
Chinmay Garde
a9721eb9d8 Allow embedders to specify custom ICU data paths and command line args. (flutter/engine#4290) 2017-10-27 17:31:13 -07:00
Jason Simmons
f9ccc371b9 Remove the diagnostic server (includes Dart roll) (flutter/engine#4287) 2017-10-27 11:53:00 -07:00
Alexander Aprelev
826b91ceae Fix regression - configure asset bundle (flutter/engine#4285)
* Fix regression - configure asset bundle

* Fix formatting
2017-10-26 14:54:03 -07:00
Jason Simmons
ea0e620ea1 Add an SkPicture screenshot handler to the service protocol (flutter/engine#4284)
This will replace the one in the diagnostic server
2017-10-26 14:35:26 -07:00
Michael Goderbauer
49200487c9 Announce the correct new value after increase/decrease has been performed on iOS (flutter/engine#4282) 2017-10-25 16:02:43 -07:00
Michael Goderbauer
77dd7b4f76 Only post UIAccessibilityLayoutChangedNotification if layout changed (flutter/engine#4279)
* Only post UIAccessibilityLayoutChangedNotification if layout actually changed

* ++

* review comment
2017-10-25 14:07:41 -07:00
Chinmay Garde
8ed91439b5 Add a unittest stub for the embedder. (flutter/engine#4276) 2017-10-25 13:09:59 -07:00
Michael Goderbauer
b605573b1f Revert "Move channel and codec related files to common (#4262)" (flutter/engine#4277)
This reverts commit ee5504cfcd6151310bb5f829c15de05e953baf29.
2017-10-25 13:01:24 -07:00
P.Y. Laligand
8fa077d254 Fix build file typo. (flutter/engine#4275) 2017-10-25 10:54:03 -07:00
krisgiesing
ee5504cfcd Move channel and codec related files to common (flutter/engine#4262)
Refactoring related to use of the embedder APIs on macOS
host builds.
2017-10-24 20:36:18 -07:00
Alexander Aprelev
2fa0c790d1 Initialize service isolate from kernel file, rather than from embedded sources. (flutter/engine#4263)
* Read core platform kernel file during Dart initialization.

Currently service isolate is initialized from the source code parsed by VM.
This CL changes it so service isolate created during Dart initialization
is created from the kernel platform.dill file if it is present in the application
bundle. Then this platform kernel file is kept in dart_init module and reused
for application sciprt isolates.

* Reformat and merge

* Use accessor method

* Avoid passing running_from_kernel param. Add TODO for cleanup. Rename param.
2017-10-24 19:37:24 -07:00