36 Commits

Author SHA1 Message Date
Brian Osman
0a7155d4e1
Disable linear blending, use SkColorSpaceXformCanvas instead (#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
mikejurka
0e8331aa1a
Fix low-res rasterized images on Fuchsia. (#4325)
Plumb through Scenic display metrics to use during
Preroll.
2017-11-08 14:59:54 -08:00
Michael Goderbauer
08961f8ec5 Format all c-like sources with clang-format (#4088)
* format

* license script adaptions

* updated licenses

* review comments
2017-09-12 15:36:20 -07:00
George Kulakowski
3aa7522c11 Rename ftl to fxl in Fuchsia specific code (#4090) 2017-09-11 15:58:48 -07:00
Jason Simmons
a7ae2abb59 Capture fractional pixel coordinates in the bounds of raster cache bitmaps (#3974)
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.
2017-08-10 14:08:16 -07:00
Chinmay Garde
1de56a33d2 On emulators, render onscreen (with warnings) if any of the MakeS32 based SkSurface creation calls fail. (#3947) 2017-08-02 14:29:29 -07:00
Brian Osman
de00757ddb Revert "Revert "Reland "Run Flutter on iOS and Android with color correct Skia (#3826)" (#3878)" (#3895)
This reverts commit 1db18a40da855b102e391cb11189e73f9c2ec40d.
2017-07-18 15:58:35 -04:00
Benjamin Lerman
ad7f258bfc Fix usage of std::labs (#3891) 2017-07-18 09:54:24 -04:00
Chinmay Garde
015e8cf521 Ensure that the source rect used for the the raster cache replacement is the same as the size of the N32Premul surface. (#3889)
Also adds debug printers for SkRect and SkPoint.
2017-07-17 23:42:40 -07:00
Collin Jackson
1db18a40da Revert "Reland "Run Flutter on iOS and Android with color correct Skia (#3826)" (#3878)
This reverts commit 2d9155e174d83e9646c951dbbc85fe1eda8b20e9.

Fixes a regression with semitransparent images (flutter/flutter#11169)
2017-07-13 14:22:25 -07:00
Brian Osman
2d9155e174 Reland "Run Flutter on iOS and Android with color correct Skia (#3826)
* 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
2017-06-27 13:30:10 -04:00
Brian Osman
db8d8a9979 Revert "Reland "Run Flutter on iOS and Android with color correct Skia" (#3818)" (#3823)
This reverts commit 2650f529a138de9cc9116bb9194dbe22f8e0df25.
2017-06-23 20:28:24 -04:00
Brian Osman
2650f529a1 Reland "Run Flutter on iOS and Android with color correct Skia" (#3818)
* 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
2017-06-23 20:21:29 -04:00
Michael Goderbauer
cfe70e07d3 Revert "Run Flutter on iOS and Android with color correct Skia (#3743)" (#3775)
This reverts commit ffe8181ffe7432b61a67323c80fd8025704e4695.
2017-06-14 16:26:20 -07:00
mattsarett
ffe8181ffe Run Flutter on iOS and Android with color correct Skia (#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
1c6a531e89 Rework raster cache to fix numerous issues. (#3717)
* 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.
2017-06-05 15:57:05 -07:00
Chinmay Garde
70b71a49ea Revert "Run Flutter on iOS and Android with color correct Skia" (#3738) 2017-06-05 14:08:22 -07:00
mattsarett
fe82757603 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-05 14:59:04 -04:00
Jason Simmons
df5f62f236 Add a flag that checkerboards offscreen render targets created by SkCanvas.saveLayer (#3685)
Fixes https://github.com/flutter/flutter/issues/9473
2017-05-11 15:00:16 -07:00
Chinmay Garde
1c07ea530f Remove uses of //base from all //flutter projects and replace them with //fml variants. (#3492) 2017-03-22 15:42:51 -07:00
Chinmay Garde
e1ac3ca650 Randomize the color of the checkerboard pattern per raster cache entry. (#3218) 2016-11-10 18:21:12 -08:00
Chinmay Garde
84a060820a Tell the raster cache when checkerboarding preferences have been updated. (#3205) 2016-11-07 15:29:03 -08:00
Chinmay Garde
3164a97645 Allow checkerboarding raster cache entries for debugging purposes (can be toggled from Dart). (#3200) 2016-11-03 13:59:57 -07:00
Adam Barth
9c09565712 Update paths to account for buildroot 2016-08-09 13:52:15 -07:00
Adam Barth
fcc642e42b Finish removing //base dependency from //flow (#2848)
This patch introduces a //glue library that isolates our dependency on //base.
This will let us clean up our //base dependencies ahead of actually being able
to fully remove them.
2016-08-01 16:27:48 -07:00
Adam Barth
d6476a65c3 Port //flow to //lib/ftl (#2847)
This patch removes almost all //base dependency of //flow. The only dependency
left is on tracing.
2016-08-01 15:11:56 -07:00
Adam Barth
9eb5df4146 Add a way to hint the compositor (#2816)
The code that draws the picture knows more about the picture (and the future)
than we do. This patch gives them a way to hint us about what's going to
happen with the picture in the future.
2016-07-22 11:07:14 -07:00
Adam Barth
a126207c6e Update Skia (#2704) 2016-05-23 13:48:18 -07:00
Adam Barth
625e937442 Update Skia (#2626) 2016-04-27 14:59:06 -07:00
Adam Barth
b9ff394182 Break dependency from Layer to PaintContext (#2609)
Instead, make Layer::Paint take a new PaintContext that has just exactly
the state that it needs, mirroring PrerollContext. Also, rename
PaintContext to CompositorContext because it holds the context for the
whole compositor.
2016-04-21 23:05:41 -07:00
Adam Barth
e301cef648 Update Skia
This required a bunch of changes because of the new sk_sp type Skia has
introduced into their API.
2016-03-21 14:59:49 -07:00
Jason Simmons
052d65cc14 Clear the Flow raster cache when a GrContext is destroyed
After an application is suspended and the GrContext associated with the
Flutter view is destroyed, the raster cache still contains images tied
to the defunct context.  The SkyShell process will crash if these images
are used after the application resumes.
2016-02-01 10:36:09 -08:00
Adam Barth
ac83043173 Fix order of matrix operations
When rasterzing with a non-zero left and top offset, we need to apply the scale
first so that we're translating in the correct coordinate system.

Fixes https://github.com/flutter/flutter/issues/1292
2016-01-19 09:57:26 -08:00
Adam Barth
97e13a5763 Fix typo in image raster offset
We shouldn't plumb the "right" value into the y coordinate.
2016-01-14 09:29:34 -08:00
Adam Barth
17ed699397 Stocks FAB "+" sometimes teleports to near the top left
The matrix argument to drawPicture doesn't seem to do what we want exactly.
Instead, use the normal matrix in the canvas. Also, handle cull rects with
non-zero left and top coordinates.

Fixes #1229
2016-01-13 12:31:03 -08:00
Adam Barth
0b629d419f Move //sky/compositor to //flow
Now that the compositor doesn't have any tricky deps, we can make it a
top-level project, which saves a bunch of typing.
2016-01-12 22:39:51 -08:00