104 Commits

Author SHA1 Message Date
Jim Graham 929b1edff5 Engine support for ImageFiltered widget (#14491)
web_ui support coming in https://github.com/flutter/flutter/issues/47163
2019-12-19 16:47:08 -08:00
Lau Ching Jun c327cae7ab Revert "Fix off-by-one fromRGBO alpha value calculation (#13777)" (#14548)
This reverts commit 9f2daad648.
2019-12-18 00:22:50 -08:00
Tomás Arias 9f2daad648 Fix off-by-one fromRGBO alpha value calculation (#13777)
Constructing colors using `fromRGBO` should return the same values as the CSS
`rgba()` notation.  rgba(0, 0, 255, 0.5) is the same as `#0000ff80`

However `fromRGBO` sometimes creates a color with an off-by-one alpha value:

    expect(Color.fromRGBO(0, 0, 255, 0.5), Color(0x800000ff));

Expected: Color:<Color(0x800000ff)>
  Actual: Color:<Color(0x7f0000ff)>

If we use `withOpacity` to create the same color, it returns the correct color:

    expect(Color.fromRGBO(0, 0, 255, 1).withOpacity(0.5), Color(0x800000ff));

This should also be changed in lib/web_ui/lib/src/ui/painting.dart in a
followup change.
2019-12-17 09:34:30 -08:00
Dwayne Slater 80d80ff6e6 Add ability to control dithering on Paint (#13868) 2019-12-11 14:53:50 -08:00
Jim Graham ffcd8564a2 Imagefilter wrapper object (#13711)
Make ImageFilter objects comparable and printable.

This will help in areas in the Widget and RenderObject trees which try to avoid marking objects for updates if a setter is called with the same value (previously all ImageFilter objects would compare as not equal and appear to be new values).
2019-11-19 13:43:06 -08:00
Greg Spencer f7e73b6236 Move TextRange from the framework to dart:ui. (#13747)
This removes TextRange from the framework and moves it to the engine, in preparation for using it to return text ranges from the text extent APIs, like Paragraph.getWordBoundary instead of a List<int>.

Also added new tests for TextRange.
2019-11-08 12:21:46 -08:00
Dan Field 6bd0ef3dfe dart analysis of tests, cleanup (#13033) 2019-10-09 15:13:29 -07:00
Greg Spencer 77252d2371 Add missing focusable testing info (#13013)
This adds a couple of instances of semantic node isFocusable info that were missing that the framework testing depends upon.
2019-10-09 09:00:24 -07:00
gaaclarke f407e06970 Resize channel buffers (#12402)
Made it so you can resize channel buffers by sending messages to them.
2019-10-01 10:31:25 -07:00
Gary Qian 0018135a1c Make kDoNotResizeDimension public so framework can use it directly (#12448) 2019-09-26 17:07:16 -04:00
gaaclarke 0a455a8207 Channel buffers (#12167)
Added channel buffers to 'ui' so that messages have a place to
go until message handling is setup.
2019-09-17 12:22:00 -07:00
liyuqian 4243324a03 Revert "Add a BroadcastStream to FrameTiming (#11041)" (#11841)
This reverts commit e97ed36e58.

Reason for revert: Stream is considered a bad API: https://github.com/flutter/engine/pull/11041#issuecomment-526892247
2019-09-05 10:41:55 -07:00
liyuqian e97ed36e58 Add a BroadcastStream to FrameTiming (#11041)
Without this, developers have to override `onReportTimings` to listen for `FrameTiming`.
That can potentially break previous `onReportTimings` listeners if they forget to call
the old listener in their new callback.

This PR replaces the similar RP in the framework: https://github.com/flutter/flutter/pull/38574

Once this PR landed, we'll have to create another framework PR to use the stream to replace
`onReportTimings` usages.

Once that's done, we can then propose the breaking change of removing the deprecated
`onReportTimings`.
2019-08-19 10:52:16 -07:00
Shi-Hao Hong 014ab76ad0 Pass Android Q insets.systemGestureInsets to Window (#10413)
* Pass Android Q system gesture inset information from insets.systemGestureInsets to Window.systemGestureInsets
2019-08-16 13:42:56 -04:00
Dan Field 63b253d907 expose max depth on Window (#10414) 2019-08-02 20:37:24 -07:00
Jason Simmons 8fda1c99b1 Fix return type of assert function in gradient_test (#9961) 2019-07-19 18:55:48 -07:00
Jason Simmons 736c28b359 Update Dart engine tests to check for assertion failures only when running in debug mode (#9959) 2019-07-19 18:27:16 -07:00
Jason Simmons 48b1340ad7 Fix the geometry test to reflect that OffsetBase comparison operators are a partial ordering (#9925) 2019-07-19 12:59:27 -07:00
Jason Simmons 9e0477643e Update the exception thrown for invalid data in the codec test (#9929) 2019-07-18 15:54:32 -07:00
Jason Simmons f20e9350d2 Fix failure of the onReportTimings window hook test (#9923) 2019-07-18 14:42:33 -07:00
gaaclarke 78a8ca0f62 Made Picture::toImage happen on the IO thread with no need for an onscreen surface. (#9813)
Made Picture::toImage happen on the IO thread with no need for a surface.
2019-07-15 17:16:20 -07:00
Dan Field d1dcd18486 Remove breaking asserts (#9797) 2019-07-11 16:46:54 -07:00
Dan Field 56885f79b8 Let pushColorFilter accept all types of ColorFilters (#9641) 2019-07-10 12:06:58 -07:00
Dan Field 887e052333 Refactor ColorFilter to have a native wrapper (#9668) 2019-07-08 15:36:16 -07:00
Yegor 94bb7a7ff2 Adds API for retaining intermediate engine layers (#9461)
Add new optional named oldLayer arguments to all push* methods of the SceneBuilder class.

When not null oldLayer signals to the engine that the intent is to update a layer rendered in a previous frame. The engine may optionally use that signal to reuse the resources allocated for that layer in the previous frame. For example, on the Web we can reuse existing DOM nodes and some of their properties and move fewer nodes around the tree.

The return type of each push method has been tightened up. Instead of having all methods return the same EngineLayer type, each method has its own unique layer type, e.g. OffsetEngineLayer. oldLayer parameters match the returned type. This prevents the framework (and other developers using dart:ui directly) from accidentally supplying an engine layer of the wrong type.
2019-06-28 12:56:03 -07:00