Also:
- give users of Material who previously relied on Material's defaults
opinions about background colours
- reindent stock_row.dart
- import colors as colors in example/widgets/styled_text.dart, rather
than in global scope, for consistency with other files
- import typography as typograpyh in example/widgets/tabs.dart, rather
than in global scope, for consistency with other files
- make flat_button actually be transparent by not painting a
background, rather than painting 0x00000000. This is the what I
actually originally set out to do here.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1217293003.
I ran this and fixed some of the warnings flagged:
cd ~/dev/mojo/src/sky && find engine/core/painting sdk/example sdk/lib -type f -name '*.dart' | perl -nE 'chomp; local $/ = undef; open(FILE, $_); my $file = <FILE>; print $file; next if $file =~ /^part of/om; say "import \"$_\";"' > all.dart && shelldb analyze all.dart 2>&1 | grep -v 'sky/all.dart'
Then I loaded the affected examples and fixed any bugs I found from running them.
Major change to SDK:
- Fix RenderPadding to get a valid size when it has no child (it was
previously sizing itself too small by the padding amount).
Minor changes, mostly to examples:
- Fix the 'part of' lines in sky_shell_dart_controller_service_isolate
to match the library name given in main.dart.
- Remove unused imports in various places.
- Fix example/game/lib/texture.dart to use the new Rect creation APIs.
- Remove unused code in example/mine_digger/lib/main.dart.
- Fix example/raw/hello_world.dart to use the new Size.center API.
- Fix example/rendering/baseline.dart and
example/rendering/justify_content.dart to have readable text.
- Fix compile error in example/rendering/transform.dart.
- Extend the debugDoesMeetConstraints() method to print useful
information when it will be used to fire an assert.
- Remove a warning about abstract methods on RenderView that would for
some reason only sometimes get flagged by the analyzer.
R=abarth@chromium.org, jackson@google.com
Review URL: https://codereview.chromium.org/1215163003.
We need the material design icons at build time in order to build Sky
application bundles that include the icons. Therefore, we need can't wait until
runtime to download the icons.
Also, rather than copying all the icons into each out directory, we just
symlink to the copy in the source tree.
R=eseidel@chromium.org, eseidel@google.com
Review URL: https://codereview.chromium.org/1217283002.
This script consumes a sky.yaml file and produces a bundle that contains the
listed material design assets as well as the snapshot binary. This script isn't
wired into the build system yet because we don't yet download the material
design icons using DEPS.
R=chinmaygarde@google.com, eseidel@google.com
Review URL: https://codereview.chromium.org/1220893002.
When navigating from one app to another, we create a new Android window and
destroy the old one. Previously, when we destroyed the old window after
creating the new window, we would destroy the Ganesh context after making the
GL context for the new window current, causing us to corrupt the GL state in
the new window. After this CL, we call MakeCurrent before destroying the Ganesh
context so that it interacts with the proper GL context.
R=jackson@google.com
Review URL: https://codereview.chromium.org/1214263002.
Actually the tests broke in 136e0d4da5
...but I had reset the results because I had changed all the coordinates, and didn't realise some of the changes were bad.
TBR=abarth
Review URL: https://codereview.chromium.org/1212803003.
This also makes the optimistic/pessimistic mode switch change the active theme, because why not.
While I was at it I also provided a debug boolean argument to runApp() to make it possible to profile more easily.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1215023002.
Turns out I had misimplemented Rect.center.
While I was here, I also implemented Rect.width and Rect.height (to
help avoid making that mistake again), and copied shortestSide from
Side to Rect so that we can avoid having to allocate a Size to get the
shortest side from a Rect.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1216013003.
By profiling mine_digger in a continuous rebuild loop, we observe
Widget#syncChild as being very hot. This CL optimizes this function by making
sure to read each input value exactly once.
Also, the hash operations for _mountedChanged were showing up on the profile,
so this CL makes _mountedChanged into a List, which should work fine.
Together, these changes reduce the amount of time we spend in Navtive code
inside the VM from 29% to 20%.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1217473004.
A simple container for a TabBar. It is defined by a list of
TabNavigatorViews, each of which is just a TabLabel and
the tab's content.
The content of each tab is represented by a function
that produces a Widget called "content". I couldn't
bring myself to call it buildTabContentCallback or something
else more specific.
R=abarth@chromium.org, ianh@google.com
Review URL: https://codereview.chromium.org/1212993003.
This CL builds an APK for MineDigger that works offline. We use |sky_packager|
to snapshot the Dart code, which we then extract from the APK during startup.
If we succeed in extracting a snapshot, we load it by default.
TBR=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1211253004.
Added a OffsetBase class that Size now inherits from, and added a new
Offset class that also inherits from OffsetBase.
Offset has:
- dx and dy members
- zero and infinite static constants
- a method that returns a new Offset that's the existing one scaled
by a scalar
- a unary minus operator
- operators overloads such that subtracting or adding two Offsets
gives another Offset
- a toPoint() method
Added Offset and Size to the dart bindings, so they can be used from C++.
Changed the Canvas API to use Point, Size, and Offset where appropriate:
- drawLine uses Points now
- drawCircle uses a Point now
- drawImage uses a Paint now
- the constructor uses a Size
Changed Point as follows:
- added a unary minus
- Point difference now gives an Offset rather than a Size
- You can add an Offset to a Point to get a new Point
- toSize() has been replaced by toOffset()
Changed Rect as follows:
- renamed upperLeft and lowerRight to topLeft and bottomRight for
consistency with our other APIs
- added bottomLeft and topRight for completeness
Changed Size as follows:
- now inherits from OffsetBase
- added *, /, ~/, and % operators for scaling sizes
- subtracting a Size from a Size gives an Offset
- subtracting an Offset from a Size gives a Size
- changed the + operator to take an Offset instead of a Size
- added topLeft, bottomLeft, topRight, bottomRight to match Rect
- added center for the same reason
- added shortestSide getter since that was a common pattern
- removed toPoint()
Changed DrawLooperLayerInfo as follows:
- setOffset member takes an Offset instead of a Point
Changed BoxConstraints as follows:
- added biggest getter since it was a common pattern
- added smallest getter for symmetry
Changed BoxShadow as follows:
- offset member is an Offset rather than a Size
Changed ViewConstraints as follows:
- replaced height and width members by a single size member
I did some minor code cleanup in nearby files while I was there,
including sorting sky/engine/core/core.gni alphabetically, and fixing
some warnings in the examples.
BUG=
R=abarth@chromium.org, chinmaygarde@google.com
Review URL: https://codereview.chromium.org/1214833004.