History log of /frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
31cf782fd23fc17bab3d312c6eb8ae734c1f16c1 10-Mar-2017 Jerome Gaillard <jgaillard@google.com> Update Shader delegates following Change Ib5d33a80

Test: layoutlib tests
Change-Id: If0db59dd2400ced9019bb999c014d7d655021fd3
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
73ea72e9a0093f62edddf81be282be0664e84ad9 15-Jun-2015 Diego Perez <diegoperez@google.com> am 2f710356: am 13c06d6c: am 1f33bdad: am 5e50e00c: Merge "Fix for shadows on theme editor" into lmp-mr1-dev

* commit '2f7103565cf1732d6d1281195cfa49a1564751d7':
Fix for shadows on theme editor
02da83fbec57bdc725bd1f57262f442f57c1d816 02-Jun-2015 Diego Perez <diegoperez@google.com> Fix for shadows on theme editor

If the preferred ColorModel doesn't support alpha, the shadows are
incorrectly rendered. In the theme editor on Linux, the graphics device
object doesn't support alpha so we need to use a different color model.
We default to ARGB which works fine.

Change-Id: I3e71e3d086fa4975a9149d36792e574813f37dfd
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
a0c10a72a2510e903b077238c180ccac452cfbaa 07-May-2015 Diego Perez <diegoperez@google.com> am ffeb8117: am 9c13c8de: am bc47abe4: Merge "Make sure shaders use a color model compatible with the destination." into lmp-mr1-dev

* commit 'ffeb8117b139f61dd7c92bda6a7d47b83871cb66':
Make sure shaders use a color model compatible with the destination.
cd90a56d37a51ab78499fd39f66cd595e9c17bdf 12-Mar-2015 Diego Perez <diegoperez@google.com> Make sure shaders use a color model compatible with the destination.

Change-Id: Iaf6e14bb86835c36a5b0c37519ac2ee794d10081
(cherry picked from commit 158ac454073a460375123d7d05152a7c6490efb6)
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
dba76ab779821ebb404cd5d725e0b852b9619ed5 02-Oct-2014 Neil Fuller <nfuller@google.com> resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp

Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2460c57a7ac1c2a491a62d0321ac24d9f6bd4fda 01-Oct-2014 Neil Fuller <nfuller@google.com> Switch from FloatMath -> Math and Math.hypot where possible

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
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
0cd41bc93883b7123cc004d9379ea58b067d1a69 29-May-2014 Deepanshu Gupta <deepanshu@google.com> Update delegates

Update layoutlib delegates in response to commit
a631a36de986acea2ef6fdfbaf3441a28b914b15

Change-Id: I897a7e3a61286bfae9054415d555febe16410106
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
633d68816b468e887eb630aa0a87962d57a0805c 27-Jan-2014 Narayan Kamath <narayan@google.com> Track 64bit changes to android/graphics.

All pointers are now 64bits wide, so should be
represented as java longs and not ints.

Also changed DelegateManager and SparseWeakArray to
reflect the new world order.

(cherry picked from commit 88a8364c386c694f7ad56662ef89713dbf7c9d63)

Change-Id: Ic2f55dd6235751169c5014f9d2ccf3f544259a87
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
ec4118922fa844ef31b73d16adc76f4da4c6c8e6 27-Jan-2014 Narayan Kamath <narayan@google.com> Track 64bit changes to android/graphics.

All pointers are now 64bits wide, so should be
represented as java longs and not ints.

Also changed DelegateManager and SparseWeakArray to
reflect the new world order.

Change-Id: Ic32b6b53818dbae9b949f03004c4fb6dae26cdbe
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
ab775ecdd189b32e35b0d3f4a821502f88b03a4b 24-Jan-2014 Adam Lesinski <adamlesinski@google.com> Revert "Move frameworks/base/tools/ to frameworks/tools/"

This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
d98e133b3911b8db3430ce9d85efd5a6adcf70bf 03-Feb-2012 Xavier Ducrohet <xav@android.com> Make Layoutlib compile on Java 6.

Change-Id: Ic8f0e321c6c218de83664fc01f253a07fa80852c
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
9167279573bb4365f90423ff6fff9af5a88b399d 22-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Hold onto delegate references.

When an object is given a delegate to hold onto, keep
the reference to the delegate instead of its native integer.

Also change the way the finalizer works by not explicitely deleting
the delegate. Instead we want the delegate to be deleted when
nothing holds a reference to it. To do this, instead of using
a regular SparseArray, we use a SparseArray of WeakReferences.
Because the main Java object that "owns" the delegate does not
actually holds a reference to the delegate, we fake this by
having the delegate manager hold a reference to delegates for
the main object. This is added/removed as the object is created
and the native finalized is called.

This makes layoutlib behave more like the JNI code where the native
objects are reference counted, and where the Java object can be
deleted but the delegate it owns is kept around (usually because
another type of delegates hold a reference on it.)

To properly handle the WeakReferences, we need to be able to
regularly clear the SparseArray of WeakReference that were
referencing objects that have been GC'ed.
Since the SparseArray is regularly being compacted (actually only
when items are removed), we use a custom SparseWeakArray (started
as a straight copy of SparseArray) that handles the WeakReference
and takes care of compacting the array by removing deleted indices
and WeakReference that returns null. Since our specific use case
doesn't call actually delete() or remove(), the compacting
only happens when the array needs to be resized.

Change-Id: Iacc5c1ff5b21732b8816fda87eb090da12d034e0
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
94c80bfaff4e9f503817254237e1538096a018ef 10-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Annotate the custom delegate methods.

Every method implementing a delegate needed by the
layoutlib_create bytecode modification must now be
annotated with LayoutlibDelegate.

The methods in the original source code that are delegated
are already automatically annotated. Now with the implementations
being annotated we can do bi-directional tests and find not
only missing implementations but also dead obsolete code.

This will be useful when backporting to earlier versions of
Android, or when native (non public) method disappear. In fact,
the new test detected one such method in Shader.

Change-Id: I491708b68ac2736ca5669aa86cd5e930a00f9db3
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
f69bb29490b24ed4c31ad248e87bffbf923fd4da 15-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: update logs to use new data bundle

Also change some resource.resolve tags to resource.format

Change-Id: I3f0b0d2eb69a5ec98375e4014a3bb1bfceb8c855
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
3f9b0376c69a5f679661d773ea7b59b1e6787090 13-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Use the new log tag constants from LayoutLog

Change-Id: I29dd578ae16405358d3673caf13528be393f0967
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
ef78fd2b92ad4155d48b02d194ebc2925e9e579b 13-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: use tags in logs.

Change-Id: Ib85272249d285ecef409bf063903bcd91514a424
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
c810bea18e3f0e42aed4afb5e5159fba678a95e1 20-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: support for Path and BitmapShader using delegates.

Also created delegates for all missing shader, xfermode
and patheffect classes. Moved the logic of the xfermode,
and patheffects that was in Canvas_Delegate into the
xfermode/patheffect classes, and added support (in all
3 clases) for knowing if the shader/xfermode/patheffect
is actually supported or not. Make use of fidelityWarning
in LayoutLog if they are not.
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
8f1cbe090f822e91a01bf4b1a8ca85c8b8570aa0 14-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Fix gradient rendering.

- fully support canvas transform
- fully support shader local transform
- fix repeat/mirror issue in the negative values.

Change-Id: Ib2aa7ade1c2702da4364cbda9a5a3ae72c1d3174
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
3bd98986a97e4e1921616a0a86983307e68ceb6c 10-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: New bridge implementation using the new API 5.

Since the new API prepare for stateful layoutlib, major
reorganization of the code.

New "android" sub-package for all extended android classes.
Also moved BridgeInflater in here so that all extended classes
are in this package. Only delegates and classes replacing
renamed classes are in their original android.* packages.
Also created full file for the empty implementations of
IWindow and IWindowSession.
New "impl" for the dirty work implementation.
Main package contains the basic implementation of the API.

Most of the code that was in Bridge is now in .impl.LayoutSceneImpl,
with the main init/inflate/render code split into the contrustrutor,
inflate() and render().

Change-Id: Ie15b15e5a1b2388cd6ef82e518345b1fc02ec981
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
f1a1745224b8b6af23e15d2bf93631da80adc355 02-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib native delegate: primitive shapes and shaders

Change-Id: Id2b0c6231589e82d8e96c9f019042eba348a6583
/frameworks/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java