summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/android/graphics
Commit message (Collapse)AuthorAgeFilesLines
...
* LayoutLib: fix support for textScaleX.Xavier Ducrohet2011-10-041-1/+1
| | | | Change-Id: I821191a40012e9727b4a3573d580483c3ae1de48
* Layoutlib: Typeface support for loading fonts manually.Xavier Ducrohet2011-10-041-3/+38
| | | | | | | If the font being loaded is a system font, then we can find the font file and manually load it. Change-Id: I95473b1f1b88df64316b77c41ed05d4d09ab61ed
* Layoutlib now parses system_fonts.xml instead of its own.Xavier Ducrohet2011-10-041-11/+1
| | | | | | | | Also parse fallback_fonts. This lets layoutlib automatically use the same fonts as the base platforms, for instance it now uses the new ICS fonts. Change-Id: Id6e778dc0e3f2a9112601e0eaf8499a9713ec433
* Layoutlib: add support for ITextServicesManager.Xavier Ducrohet2011-10-031-0/+3
| | | | | | | | | | | | This include a fix in layoutlib_create to properly handle delegating a static method of an inner class (was broken and only worked on non static method). Added a few comments here and there to *_Accessor classes so that it's a bit more obvious what they are for and how they are used. Change-Id: Ifc31dd1a006393bb0c08e22b6a17f500dd62e090
* LayoutLib: add native delegate for set/getHinting in Paint.Xavier Ducrohet2011-08-221-0/+25
| | | | Change-Id: I1758f8ce861240d72113aa23dcbef5a52abade56
* Make some methods/fields package private so that layoutlib can access them.Xavier Ducrohet2011-08-112-4/+27
| | | | Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
* Misc layoutlib fix in preparation of the access change in framework code.Xavier Ducrohet2011-08-011-1/+1
| | | | Change-Id: I873adb7345514be6daa5c4fea4ebabb515f203e2
* Layoutlib: misc fix + start of AndroidBidi support.Xavier Ducrohet2011-07-191-27/+0
| | | | Change-Id: If2ce0b683da8cce01679322d503eed8dd474e521
* Fix changed native method delegates in layoutlib for ICS.Xavier Ducrohet2011-06-152-3/+37
| | | | Change-Id: I49306868cd8a41b6b7d919c3e8b108d5c014530e
* am abc83871: am f6e47999: am 2a6dc7f1: Merge "Import the Layoutlib from ↵Xavier Ducrohet2011-06-071-2/+2
|\ | | | | | | | | | | | | hc-mr1." into honeycomb-mr2 * commit 'abc838716816107754ab0479242d03807ce79fc2': Import the Layoutlib from hc-mr1.
| * Import the Layoutlib from hc-mr1.Xavier Ducrohet2011-06-031-2/+2
| | | | | | | | | | | | This is squash commit of all the missing patches. Change-Id: Ie081c46a173290646deddbde503a720d50c4400f
| * Merge 59aad78e from master. do not merge.Xavier Ducrohet2011-04-071-1/+8
|/ | | | | | LayoutLib: don't render when shader's local matrix is set to 0 scale. Change-Id: I02c0ddd856026357f468dcc8b81e0520470118de
* LayoutLib: Fix Arc rendering.Xavier Ducrohet2011-03-142-30/+52
| | | | | | Looks like Java2D and Skia go in different directions for angles. Change-Id: Ia0c9c70cd66c9a0941fa9921fecf8e4e83538af3
* LayoutLib: fix Capabilities and getDimensionPixelSizeXavier Ducrohet2011-03-081-1/+1
| | | | | | | | | | | Commented out a Capability that is not in ADT 10. BridgeTypedArray.getDimensionPixelSize shouldn't call getDimension since most of the code is duplicated, and it prevents use from properly detecting malformed attribute values. Change-Id: I005b17061590dc0668729af16e896fad815f1973
* LayoutLib: Implement some missing add###() method in Path.Xavier Ducrohet2011-03-071-25/+80
| | | | Change-Id: Ib62b5df0361ba81846483b1e5f8d7cbdbcb57d40
* LayoutLib: fix incorrect indices in one of the 2 native_drawTextRun methods.Xavier Ducrohet2011-02-241-3/+2
| | | | | | Fixes http://b.android.com/15007 Change-Id: Iff06180def92c5fa25e82520b76192c089edd8cc
* LayoutLib: Add debug mode.Xavier Ducrohet2011-02-2314-14/+14
| | | | Change-Id: If4263c7dba63a063f84e0c6988c270eb6d291ac3
* LayoutLib: misc fixes.Xavier Ducrohet2011-02-232-25/+102
| | | | | | | - implement some Paint methods that are needed for 2.x - fix the phone system bar to display the icons on the right. Change-Id: I3a938b14ec9a449dbc23a33303a3c8405a5369a8
* LayoutLib: Hold onto delegate references.Xavier Ducrohet2011-02-2335-112/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* LayoutLib: remove some exceptions.Xavier Ducrohet2011-02-094-44/+78
| | | | | | | We need to move away from throwing anything and instead log errors/warnings. Change-Id: Ib1af71a90c06e8565fbd0c061ba56f4d19baa3df
* LayoutLib: Annotate the custom delegate methods.Xavier Ducrohet2011-02-0937-74/+408
| | | | | | | | | | | | | | | | | 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
* LayoutLib: improved rendering for system/title/action bars.Xavier Ducrohet2011-02-062-43/+86
| | | | Change-Id: I926531e9ad4a7b98e04e23cac3837794f7c89449
* LayoutLib: Replace custom BitmapFactory by a simpler delegateXavier Ducrohet2011-02-043-605/+118
| | | | Change-Id: Ie61a0a5b4426e64bb71a22d76d05efa4c0865e5e
* LayoutLib: render system/title/action bars.Xavier Ducrohet2011-02-041-1/+28
| | | | | | | Also a few generic fixes in the layoutlib itself to support this. Change-Id: Ie3f24c9056bd3cc72f39f8a4f2c0861be15bff55
* LayoutLib: Update with the new resource map APIs.Xavier Ducrohet2011-01-281-1/+1
| | | | Change-Id: I30d83c2bb4569513f4f5e22670cffe938706f105
* LayoutLib: Properly compute available space to layouts.Xavier Ducrohet2011-01-272-11/+11
| | | | | | | Also display placeholders for status/title/action bars depending on if the app is a tablet and its theme. Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
* LayoutLib: return ViewInfo for all merged items + Build init.Xavier Ducrohet2011-01-251-0/+9
| | | | | | | android.os.Build is now initialized from the build properties parsed from the SDK build.prop file. Change-Id: If16953215ca90fb0beacb51bf405b89a5c8a34fa
* LayoutLib: update logs to use new data bundleXavier Ducrohet2011-01-1414-32/+36
| | | | | | Also change some resource.resolve tags to resource.format Change-Id: I3f0b0d2eb69a5ec98375e4014a3bb1bfceb8c855
* LayoutLib: Fix multi-line text rendering.Xavier Ducrohet2011-01-131-1/+1
| | | | | | Stupid indices. Change-Id: I1dbdd04b8f25a5769de8dc21e6c513cef3e35635
* LayoutLib: Use the new log tag constants from LayoutLogXavier Ducrohet2011-01-1314-45/+45
| | | | Change-Id: I29dd578ae16405358d3673caf13528be393f0967
* LayoutLib: use tags in logs.Xavier Ducrohet2011-01-1214-31/+64
| | | | Change-Id: Ib85272249d285ecef409bf063903bcd91514a424
* LayoutLib: Improve error reporting.Xavier Ducrohet2011-01-112-4/+5
| | | | Change-Id: I37cad7e2efb959202960c57b271c55c759867139
* LayoutLib: fix XmlUtils.convertValueToIntXavier Ducrohet2011-01-111-0/+117
| | | | | | | | | | | | | | It looks like the device implementation of Integer.parseInt is able to handle converting hexa value > 80000000 while the desktop VM cannot. This patch provide a fix for this. While implementing it and running the TestDegates test I realized that some delegate methods for Region were mising, so this adds them too. Change-Id: Ifee1efd47c8c52adc2f4658ec4fc8bd55adb84b4
* LayoutLib: add a few misc implementations.Xavier Ducrohet2011-01-074-25/+48
| | | | Change-Id: I586f1d5ecc4f254fc04ea1171eb499d06ac592eb
* LayoutLib: finish Typeface and unload them in dispose.Xavier Ducrohet2011-01-071-5/+5
| | | | Change-Id: I3a48f84678f62d669d303fc73b041bb3fe5f333b
* LayoutLib: Finish the matrix delegate.Xavier Ducrohet2011-01-063-12/+55
| | | | Change-Id: Ife70a4707c113f4a2aed18e303cb2f221c73db2a
* LayoutLib: fix clipping issues.Xavier Ducrohet2011-01-062-3/+29
| | | | | | | | | | | | There were two issues: - Graphics2D.setClip only works on rectangular shapes. This means doing a setClip on a non rectangular shape should basically reset the clip and intersect with the new shape. - the current clip can be null, so the combineShape method must handle it. Change-Id: Id2cd7475e991d8b533ff2e8850cc2c27663f9e52
* LayoutLib: Misc javadoc fixes.Xavier Ducrohet2011-01-035-15/+15
| | | | Change-Id: Iabe081c20b361b034c2e66b975b8756c0fdcd3d1
* LayoutLib: Support Region through delegates.Xavier Ducrohet2010-12-245-19/+393
| | | | | | | also finish supporting some clip operation on the canvas. Change-Id: I743b9e52a7aa6e9340506f1c904cc1cfbf3ff81f
* LayoutLib: add support for unsupported drawing modifiers.Xavier Ducrohet2010-12-2420-285/+848
| | | | | | | | | | | | | DrawFilter, Rasterizer, ColorFilter and MaskFilter are not supported but we need to provide their JNI counterparts anyway, to at least display warnings when they are used. Also improved the API to query Paint for Shaders and PathEffects, and clean up some code by moving asserts into the DelegateManager. Change-Id: I8942514565d28576d5608c6373bda25d86d42ff2
* LayoutLib: improve bitmap support.Xavier Ducrohet2010-12-224-139/+429
| | | | Change-Id: I703c2bdf51380b54fd5c20b08d3bc74833d9bc6e
* LayoutLib: support for layers.Xavier Ducrohet2010-12-226-499/+368
| | | | | | | | | | | | | | | | | | | | | | | Layers require that drawing methods potentially draw in more than one bitmaps. To handle this this patch offers the following: - move all drawing methods to use Drawable - Drawables are now handled by GcSnapshot since its the one handling the layers - moved Canvas_Delegate.createCustomGraphics to GcSnapshot which does not expose the Graphics2D objects anymore so its draw() methods are the only way to draw. - handles creating layers in GcSnapshot.save() and blitting them in restore() Other changes: - Clean up the create/save API in GcSnapshot - Fixed drawing bitmaps with alpha and other composite modes. Change-Id: I1e230087493d044a10de71f4b6d29083e3f3bf64
* LayoutLib: Misc rendering fixes.Xavier Ducrohet2010-12-219-99/+155
| | | | | | | | | | | | | | | | | | | | | | - always set up the stroke. Paint may not have the proper style when drawing lines. stroke should still be setup. - Fixed vertical linear gradient. Old code generated a gradient ratio of NaN - Fixed alpha rendering when using shaders. In that case the alpha channel from the paint color should be used in conjunction with the shader. - Fixed miter limit. Java expects the value to be multiplied by the stroke width - Fixed support for drawing ALPHA_8 bitmaps. Java2D doesn't have bitmaps with only alpha channels, so we keep using ARGB bitmaps but when drawing them into a bitmap we erase the color information. Change-Id: I4f04341fc843e3f7dadd1fdbf709b11a4f1e24b9
* LayoutLib: support for Path and BitmapShader using delegates.Xavier Ducrohet2010-12-2124-801/+1890
| | | | | | | | | | 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.
* LayoutLib: Update layoutlib with revised API.Xavier Ducrohet2010-12-212-2/+2
| | | | Change-Id: I78929df621f48e85d9cbefe1f5590f9ce99bbaff
* LayoutLib: replace the stack of Graphics2D with custom snapshots.Xavier Ducrohet2010-12-153-114/+116
| | | | | | | | | | | | | The first step is to allow the canvas to save only the matrix or the clip. Previously, since the graphics2D were created completely new on each save, everything was saved. Also allows to set transform/clip on the Canvas when no bitmap has been set (and therefore no Graphics2D exists). This is required by BitmapFactory. Change-Id: I37eff6dde1ca708d58ba317b40e9b3236f3ef3d0
* Fix build break due to additional arg in Bitmap ctorPatrick Dubroy2010-12-141-1/+1
|
* LayoutLib: Fix gradient rendering.Xavier Ducrohet2010-12-146-64/+166
| | | | | | | | - fully support canvas transform - fully support shader local transform - fix repeat/mirror issue in the negative values. Change-Id: Ib2aa7ade1c2702da4364cbda9a5a3ae72c1d3174
* LayoutLib: Misc fix to rendering.Xavier Ducrohet2010-12-142-1/+2
| | | | Change-Id: Ia73fab1be3c01e6ce5791973e636e45a0f75ceb6
* LayoutLib: Use the new ninepatch API to suppor density.Xavier Ducrohet2010-12-131-1/+1
| | | | | | LayoutLib now compiles against a prebuilt of ninepatch. Change-Id: I0a1ca60af90933c171ab3aa456b47f0329df2f55