54 Commits

Author SHA1 Message Date
Brian Salomon
2bd16b8a3b VulkanSurface and GPUSurfaceGL no longer use GrPixelConfig (flutter/engine#4814)
* VulkanSurface and GPUSurfaceGL no longer use GrPixelConfig

* fix 565

* fix gpu_surface_gl changes
2018-03-21 14:13:05 -07:00
Brian Osman
6d0f9bb2b3 On iOS, render to an offscreen surface to avoid renderbuffer slowdown (flutter/engine#4680)
* On iOS, render to an offscreen surface to avoid renderbuffer slowdown

Fixes https://github.com/flutter/flutter/issues/14565

* null out old offscreen surface
2018-02-14 16:17:35 -05:00
Brian Salomon
53b3c06c97 Modernize GrContext creation (flutter/engine#4640) 2018-02-06 13:45:31 -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
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
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
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
Chinmay Garde
d0ec6228a5 Add texture support (eg video, camera) (flutter/engine#4159) 2017-11-02 10:57:29 +01: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
Chinmay Garde
0ac48e7bd8 Add fml::WeakPtr and update users in Shell. (flutter/engine#4296) 2017-10-31 16:55:36 -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
P.Y. Laligand
235f07742a Allow the project to be mapped to a location other than //flutter. (flutter/engine#4203)
This is for Fuchsia where we would like it to be located at //third_party/flutter.
2017-10-13 17:00:58 -07:00
George Kulakowski
b2b9a646ca Fix remaining ftl->fxl conversions (flutter/engine#4091)
* Fix remaining ftl->fxl conversions

The previous scripting pass at this did not account for objective c file endings

* Update tonic DEPS reference to the post-fxl version
2017-09-11 16:31:18 -07:00
George Kulakowski
fa539e618e Rename ftl to fxl in Fuchsia specific code (flutter/engine#4090) 2017-09-11 15:58:48 -07:00
Adam Barth
2cf3cffd3f Add //garnet (flutter/engine#4043)
This repository contains FTL now in the Fuchsia build.
2017-08-31 16:47:13 -07:00
Carlo Bernaschina
e2b8d9e76b Avoid race condition into NotifyNextFrameOnce (flutter/engine#3980)
If GPURasterizer::NotifyNextFrameOnce was rapidly invoked twice could
have lead to a null pointer exception.

Also ftp::WeakPtr are not thread safe and should not be dereferenced
from other threads.
2017-08-15 14:35:16 -07:00
xster
d85d4cc9ce Create platform API for first frame callback. Use for defer hiding splash screens on Android and iOS (flutter/engine#3956)
* Add back launch screen view until first frame on iOS

* improvements

* Move callback plumbing from ios surfaces to the gpu rasterizer. Didn’t wire java JNI yet.

* Android JNI

* Fix ios reference count and let android engine manage a view on top with launch screen

* Hook up Android activity and view

* review notes

* review notes

* Move thread switching upstream. Use weak references for callbacks.

* Some clean up
2017-08-14 15:44:52 -07:00
Chinmay Garde
e94546d547 On emulators, render onscreen (with warnings) if any of the MakeS32 based SkSurface creation calls fail. (flutter/engine#3947) 2017-08-02 14:29:29 -07:00
Jason Simmons
e5fed53de7 fix sRGB typo (flutter/engine#3942) 2017-07-31 17:12:45 -07:00
Chinmay Garde
6d71aee780 Update buildroot to account for stricter warning flags. (flutter/engine#3939) 2017-07-31 16:22:15 -07:00
Chinmay Garde
a8b230ae6c Update the Vulkan backend to account for GPUSurface API updates. (flutter/engine#3933) 2017-07-28 18:25:13 -07:00
Chinmay Garde
7314a7e0bc When the surface does not support SRGB, render to an offscreen texture. (flutter/engine#3930) 2017-07-28 12:48:32 -07:00
Brian Osman
1a126078de Revert "Revert "Reland "Run Flutter on iOS and Android with color correct Skia (#3826)" (#3878)" (flutter/engine#3895)
This reverts commit 849b700434fdcd3fc24f05640582b127654aa7d8.
2017-07-18 15:58:35 -04:00
Collin Jackson
849b700434 Revert "Reland "Run Flutter on iOS and Android with color correct Skia (#3826)" (flutter/engine#3878)
This reverts commit 3cfb2821b9aa7f288d6aedd9f90c51b11bf451ad.

Fixes a regression with semitransparent images (flutter/flutter#11169)
2017-07-13 14:22:25 -07:00
Brian Osman
3cfb2821b9 Reland "Run Flutter on iOS and Android with color correct Skia (flutter/engine#3826)
* Revert "Revert "Reland "Run Flutter on iOS and Android with color correct Skia" (#3818)" (#3823)"

This reverts commit fdaab5c38fa82de669347508817b377285733946.

* Fix test code to match internal API change
2017-06-27 13:30:10 -04:00
Brian Osman
fdaab5c38f Revert "Reland "Run Flutter on iOS and Android with color correct Skia" (#3818)" (flutter/engine#3823)
This reverts commit cadd2d3fca1103ea0cbfb9f23dbc54907acac759.
2017-06-23 20:28:24 -04:00
Brian Osman
cadd2d3fca Reland "Run Flutter on iOS and Android with color correct Skia" (flutter/engine#3818)
* Revert "Revert "Run Flutter on iOS and Android with color correct Skia (#3743)" (#3775)"

This reverts commit c49f348d7c4238d653e7f3bbb8ce7cfab0996ad1.

* Enable sRGB on IO thread, too

* Add 4444 as a fallback rendering mode

* Use bare ptr to SkColorSpace (not sk_sp) in PrerollContext
2017-06-23 20:21:29 -04:00
Michael Goderbauer
c49f348d7c Revert "Run Flutter on iOS and Android with color correct Skia (#3743)" (flutter/engine#3775)
This reverts commit bac6502d62a3ab3157147b3d53776c3f16000a31.
2017-06-14 16:26:20 -07:00
mattsarett
bac6502d62 Run Flutter on iOS and Android with color correct Skia (flutter/engine#3743)
* Run Flutter on iOS and Android with color correct Skia (#3716)

***Turns on color correct rendering for Android and iOS
***Communicates dst color space to raster cache
***Turns on color space aware image decoding

Test:
***color_testing_demo on Pixel XL
***flutter_gallery on iPad Mini and iPad Pro (haven't figured out how to run manual_tests on iOS)

TODO:
I needed to split up this CL somewhere. These are follow-up tasks.
***Make desktop backends color correct
***Make debugging tools (ex: encoding frames to png) preserve color space
***Investigate using UIKit API to allow iOS to fine tune color space of rendered content
2017-06-09 08:39:21 -04:00
Chinmay Garde
e61bff016b Revert "Run Flutter on iOS and Android with color correct Skia" (flutter/engine#3738) 2017-06-05 14:08:22 -07:00
mattsarett
73f8e1988e Run Flutter on iOS and Android with color correct Skia (flutter/engine#3716)
***Turns on color correct rendering for Android and iOS
***Communicates dst color space to raster cache
***Turns on color space aware image decoding

Test:
***color_testing_demo on Pixel XL
***flutter_gallery on iPad Mini and iPad Pro (haven't figured out how to run manual_tests on iOS)

TODO:
I needed to split up this CL somewhere. These are follow-up tasks.
***Make desktop backends color correct
***Make debugging tools (ex: encoding frames to png) preserve color space
***Investigate using UIKit API to allow iOS to fine tune color space of rendered content
2017-06-05 14:59:04 -04:00
Florin Malita
f96707733a Add missing Skia includes (flutter/engine#3642)
We are removing some indirect includes from SkCanvas.h.

Updating clients to pull required headers explicitly.
2017-05-02 10:17:11 -07:00
Chinmay Garde
18bfdff87e Fix Android Vulkan build. (flutter/engine#3606) 2017-04-18 16:26:37 -07:00
Chinmay Garde
97af2def3e Add support for scaling the GPUSurfaceSoftware. (flutter/engine#3600) 2017-04-17 14:07:22 -07:00
Chinmay Garde
6ff5a41327 Remove uses of //base from all //flutter projects and replace them with //fml variants. (flutter/engine#3492) 2017-03-22 15:42:51 -07:00
Chinmay Garde
53b2940c6d Remove rarely used GLConnection stuff in flow. (flutter/engine#3440)
I had added this initially as a means of making it easier to deal with OpenGL directly in Flow. However, we are moving away from dealing with the client rendering APIs directly. Instead, delegating everything to Skia. Besides, we only ever used this to log the GPU description in case of context setup failures. This has not proved to be useful so far. Also, having this in place is making it difficult to remove all dependencies on GL in Shell.
2017-02-23 16:02:53 -08:00
Chinmay Garde
0110abf008 Allow plugging in a software backend for rendering in the shell. (flutter/engine#3404) 2017-02-22 15:40:23 -08:00
Chinmay Garde
eaf7f58f19 Bump up limits on the GrResourceCache used for the main GrContext. (flutter/engine#3394) 2017-02-07 16:04:06 -08:00
Chinmay Garde
26fe5e1b12 Add a Vulkan backend for Fuchsia and Android. (flutter/engine#3282) 2017-01-20 14:37:10 -08:00
Jason Simmons
e5a2958d0a Clear the GPU thread's EGL context only after the GPUSurfaceGL has been destroyed (flutter/engine#3346)
The GPUSurfaceGL holds references to Skia objects that may own GL objects.
If the GL objects are destructed on the GPU thread after the EGL context has been
dropped, then the GL delete calls will not take effect.
2017-01-18 17:19:50 -08:00
Chinmay Garde
63fbe60fa6 Display resident memory statistics on the performance overlay. (flutter/engine#3314) 2017-01-03 12:27:30 -08:00
Jason Simmons
49424e1b4f Detach the EGL surface from the GPU thread and then destroy it during the FlutterView surfaceDestroyed callback (flutter/engine#3316)
Fixes https://github.com/flutter/flutter/issues/7147
2016-12-16 15:36:33 -08:00
Chinmay Garde
1c25907547 Update Skia revision to pull in GL native interface construction fixes on iOS. (flutter/engine#3265)
* Update Skia revision to pull in GL native interface construction fixes on iOS.

Fixed in https://skia-review.googlesource.com/c/5212/

* Use the new image encoder API from Skia.
2016-11-23 13:36:14 -08:00
Adam Barth
6e603372ba Composite child views in proper paint order (flutter/engine#3243)
We push a bit up the tree during preroll to learn whether there system
composited layers below each layer. During update scene, we squash down
to paint tasks, which we execute after publishing the new scene.
2016-11-18 12:54:54 -08:00
Chinmay Garde
5730cf9d82 Update Skia and get using its BUILD.gn instead of maintaining own own copy. (flutter/engine#3233) 2016-11-17 12:36:16 -08:00
Adam Barth
414e5bcd60 Remove last mojom interface (flutter/engine#3184)
We no longer use mojom to transport messages. We still use the Mojo EDK
to spin the event loop, however.
2016-10-28 11:46:57 -07:00
Jason Simmons
e4c161f028 Do not attach and detach the EGL context on each frame in the rasterizer thread (flutter/engine#3110) 2016-10-11 11:14:07 -07:00