249 Commits

Author SHA1 Message Date
Mike Reed
1b22b97925 add hidden Options field for native allocations 2009-07-17 11:21:47 -04:00
Android (Google) Code Review
eabdb7c252 am 6b532800: Merge change 6478 into donut
Merge commit '6b5328006ff9e844713eb26b40621d72bee0bdd1'

* commit '6b5328006ff9e844713eb26b40621d72bee0bdd1':
  Fix ShapeDrawable.inflateTag() to accept proper dimension specs for padding
2009-07-08 10:45:52 -07:00
Phil Dubach
90cfa9df3f Fix ShapeDrawable.inflateTag() to accept proper dimension specs for padding
ShapeDrawable.inflateTag() handles the 'padding' tag with the standard
attributes android:left, etc.  The attribute values for these standard
attributes should be dimension specifications, e.g. '4dp'.
ShapeDrawable.inflateTag() was wrongly parsing the attribute values as plain
integers.
2009-07-08 09:43:49 -07:00
Brad Fitzpatrick
0f07b2c850 Lazily allocate the mBounds Rect in Drawable.
For background, see:
http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html

Thanks, Markus!
2009-07-07 12:38:50 -07:00
Android (Google) Code Review
fbc7c1a784 am 9848f11f: Merge change 5826 into donut
Merge commit '9848f11fd8788b985330183aeb83cc589b8b14ae'

* commit '9848f11fd8788b985330183aeb83cc589b8b14ae':
  Fix NullPointerException in NinePatch constructor
2009-07-01 17:27:46 -07:00
Android (Google) Code Review
0901c82336 am 91c91b74: Merge change 5817 into donut
Merge commit '91c91b74df12e40c31a50ecb807ac60bed2ccb58'

* commit '91c91b74df12e40c31a50ecb807ac60bed2ccb58':
  Replace indeterminate progress animated asset with new ones
2009-07-01 16:01:40 -07:00
Android (Google) Code Review
91a546d4a9 am 083928fe: Merge change 5718 into donut
Merge commit '083928fefde7060eb69f7f45cd8e2180efa9bfe1'

* commit '083928fefde7060eb69f7f45cd8e2180efa9bfe1':
  Fix NullPointerException in DrawableContainer.mutate()
2009-07-01 11:19:32 -07:00
Phil Dubach
54285f2cbf Fix NullPointerException in NinePatch constructor
NinePatch.mPaint may be null and most methods in this class handle
that case properly. However, the constructor which derives a new
NinePatch from an existing instance assumes that mPaint is non-null.
This results in an unexpected NullPointerException, for example when
attempting to call NinePatchDrawable.mutate() on an instance that was
created from a resource.

Small unrelated fix in same file: Remove unused private mRect member.
2009-06-30 13:19:48 -07:00
Romain Guy
b5537c4522 Replace indeterminate progress animated asset with new ones 2009-06-30 12:39:18 -07:00
Android (Google) Code Review
4658e8ece6 am 05ebcb51: Merge change 5609 into donut
Merge commit '05ebcb5172679a6c196cbf23d7174c04dd9f6ae0'

* commit '05ebcb5172679a6c196cbf23d7174c04dd9f6ae0':
  Update spinner's drawables. Clean up resources, pave the way for new animation.
2009-06-29 20:20:11 -07:00
Phil Dubach
6be507cc66 Fix NullPointerException in DrawableContainer.mutate()
DrawableContainerState.mDrawables is an array which may be only partially
filled, as can be seen in the constructor and the addChild() method.

DrawableContainer.mutate() wrongly assumed that the array does not contain
null references.
2009-06-29 18:31:17 -07:00
Romain Guy
f4f7046183 Update spinner's drawables. Clean up resources, pave the way for new animation. 2009-06-26 19:21:54 -07:00
Android (Google) Code Review
82c88fc3a7 am a2a60a21: Merge change 5142 into donut
Merge commit 'a2a60a215030ca2171bc59aaeeac4179816f0796'

* commit 'a2a60a215030ca2171bc59aaeeac4179816f0796':
  Fix NPE in GradientDrawable constructor
2009-06-24 15:33:29 -07:00
Phil Dubach
562bf17c6c Fix NPE in GradientDrawable constructor
The mColors member can be null, as can be seen in
GradientDrawable.setSolidColor() or the plain constructor. In that case, an NPE
will be thrown on attempts to derive a new GradientDrawable from the instance
using the private constructor GradientDrawable(GradientDrawable).

The problem also occurs when inflating a GradientDrawable from XML without
defining the start, center and end colors and then calling mutate() on the
instance.
2009-06-23 15:46:31 -07:00
Android (Google) Code Review
ce1311a3a0 am 766d7236: Merge change 4737 into donut
Merge commit '766d7236c84f636b816d71189e309e67db1f593a'

* commit '766d7236c84f636b816d71189e309e67db1f593a':
  Add prepareToDraw() to Bitmap for fixing http://b/issue?id=1907995.
2009-06-22 03:50:23 -07:00
Wei-Ta Chen
8cdcb12752 Add prepareToDraw() to Bitmap for fixing http://b/issue?id=1907995.
The function is used to rebuild any caches associated with the bitmap.
In the case of purgeable bitmaps, this call ensures that the pixels
are decoded for drawing, and therefore prefetching techniques
implemented by callers can be leveraged.
2009-06-22 18:01:47 +08:00
Android (Google) Code Review
903ccf479f am 2b1aed10: Merge change 4527 into donut
Merge commit '2b1aed1021fb472de83c4c0143f2c4452244a0af'

* commit '2b1aed1021fb472de83c4c0143f2c4452244a0af':
  Fix Canvas.finalize() for the case where the constructor throws an exception
2009-06-19 10:09:00 -07:00
Phil Dubach
4566b79736 Fix Canvas.finalize() for the case where the constructor throws an exception
before the native canvas instance was created.

If the canvas constructors throw an exception (because the bitmap passed in is
immutable or already recycled), the constructor terminates early without
allocating the native canvas instance. For the most part, that's okay, since
the Canvas instance will never be returned to the application.  However, the GC
will still call finalize() on the half-initialized Canvas.

The native methods for Canvas all assume that the canvas pointer passed down is
not null.
2009-06-17 18:26:32 -07:00
Marco Nelissen
984b5df383 Add support to BitmapFactory for decoding a bitmap from a MemoryFile FileDescriptor. 2009-06-17 14:07:53 -07:00
Wei-Ta Chen
683f3bed89 Unhide inInputShareable in BitmapFactory.Options.
The variable works together with inPurgeable, which has been unhidden in
https://android-git.corp.google.com/g/Gerrit#change,2870.
2009-06-04 11:42:14 -07:00
Wei-Ta Chen
eb949674fd Unhide inPurgeable in BitmapFactory.Options.
The correctness and effectiveness of the usage of the parameter are evaluated in:
https://android-git.corp.google.com/g/Gerrit#change,2768
2009-06-02 11:01:43 -07:00
Jean-Baptiste Queru
843ef36f7b donut snapshot 2009-05-20 11:28:04 -07:00
Ken Shirriff
60b88edea7 Fix typos. 2009-05-13 17:51:37 -07:00
Dirk Dougherty
33a31b314f AI 148752: Fix description of breakText() param.
BUG=1790234

Automated import of CL 148752
2009-05-12 18:47:45 -07:00
Android (Google) Code Review
807f23b2d8 Merge change 1057 into donut
* changes:
  * Add regoin scaling for transparent support
2009-05-12 15:45:25 -07:00
Mitsuru Oshima
b10f138e12 * Add regoin scaling for transparent support 2009-05-12 15:40:07 -07:00
Romain Guy
a87a132ebf Fixes #1847219. Add a new API to load fonts from arbitrary files: Typeface.createFromFile(String/File). 2009-05-12 13:22:18 -07:00
Romain Guy
83b2107c4d Fixes #1846038. DrawableContainer was wrongly returning its opacity by ignoring the visibility of the currently selected layer. This change simply reports a TRANSPARENT opacity if there is no currently selected layer of if the selected layer is not visible. Otherwise it reports the opacity computed by the state class. 2009-05-12 10:54:51 -07:00
Mitsuru Oshima
13735a255d Merge branch 'readonly-p4-donut' into donut 2009-04-28 18:13:25 -07:00
Mitsuru Oshima
8169daed2f AI 147976: Compatibility mode support. Part 2.
* Introduced ApplicationScale (may not be good name. CompatibilityScale? CanvasScale? Pls let me know if you have better idea)
  * Changes to RootView / SurfaceView
  - Makes the app believe it's running in the supported density/resolution.
  - Makes the window manager believe it's running at the right density/resolution.
  * Added methods to Rect/Event for scaling up/down.
  Known issues:
  * certain kind of images (such as nine patch for buttons) seesm to be loaded not by app, thus does not take the scale into account,
  which, in turn, is causing layout issue.
  * ZoomButton in MapView is rendered in wrong place
  * Transparent region on Surface is not correct
  * Specifying different densities in one process is not working.
  BUG=1770627

Automated import of CL 147976
2009-04-28 18:12:09 -07:00
Android (Google) Code Review
4924ae8d1f Merge change 618 into donut
* changes:
  Fixes #1816088. Avoid initializing empty Rects when they are useless, especially in Zygote.
2009-04-28 13:45:44 -07:00
Romain Guy
23bd84ce6c Fixes #1816088. Avoid initializing empty Rects when they are useless, especially in Zygote. 2009-04-28 10:42:45 -07:00
Mike Reed
caf0df1b7f Add call to (new) Canvas.freeCaches() in response to low-memory
This is in conjunction with removing a similar call made by the browser.
Now it will be centralized, and the browser's call site will be removed.
2009-04-27 14:32:05 -04:00
Brad Fitzpatrick
7bc2202d9a Lazily allocate the mBounds Rect in Drawable.
For background, see:
http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html

Thanks, Markus!
2009-04-27 11:05:45 -07:00
Android (Google) Code Review
1fb758e94b Merge change 546 into donut
* changes:
  Add (hidden for now) purgeable bitmaps
2009-04-27 05:31:19 -07:00
Mike Reed
c70e06bbfa Add (hidden for now) purgeable bitmaps
BitmapFactory::Options now let you specify if the resulting bitmap can be
"purgeable". If so, then its decoded pixels may be purged when not actively
being drawn, freeing up that RAM. When such a bitmap is drawn, it will
automatically be re-decoded on demand. This is done by having the bitmap
keep a reference/copy of the encoded data.

Where it is a reference or a copy is controlled by the "shareable" flag in
Options. If this is true, the implementation *may* just reference the encode
data (e.g. a file descriptor) rathern than making a complete copy of it.

Currently, purgeable is not supported for generic inputstreams, but is
enabled for byte-array, file-descriptor, and assets, though for impl
reasons only file-descripts are currently enabled for "shareable", but that
may change in the future.
2009-04-24 17:20:29 -04:00
Dianne Hackborn
1d442e0d99 More optimization of dumpsys output.
There are three major classes of changes here:

- Avoid writing lines where their values are often empty, false, or some other typical thing.
- Use partial writes to the PrintWriter to avoid creating temporary strings.
- Use StringBuilder where we need to generate real String objects (and where possible cache the result).
2009-04-22 18:03:21 -07:00
The Android Open Source Project
c39a6e0c51 auto import from //branches/cupcake/...@137873 2009-03-11 12:11:56 -07:00
The Android Open Source Project
4df2423a94 auto import from //depot/cupcake/@136594 2009-03-05 14:34:35 -08:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
076357b856 auto import from //depot/cupcake/@132589 2009-03-03 14:04:24 -08:00
The Android Open Source Project
3dec7d563a auto import from //depot/cupcake/@137055 2009-03-02 22:54:33 -08:00
The Android Open Source Project
da996f390e auto import from //branches/cupcake/...@131421 2009-02-13 12:57:50 -08:00
The Android Open Source Project
d24b8183b9 auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
f1e484acb5 auto import from //branches/cupcake/...@127436 2009-01-22 00:13:42 -08:00
The Android Open Source Project
b798689749 auto import from //branches/cupcake/...@125939 2009-01-09 17:51:23 -08:00
The Android Open Source Project
f013e1afd1 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00