| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.
That said...
Math is faster than FloatMath with AOT compilation.
While making the change, occurances of:
{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))
have been replaced with:
{(float)} Math.hypot(x, y)
Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:
Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().
hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.
Different implementations measured on hammerhead / L:
AOT compiled:
[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials
[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials
[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials
[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials
[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials
[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials
Interpreter:
benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials
Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
|
| |
| |
| |
| |
| |
| |
| | |
Removed redundant array allocations to improve performance for various
blending modes.
Change-Id: Iaba1d6ff3ad03eebdc859c599b610cc593370438
|
| |
| |
| |
| |
| |
| |
| |
| | |
The class is adapted from a demo tool for Blending Modes written by
Romain Guy (romainguy@android.com). The tool is available at
http://www.curious-creature.org/2006/09/20/new-blendings-modes-for-java2d/
Change-Id: I8f7c7ca08d3078106056764a4e2f1ce95d990137
|
| |\
| | |
| | |
| | | |
Change-Id: I54e14e1c6cd53cd10b38b34cf31989a2aa487b83
|
| | |
| | |
| | |
| | | |
Change-Id: I262c285c1047958afdb024724959d5afb3552802
|
| |\ \
| | |/
| | |
| | | |
Change-Id: Iba01a6617d4922ec2827b0465095695028c20681
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
NORMAL [DO NOT MERGE]" into klp-dev
* commit '55542ee6449bd580f61bc005726b5c87773fbe25':
Set default text style in layoutlib as NORMAL [DO NOT MERGE]
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If a style doesn't specify text style (normal/bold/italic/bold-italic)
then default to normal instead of throwing an error.
Bug: http://b.android.com/61358
Change-Id: I0138c73807a5ff6e4d938a99ece3044333110aa1
(cherry picked from commit 0acfb16dcd95468fe032204f54618e86becfd1eb)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Also fixes a shader delegate method.
Change-Id: I86be80ab55d04760084d5bf39235f2ee4de7be23
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A list of all fonts bundled with the SDK is generated. Load this file to
know which fonts are missing from the SDK.
Change-Id: I1554f1baec842ccdde3b21a93008437e9bac9353
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The extended font set, used on Nexus 5, new Nexus 7 etc., uses OpenType
CFF fonts which don't work well with Java. These fonts are deliberately
excluded from the SDK build.
This change skips the warnings for the missing fonts. However, we still
show warnings for other fonts that failed to load. If the set of fonts
bundled with the SDK changes, we will need to update the list of missing
fonts in FontFamily_Delegate.java.
Change-Id: I3197b5350d048daa09512e8024188909179b1799
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I9668b84812e9be333d10603657dd911024fc292d
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I2b6a6b679b7a5b2532b76b723155bc2763b70768
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The Path_Delegate was missing a moveTo call which resulted in
IllegalPathStateException when rendering the ProgressBar.
Change-Id: Ibdae5f90ffd0a71a3de4ba945238239faa0b18b2
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Not all PorterDuff modes are supported by Java's AlphaComposite. Use
BlendComposite for such modes.
Change-Id: I51486a40f09186cf8a87ce1e6a3d1cfcf39fb2d3
(cherry picked from commit b15709cd36d28c47660b0ae30918642bfd3d85f7)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Removed redundant array allocations to improve performance for various
blending modes.
Change-Id: Iaba1d6ff3ad03eebdc859c599b610cc593370438
(cherry picked from commit 9ce074610413ce3a5dd0cef9295f0ae9061402b7)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The class is adapted from a demo tool for Blending Modes written by
Romain Guy (romainguy@android.com). The tool is available at
http://www.curious-creature.org/2006/09/20/new-blendings-modes-for-java2d/
Change-Id: I8f7c7ca08d3078106056764a4e2f1ce95d990137
(cherry picked from commit 882e08759137a77090c3c7dff8cba425a3393474)
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: Icd93c31b4e8c8ee5ea242fb8295578937f48ff2a
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
* commit 'bdf7f8b009ca9f276b5368a1cea037c1605f7261':
Support Typeface.createFromFile()
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add support for Typeface.createFromFile() for platform fonts. The
feature existed in the KitKat LayoutLib but was dropped for the L
preview. This change adds it back.
Change-Id: Ib1abe67a32c28a1fb0e2a4f3061c358b55129434
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The flags for RTL and LTR are simplified in commit
0a1d91862a3822dcbbb412bcd6d69b0f5f079f8b. This change follows up the
same in LayoutLib.
This also fixes the following bug which incorrectly computed runs with
'en-dash' (\u20132) as RTL.
Bug: http://b.android.com/69432
Change-Id: Iaed62d13ce31f107773576ed2ef412be6037cd04
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The order of the methods match the order of the declaration in the
Canvas file. This makes searching for the methods easier.
Change-Id: I230621d3999024cb2ff42a1aacd60908c7f0b161
|
| | | | |
| | | | |
| | | | |
| | | | | |
Change-Id: I64828bfb963048effbc49a622f5f2aa0203665e6
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* commit 'ac626a6724bc239fcf3d5b2e207de02c59595c5a':
Improve PorterDuff support.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
1. Don't cache the src image used for applying the filter. The filter
delegate is not always cleared. This probably results in slighly slower
rendering, but doesn't run Studio out of memory.
2. Support more PorterDuff modes.
3. Fix a bug where the alpha was applied twice and thus the filter had
less effect than it should have had.
Change-Id: I2a481a64ba7f1ff8e9683bbc46ae110433e82ebc
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
into lmp-preview-dev
* commit '699f7221dc0719b1ceb03a03183dc742a5bcdf3c':
Temporarily change PorterDuff mode MULTIPLY to SRC_IN
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Overflow pop up dialog for action bar uses PorterDuff color filters in
mode SRC_IN. The mode is not supported by AlphaComposite currently. So,
in order to render something, we swap it out with SRC_IN.
Change-Id: I987e101728ecb76b5e3d5cd91f831e6f63a4321f
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* commit '3a812f4755015a7384a8d28bbdeca445c87598b3':
Fix NPE in Ninepatch creation.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Change-Id: Icead69cd8503e90aeb54ff42f9ec297e7af2b518
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
lmp-preview-dev
* commit 'e558d1806b29385aa14ba60f18e103e2c9aeef1b':
LayoutLib: Support PorterDuffColorFilter
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add support for select modes for PorterDuffColorFilter.
Change-Id: Ia7b4a6a92c326be977dd87a70f54c1f8954b546d
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
into lmp-preview-dev
* commit '3daec1972493c1e867c6cac7f4a2a43a157d52b9':
LayoutLib: Better support for compact/elegant fonts.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Change-Id: I67439924bc6323490ea0c7d7864985b400906f8c
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
lmp-preview-dev
* commit 'ee0011198ff150f972c8afbc5dff695bce2af1f1':
LayoutLib: Add assertions for typeface.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Framework passes typeface along with the paint object at many places.
Paint_Delegate is supposed to have the typeface object with it. Add
assertions to ensure that the two typefaces are indeed the same.
Change-Id: I68193513c2d99f269c0458d6493f23025bbda385
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* commit '242dded6e8b7e5851ad7b80a0c05e4883d2a9f42':
LayoutLib: Font variants
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Update to support font variants properly.
Change-Id: Iabe37babd9ddce80a9ba9eca7e0e5a0ffb090646
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Instead of storing a direct SkCanvas reference, Canvas now tracks
an opaque native wrapper class. The native wrapper can be used to
store additional info for emulating deprecated Skia features
(at this point it only stores a canvas).
Some notes:
* all native handle -> SkCanvas conversions are routed through a
handful of native utility methods.
* safeCanvasSwap() refactored as a lower level setNativeBitmp() - which
is what clients need.
* removed unused get_thread_msec() (Canvas.cpp)
Change-Id: I715a5a6f1e1621c1cfc1e510ae4f2ea15cf11114
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This adds the new delegates that were missing. This starts the work on
changes related to Minikin Fonts.
There are some changes related to TypedArray that still need to be
fixed.
Change-Id: Ic2397b64aa3f1f48926e849b14689c47d9ee7f8c
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
FontFamily_Delegate was being reused after the nUnref call. The issue is
fixed by storing the reference to the FontFamily_Delegate directly in
the Typeface_Delegate rather than storing the native pointer.
Change-Id: I0db724a83c4be3d7b64ccba0989cd64129f2a785
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Update layoutlib delegates in response to commit
a631a36de986acea2ef6fdfbaf3441a28b914b15
Change-Id: I897a7e3a61286bfae9054415d555febe16410106
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This adds the new delegates that were missing. This starts the work on
changes related to Minikin Fonts.
There are some changes related to TypedArray that still need to be
fixed.
Change-Id: Ic2397b64aa3f1f48926e849b14689c47d9ee7f8c
(cherry picked from commit 7ca3612094270183243938e79337c84effea7ad0)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Update delegate method signatures for L.
Change-Id: Ie607293bcae60b2d3a61d1cad3ac5f04bda2a238
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently, the native canvas is accessed/manipulated from several
unrelated classes.
In order to facilitate SaveFlags emulation, this CL encapsulates
the field and refactors its external users.
Two main changes:
* new getNativeCanvas() getter for use in Java-level clients.
* JNI canvas swappers (GraphicsBuffers, Surface, TextureView &
AssetAtlasService) are refactored based on the exising/equivalent
safeCanvasSwap() Canvas method.
Change-Id: I966bd4898f0838fb3699e226d3d3d51e0224ea97
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Update the Matrix_Delegate native methods in layoutlib. The original
change is I5cdcea827ebff587df0bbddc0965e3e0fbf48002.
Change-Id: I2c94741fdaeb0c2279caefee0188f432267bb37d
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add the native stub methods for isElegantHeight in Paint.
Change-Id: Iaddde36528fb452e5a150ab35687da781091d14c
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add delegates for Path.native_isConvex and ICU.getCurrencyNumericCode.
The original methods were added in
5be83edd15e11420287cc0af93a95d5a6dfae68f and
d627bd4525e41b0503f94c2887c3e01618c73105 respectively.
TODO: Implement Path_Delegate.native_isConvex
Change-Id: If1046467d3950ab6955c6b81383a60fd6bd03fd2
|