History log of /frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
684385ddde2ac0c26de0862390ad713aff3fb149 19-Sep-2012 Romain Guy <romainguy@google.com> mutate() didn't work as advertised
Bug #7162705

Change-Id: I15b2663fa7f1c71a2a3479134b8b7f37bfcbc607
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
5f49c3023a512efbef8bc9515d310c7a72be4af2 07-Sep-2012 Romain Guy <romainguy@google.com> The drawables cache strikes again
Bug #7117785

Draawables created from the ConstantState cache found in Resources must be
mutated before they can be safely modified by apps. Failure to do so results
in all drawables sharing the same constant state to be affected by the
modification.

In the case of the bugreport above, the status bar code plays tricks with
a background drawable and modifies its color to implement a fade in/out
effect. This drawable comes from a cached resource (color 0x0) and the
modifications made by the status bar apply to other clients of this drawable,
most notably the recents panel.

This change fixes several things:
- Simplifies colors caching by removing the assetCookie from the key. This
should result in better reuse of cached drawables
- Makes View.setBackgroundColor() honor the mutate() contract
- Ensure StateListDrawable properly mutates its children before modifying
them
- Optimize Bitmap/ColorDrawable to mark them mutated when they are not
created from an existing ConstantSate. The same optimization should be
applied to other drawables in the future

Change-Id: I54adb5d5b914c7d8930bf9b46f7e3f9dcbf4bcab
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
b03b434089cf2106c467b2827a65e5c589c91d01 04-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Revert "Revert "Clean up layout direction APIs for Drawable""

This reverts commit c96132ff53e5c26f5b0170edd85072006fb2bc70
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
c96132ff53e5c26f5b0170edd85072006fb2bc70 02-Jun-2012 Jean-Baptiste Queru <jbq@google.com> Revert "Clean up layout direction APIs for Drawable"

This reverts commit c1da65187a4b9de8f72bd617ef937030187c0a92.
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
c1da65187a4b9de8f72bd617ef937030187c0a92 01-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Clean up layout direction APIs for Drawable

- see bug #6427629

Change-Id: I3119db3022bba0ee325b6d0d4471bfebd850ec10
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
b1216dd916e0f5fdec29684120c5bcc904800916 02-Aug-2011 Romain Guy <romainguy@google.com> Copy constructors should actually copy stuff.
Bug #5027094

Change-Id: Iab6bf652e0b9bdd1bbc794e7c4218f46bafdd1a4
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
ad4f70306b2089a273635b73a101fe48aa36cbe2 22-Jun-2011 Chet Haase <chet@google.com> Fix flashing artifacts caused by invalidation bugs

Therea re 2 fixes here:
- We sometimes cleared a flag in ViewAncestor too soon that controlled
how invalidated areas were redrawn (related to whether the invalidates
happened on opaque views or not).
- TransitionDrawable was always setting/restoring alpha values on its
drawables every time it was drawn. setAlpha on BitmapDrawable causes
an invalidation, so essentially this was an infinite invalidation/redrawing
loop. The fix was to notice when the animation was done and to simply
draw the appropriate drawable[s].

Change-Id: I1849a5a909b0039a0e9bce0aa3cfc33c50f8f854
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
c0053223bedf33581b0830fb87be32c1f26e5372 13-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Add View.getResolvedLayoutDirection()

- update Callback2 interface
- update Gravity.getAbsoluteGravity() and Gravity.apply() to be more generic
by changing "boolean isRtl" parameter to "int layoutDirection"
- fix BiDiTests for RTL FrameLayout

Change-Id: I97bb456c22d5fd3ecb34f08564ce4dbed37e7459
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
6a03640539405afbdefe72894759281b98aa6e6f 23-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Add support for Gravity BEFORE and AFTER

- update layouts
- add Callback2 for RTL aware Drawable
- add unit tests

Change-Id: Ic64d0291e262170aff7297c6580b0b422eaa8d89
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
17f83df9604ef9239694e8fd5a9efb894fd28453 30-Apr-2011 Conley Owens <cco3@android.com> am 7dcdfd79: am f26ec38c: am 501f7bca: Merge "Eliminating dead logic - bitmap state simply cannot be null here."

* commit '7dcdfd7988d1e57c7a705a2d7294e8bfa2b8afc9':
Eliminating dead logic - bitmap state simply cannot be null here.
7dcdfd7988d1e57c7a705a2d7294e8bfa2b8afc9 29-Apr-2011 Conley Owens <cco3@android.com> am f26ec38c: am 501f7bca: Merge "Eliminating dead logic - bitmap state simply cannot be null here."

* commit 'f26ec38c344af8cf91575b461028a3033b940d49':
Eliminating dead logic - bitmap state simply cannot be null here.
e42143aa575dcb8ab0616080b2e9b4614a1a4167 19-Apr-2011 Jozef BABJAK <jozef.babjak@gmail.com> Eliminating dead logic - bitmap state simply cannot be null here.

Change-Id: I33fdf650b06242efa22ca30b3f7252f6854b42f6
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
2660a3ec8564918a243b1b02e3652c514bc93bfc 30-Mar-2011 Romain Guy <romainguy@google.com> Move the drawable state to the correct class.
Bug #4170455

The state tracking whether the Paint's shader should be rebuilt was kept in the
wrong class. This lead to the Drawable keeping track of the dirty status of the
Paint stored in the ConstantState. This of course does not work properly when
several drawables are inflated form the same ConstantState. This change fixes
the issue by moving the dirty Paint state to the ConstantState class. This is
allowed to work because of the single-thread rule enforced by the UI toolkit.

Change-Id: I9bb31d8e7335d6bb418470b59ae25d9085d7bd23
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
ee0c116ab2bd5acdfe50db36441cf4784d3a10b4 24-Mar-2011 Romain Guy <romainguy@google.com> Always apply the tile mode.
Bug #4170455

Change-Id: Id537a226a0b59bfa65b54bcea062aa5bf1a730b8
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
6efd2bad954e0e5bd74916a32f036a0f149dcd4d 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
8d71769b9bc3d0e72b26217d9059ce4473a91fe5 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
9891e1fce5f29d0421d34aa481037417bd70853d 11-Nov-2010 Chet Haase <chet@google.com> Add invalidation to Drawable when its properties change

invalidateSelf() already exists on Drawable. This triggers a call to
callback listeners so that they know the drawable has been invalidated.
For example, the background drawable on View will cause the View itself
to be invalidated.

Change-Id: I45b231a7600dcf3bc139e4059b7c9940ff49f60c
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
dfe5c204403bc56c29bb36410574eab8b1950417 09-Jun-2010 Scott Main <smain@google.com> docs: lots of additions to the resources docs
new drawable resources
add <merge> and <include> to layout resource
update drawable class descriptioons to point to resources guide
add ID resource type

Change-Id: I733eec50bb2671f28c9e6dd7dec14eb6586f5193
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
29e4a3c566f435c32f0b95e4ac8e8b33cac6faba 01-Oct-2009 Dianne Hackborn <hackbod@google.com> Update from API review.

Change-Id: I16b1c566f91167aac9615ac59dd297a154c828ea
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
ffff38420c8b4713470011b909ae2238b5675f7c 16-Sep-2009 Romain Guy <romainguy@android.com> Build the BitmapShader if it hasn't been built yet.

This was causing a bug in the InCall UI where the background would be stretched.

Change-Id: Ie25a7d09f4779f166e267b2f921d40441ce361d2
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
c2974809373697147cbe5754835cc871fb93aef1 14-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
211db4a2874f1a2d0e7a8cb8d33e81fa08801763 11-Sep-2009 Mike Reed <reed@google.com> change default for dither to true
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
4a51c20ce607c74914f90fd897f04080121ac13b 22-Aug-2009 Dianne Hackborn <hackbod@google.com> I am getting tired of the java doc warnings, so fix them.

Change-Id: I2205eebae419eaf4a0992c9f5b7cd807eb843fe1
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
11ea33471e1a14a8594f0b2cd012d86340dd3bd8 23-Jul-2009 Dianne Hackborn <hackbod@google.com> Allow for screen density drawables in compatibility mode.

This change allows us to use drawables that match the current screen
density even when being loaded in compatibility mode. In this case,
the bitmap is loaded in the screen density, and the bitmap and
nine-patch drawables take care of accounting for the density difference.

This should be safe for existing applications, for the most part, since
they shouldn't really be pulling the bitmap out of the drawable. For
the small rare chance of them breaking, it worth getting the correct
graphics. Also this will only happen when there is actually a resource
of the matching density, and no existing apps should have resources for
anything besides the default density (though of course all of the
framework resources will be available in the native density).

As part of this, the bitmap density API has been changed to a single
integer provider the DPI unit density.
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/graphics/java/android/graphics/drawable/BitmapDrawable.java