summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/android/graphics
Commit message (Collapse)AuthorAgeFilesLines
...
* LayoutLib: implement more of Canvas/Paint.Xavier Ducrohet2010-12-132-36/+103
| | | | Change-Id: I8e2a7a3bddbce08db5eb641b5075bedd75f7be27
* LayoutLib: Adapt to new LayoutLibXavier Ducrohet2010-12-102-11/+11
| | | | | | | API now uses ResourceValue instead of IResourceValue Capabilities renamed Capability Change-Id: Ia5d2b6c8d536e020a1f5496fb2285f67fc4346c4
* Merge "LayoutLib: Update font object when text info changes in paint delegate"Xavier Ducrohet2010-12-061-7/+9
|\
| * LayoutLib: Update font object when text info changes in paint delegateXavier Ducrohet2010-12-061-7/+9
| | | | | | | | Change-Id: I6ff7e1ec4513918256aee99acc5ea298a5fdb8a8
* | LayoutLib: Fix logging.Xavier Ducrohet2010-12-063-26/+22
|/ | | | | | | | | - Use the new logging API - remove log object reference everywhere but in Bridge - all logging code accesses Bridge.getLog() - prepareScene sets the current scene log object in Bridge. Change-Id: Ib0517ccd6454c4baf218b6baa978a126f91671e7
* LayoutLib: Reuse canvas when possible.Xavier Ducrohet2010-12-021-7/+19
| | | | | | | Also moved the prepare/cleanupThread methods to Bridge as they are not really specific to the scene anymore. Change-Id: I7b93821913ce4d2fcbe3d8be489be6533ff87e57
* Layoutlib: Animation support.Xavier Ducrohet2010-11-292-11/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | New locking mechanims to prevent concurrent renderings. There's now a thread specific prepareThread() method (only prepares the looper) and its associated cleanupThread(). For the rendering itself, acquire must be called before doing any type of Android specific work on the scene (inflate or rendering) After instantiation, init() must be called, which also acts as acquire. Added a lot of checks to make sure method aren't called without acquire or if scenes try to be rendered while acquire was called from the same thread but on another scene. Animation implementation: - Handler delegate to use our own queue (since the animation runs through handler messages). This uses a callback to process the message. This callback is per-thread and only used in animation threads. - SystemClock delegate to provide clock implementation. - AnimationThread to handle playing the animation and calling back to the animation listener. Change-Id: Ia39aba7ed476759df1da3200e413fe3e92590d15
* Layoutlib: use default nine patch classes.Xavier Ducrohet2010-11-234-13/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move away from using our own implementation of NinePatchDrawable. Now use native delegate for a few methods of NinePatch. The byte[] used to describe the 9-patch chunk is entirely controlled by the delegate. Therefore, while the default version (JNI) use the array as a representation of a C struct, this version uses the array as a serialized version of NinePatchChunk. A cache mechanism using SoftReferences allows us to not deserialize the array every time rendering needs to access the chunk itself. The Bridge-level cache mechanism for bitmaps and nine-patches as changed. Since the new nine-patches doesn't hold the bitmap data anymore (it's stored in a normal Android bitmap which is cached itself through the cache), then the nine-patch cache has been changed to only contain the nine patch chunk. Also initialize the canvas with the display metrics to prepare for correct scaling when density of the assets don't match the target density. Still to come: actual density support in the 9-patch drawing code. Change-Id: Ibefcccf4432e1986e8436e0c41a0107741593536
* Layoutlib: support for editing embedded layouts.Xavier Ducrohet2010-11-191-1/+1
| | | | | | | | | When Resources.getLayout(int) is called to return a parser for an embedded layout, this queries the current parser for a custom parser (Eclipse will provide one on top of the current XML model being edited) Change-Id: Ia9e837358f67daed0a835e1b3f4f50c0516ceee9
* LayoutLib: fix some testsXavier Ducrohet2010-11-191-0/+4
| | | | Change-Id: Iacd641e2fac663ff12fe2a08ba093c4eaa2e8862
* Layoutlib: Properly dispose of bitmap delegate.Xavier Ducrohet2010-11-181-2/+1
| | | | | | | | | | | | | This is done by initializing the android.util.Finalizers that's reponsible for calling out to the native bitmap destructor. Also implemented the native bitmap destructor Also fix Bridge by removing obsolete API methods, and removing some unneeded synchronized blocks now that the whole rendering (and scene creation) is protected by a synchronized on the bridge object anyway. Change-Id: Ie1792da6db354836542dfc11f457fe4a6d78ddfb
* Layoutlib: Fix alpha support in Canvas/Paint.Xavier Ducrohet2010-11-122-42/+21
| | | | Change-Id: I359098cfc542a7a0b7d99478c0eb13587b4439d0
* Layoutlib: New bridge implementation using the new API 5.Xavier Ducrohet2010-11-1113-14/+14
| | | | | | | | | | | | | | | | | | | | 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
* Layoutlib: more text drawing.Xavier Ducrohet2010-11-081-7/+6
| | | | Change-Id: I32f46d23e746b095be0577a53b61567a868f0b8a
* Layoutlib native delegate: path effects and xfermode.Xavier Ducrohet2010-11-037-129/+300
| | | | Change-Id: Iafaac6dbaf452e2dba3e77c801089dad33ac4ea9
* Layoutlib native delegate: primitive shapes and shadersXavier Ducrohet2010-11-0311-342/+520
| | | | Change-Id: Id2b0c6231589e82d8e96c9f019042eba348a6583
* More layout Canvas/Paint implementation.Xavier Ducrohet2010-11-012-36/+161
| | | | Change-Id: Ib3da4a4b2259dc7c53b24444b5c0b78cee15d387
* More implementation of the layoutlib Paint/Canvas delegates.Xavier Ducrohet2010-11-013-127/+720
| | | | Change-Id: I0c0029b9a679af4ae0178488f70b2a90292ea42d
* Layoutlib Canvas and Paint implementation through native delegatesXavier Ducrohet2010-11-016-2461/+1336
| | | | | | | Also fix native delegate generation to put "this" parameter even for methods that don't have any parameters. Change-Id: I5dd0c505871370ff7b4cda16de84a5b3ae438f73
* Implement the layoutlib Bitmap through a native delegate.Xavier Ducrohet2010-10-296-336/+387
| | | | | | | | | This does not implement all the native methods of the android.graphics.Bitmap class, only what's needed to draw an ImageView object. The rest will be implemented after Canvas and Paint have been moved to the native delegate. Change-Id: Ia0c3b2cafa03871c298deaef5817a25ac1c35521
* Move layoutlib typeface implementation to delegate.Xavier Ducrohet2010-10-273-191/+172
| | | | | | | Also move BridgeContentProvider to its own class to make it less messy in BridgeContentResolver. Change-Id: Id3462218b500d43d4c9b20b25326ad24e4106fa5
* Reimplement the native matrix method using the new delegate way.Xavier Ducrohet2010-10-274-1065/+1035
| | | | | | | | | | | | Instead of renaming the old Matrix class into _Original_Matrix and have layoutlib provide a full new implementation of Matrix, we keep the old one by only modifying it to implement the native methods which calls out to a new Matrix_Delegate class. The goal is to not have to maintain the java portion in sync between the framework and the layoutlib version. Change-Id: I3e1aefffbae45e91b75331c0c6ff2260323deacd
* Make libhwui entirely optional.Romain Guy2010-08-081-23/+0
| | | | | | | | | | | | The makefile variable USE_OPENGL_RENDERER must be set to true to compile libhwui and the related code in the JNI layer. This change also removes obsolete APIs from Canvas that must not be used and would be confusing if left in. These APIs were remnants of our first attempt at an OpenGL renderer for the view hierarchy and had not been taken out before Android 1.0 was released. Change-Id: I2475ff1307212bab26c926724f3c508681c7dae1
* Fix the layoutlib Paint.set(Paint) method.Xavier Ducrohet2010-07-161-0/+2
| | | | | | | | | It would change the text rendering info but not recompute the Java Font objects. The effect is a broken font rendering in the EditText (which use this method to copy some Paint object before using the copy for the actual drawing) Change-Id: I6d8d1bf86f0d77d088f60ad81c71dd3ebab727b0
* Adds back the finalize method on the replaced Paint class.Xavier Ducrohet2010-04-081-0/+6
| | | | | | without it com.android.layoutlib.bridge.TestClassReplacement fails. Change-Id: Iafb6548f45c31e901591a45239224895c4403be8
* Remove empty finalize methods.Carl Shapiro2010-02-243-15/+0
|
* ADT/Layoutlib: implement sweep gradient.Xavier Ducrohet2010-01-193-60/+140
| | | | Change-Id: I2d460decff82f5f64b0a5cfeaa68156aad4fb3e6
* ADT/Layoutlib: implement radial gradient.Xavier Ducrohet2010-01-193-219/+338
| | | | | | | Also refactored some parts of LinearGradient to reuse them in the radial gradient Change-Id: I2ec69bd60190bd014217d989177dcc7269188dea
* ADT/Layoutlib: Add dash support to stroke.Xavier Ducrohet2010-01-152-38/+91
| | | | Change-Id: I09a7e84948be013cbb11f6d9774ab81df897b424
* ADT/Layoutlib: properly handle stroke information.Xavier Ducrohet2010-01-142-2/+41
| | | | Change-Id: Iec9284d0e65d1313739e361d1fd5a522646fd1fd
* Merge "ADT/Layoutlib: improved gradient drawing for perf." into eclairXavier Ducrohet2010-01-141-3/+9
|\
| * ADT/Layoutlib: improved gradient drawing for perf.Xavier Ducrohet2010-01-141-3/+9
| | | | | | | | Change-Id: I79b909d7787e4442e7cfdf196de1ac0c077da7f8
* | ADT/Layoutlib: don't draw 0-sized rectangle, AWT doesn't like that.Xavier Ducrohet2010-01-141-28/+32
|/ | | | Change-Id: I298d00208ace2421478c5864cc5a66a508b2b411
* ADT/Layoutlib: always use custom gradient (java) Paint.Xavier Ducrohet2010-01-141-30/+17
| | | | | | The normal linear paint from AWT does not support our TileModes. Change-Id: I24667671dabdf1a5dffa342e4de9cc69487db0b6
* ADT/Layout: support for 3+ color in linear gradientsXavier Ducrohet2010-01-141-6/+243
| | | | Change-Id: I14c6a5a1de41470c6f1c66d490492ecc727302f2
* ADT/Layoutlib: shader clean-up.Xavier Ducrohet2010-01-147-7/+14
| | | | Change-Id: I0a200f438b7ccde2bfc19fd23614a647cb19d312
* ADT/Layoutlib: 2 color, linear gradient support.Xavier Ducrohet2010-01-138-56/+92
| | | | Change-Id: Ifaafa4fc42a22f4851449a7c35a5b82e211aafe7
* ADT/Layoutlib: implement Canvas.concat(Matrix)Xavier Ducrohet2010-01-132-18/+34
| | | | | | | | | | | | This prevented ImageView from making proper use of ScaleType. Also fixed Canvas.getSaveCount() that returned the wrong value and Matrix.getTransform() which used the wrong order for the AffineTransform constructor!! Bug: 2364564 Change-Id: I78babf4aa6689440e52ad06b1473f75b20eb66da
* ADT/Layoutlib: Reimplement parts of BitmapFactoryXavier Ducrohet2010-01-132-0/+604
| | | | | | | | | | | | The original bitmap factory is mostly done in native and deals with the normal android Bitmap class which has been replaced in the layoutlib by a bitmap that is merely a wrapper around an AWT BufferedImage. This new BitmapFactory creates the layoutlib version of Bitmap all in Java. Change-Id: Ice8b5d19141a9a43f83349c159201bf85604b3b0
* Properly implement Paint.breakText for layoutlib.Xavier Ducrohet2009-11-131-2/+12
| | | | | | BUG 2260400 Change-Id: I7082e366b65da0b5de2a6dbb547f66e05e0b78e0
* Support for fallback fonts in layoutlib.Xavier Ducrohet2009-11-093-66/+245
| | | | | | BUG 2041229 Change-Id: Ib12bcb7f6d8f0e4c2b51871f8129ecf51fa938ee
* Reimplement all the method of Paint for layoutlibXavier Ducrohet2009-10-051-69/+294
| | | | | | | | | | There were a few missing methods that should have been reimplmented (because they were native). Others have been added just to be sure so that we can test whether methods are missing or not (test coming soon). Change-Id: I24895c353e38545e9b1abe28d41224fdc78cadb1
* Fix issue #2125720 Weather Forecast Widget - graphics do not scaleDianne Hackborn2009-09-231-2/+2
| | | | | | I forgot to add the new density field to the Bitmaps' parcelable data. Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
* Improved drawing/matrix support in layoutlibXavier Ducrohet2009-08-173-20/+1243
| | | | | | | - Make the custom Canvas actually replace the original one so that it's used even by parts of the framework that allocate their own temp Canvas object. - Better support for Matrix: added support for mapPoint() and mapRect(), and invert() - Implemented drawBitmap() with a Matrix, and made the paint object not NPE when null.
* Fix external bug 2875: Matrix#mValues[7] assigned twice in place of mValues[8]Xavier Ducrohet2009-06-051-66/+66
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-0312-0/+3277
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-0312-3277/+0
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-1/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-8/+17
|
* Initial ContributionThe Android Open Source Project2008-10-2112-0/+3269