The bitmap used to hold a prerolled image in the raster cache must have an
integer width/height in pixels. However, the picture used to draw the image
may have a non-integer width/height in physical coordinates and thus not
completely fill the bitmap. The compositor should only select the subset
of the bitmap that reflects the portion filled by the rendered picture.
Compute the necessary texture resolution using more accurate scaling
information provided by Mozart scene node metrics events instead of the
device pixel ratio provided by the Mozart view properties (which we
might remove in the future).
This allows us to allocate smaller textures when a Flutter view is
being scaled down.
Instead of flushing each canvas, flush once on the context from which each of the canvas is derived.
This gives us a significant performance increase on the fuchsia vulkan backend
* Revert "Revert "Reland "Run Flutter on iOS and Android with color correct Skia" (#3818)" (#3823)"
This reverts commit db8d8a9979901d05b011368226ad5bf61b1da13f.
* Fix test code to match internal API change
* Revert "Revert "Run Flutter on iOS and Android with color correct Skia (#3743)" (#3775)"
This reverts commit cfe70e07d386d6052267fe3772bbd641c8413a54.
* Enable sRGB on IO thread, too
* Add 4444 as a fallback rendering mode
* Use bare ptr to SkColorSpace (not sk_sp) in PrerollContext
* 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
* Fix pixel rounding error in the picture layer by first ensuring that
the texture for the image is at least as big as the next integer size
along each dimension and using kStrict_SrcRectConstraint while
drawing the same image. We already select the source subset by
looking at the cull rect of the picture.
* Decompose the transformation matrix into a series of operations that
generated the same to calculate the scale at which to rasterize the
picture. This make the rasterization scale resilient to
transformations that introduce a perspective component to the
resultant matrix.
* The scale in the decomposed matrix is now part of the key in the
cache.
* Raster cache images that could never be rasterized were still taking
part in the cache. Now, those entries are rejected early on. This
leads to the sweep after the frame iterating over fewer items.
* Added a unit test target.
***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
This version does not recycle buffers. It is meant only as an initial solution,
and the proper buffer recycling logic has been broken out into a separate change
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.
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.
When we pipelined the drawing commands we caused UpdateScene to be called
before Preroll, which isn't allowed. Now we call Preroll, UpdateScene, and
Paint separately.