History log of /frameworks/base/graphics/java/android/graphics/Bitmap.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1373a8eb581fe3c8e9a036e69042015f98a7e346 11-Nov-2011 Christopher Tate <ctate@google.com> Localized optimizations in views and bitmaps

* Don't call context.getResources() redundantly when unnecessary;
similarly for Resources.getCompatibilityInfo()

* During bitmap creation, don't bother clearing to 0: it's unnecessary
because now that the raw bits are stored in a VM-side byte array, it
was cleared at initialization time. Also, don't use the sanity-
checking public entry point to erase to a color, because we know
that we're by definition in a "legal" path to erase to the initial
contents and don't need to incur the overhead of the (inappropriate)
sanity checking.

Change-Id: Idaca4d64fdecefd5d51337646ead32e1db510e02
/frameworks/base/graphics/java/android/graphics/Bitmap.java
b6377170960d40e66858d8b4d335a95eac773762 25-Sep-2011 Bart Sears <bsears@google.com> Revert "Transfer large bitmaps using ashmem. Bug: 5224703"

This reverts commit 56c58f66b97d22fe7e7de1f7d9548bcbe1973029

This CL was causing the browser to crash when adding bookmarks, visiting the bookmarks page, and sharing pages (see bug http://b/issue?id=5369231
/frameworks/base/graphics/java/android/graphics/Bitmap.java
56c58f66b97d22fe7e7de1f7d9548bcbe1973029 24-Sep-2011 Jeff Brown <jeffbrown@google.com> Transfer large bitmaps using ashmem.
Bug: 5224703

Change-Id: Ic7481dd9f173986f085a8bbdcc59bbe9830d7a44
/frameworks/base/graphics/java/android/graphics/Bitmap.java
7f9f99ea11051614a7727dfb9f9578b518e76e3c 11-Aug-2011 Xavier Ducrohet <xav@android.com> Make some methods/fields package private so that layoutlib can access them.

Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
/frameworks/base/graphics/java/android/graphics/Bitmap.java
6311d0a079702b29984c0d31937345be105e1a5e 03-Aug-2011 Dianne Hackborn <hackbod@google.com> Clear the bitmap from the canvas in a lot of places.

Change-Id: I6b2071ac7b348c473b9bdd1b972d095aebbb4fb3
/frameworks/base/graphics/java/android/graphics/Bitmap.java
ec5039b3720ee9b92fb2a2c6dd9f468d2dcd7172 24-Jun-2011 Jean-Baptiste Queru <jbq@google.com> am 99c070d8: am 4fea5373: Merge "Add WEBP to the list of Image formats that support Compression."

* commit '99c070d8eb9f1ff9ea5c38991f15f091040226c2':
Add WEBP to the list of Image formats that support Compression.
2305ac9e4a262ed09fd034ae417e9b1dda4c0ccb 23-Jun-2011 Vikas Arora <vikasa@google.com> Add WEBP to the list of Image formats that support Compression.

Note: The integrator of this change to Android internal code-repo will
have to run one extra step 'make update-api' to update 'api/current.txt'
file corresponding to approved API. The AOSP branch didn't have this
file, hence I could not add the same to this change. The updated file
'api/current.txt' has to be submitted along with this change.

Change-Id: I29909e907a2e82d801e16654322190a808c5bda9
/frameworks/base/graphics/java/android/graphics/Bitmap.java
f7f9d9c39df22ad6929f001f07588469f77e8bf5 17-Feb-2011 Jesse Wilson <jessewilson@google.com> Expose an API to get a bitmap's size in bytes.

Change-Id: I960c3b02b1ba8d3a8d92aaa98955a159e6f3a228
http://b/3184897
/frameworks/base/graphics/java/android/graphics/Bitmap.java
676b17391fb6583e5df944c36b1bd4c1be835689 14-Feb-2011 Romain Guy <romainguy@google.com> Deprecate ARGB_4444.

It looks awful.
Don't use it.
Use ARGB_8888, it's much better.
If you think you need ARGB_4444, you are wrong.
You are.

Change-Id: I4d6963cf98b6a8fb34cebcd0d24b9fd66b5a0fbf
/frameworks/base/graphics/java/android/graphics/Bitmap.java
366a84056c9a695ee6702d9d30bf9f3b521ba7cc 08-Feb-2011 Romain Guy <romainguy@google.com> Expose several useful Bitmap APIs.
Bug #3408073

Bitmap.setHasAlpha() in particular is very useful for applications that use
ARGB_8888 bitmaps but want/need to benefit from an extra speed boost.

Change-Id: I73d081b7e43bd725baffd1a9892c72d8729816f7
/frameworks/base/graphics/java/android/graphics/Bitmap.java
feeea8f07c854e6b0ae2fec3aa2d239c17f32b5b 01-Feb-2011 Romain Guy <romainguy@google.com> Assume ARGB_8888 for unknown configs.
Bug #3327175

Change-Id: If712a255ec65014cd2e007de1e4c6a1d67c19250
/frameworks/base/graphics/java/android/graphics/Bitmap.java
f6a362a5f65c1470399d869f0c39caac40e561a3 01-Feb-2011 Romain Guy <romainguy@google.com> Don't convert 4444 images to 565.
Bug #3327175

Change-Id: I46d970e41947278f4c2476b347fd2403fe9a05e8
/frameworks/base/graphics/java/android/graphics/Bitmap.java
a383b3f646cbc1fd870f2694d4fac24340834916 21-Jan-2011 Patrick Dubroy <dubroy@google.com> Update Bitmap.recycle() doc for heap-allocated pixel data
/frameworks/base/graphics/java/android/graphics/Bitmap.java
2361098da3b9d9c3eeed410dc72ba62c0e9177cf 17-Jan-2011 Romain Guy <romainguy@google.com> Add BitmapFactory.Options.inMutable to load mutable bitmaps.

Change-Id: Iaa222127520f3aa55072d44af12ee3477908b876
/frameworks/base/graphics/java/android/graphics/Bitmap.java
e4ac2d6b5723c95e648c489b187ddde449452c13 01-Dec-2010 Patrick Dubroy <dubroy@google.com> Allocate bitmap backing buffers in the Java heap.

Change-Id: I60f6ccff13357c1c518e9d56b02fe0171637edd1
/frameworks/base/graphics/java/android/graphics/Bitmap.java
5e9f64ce24b3381ee48f9e12242aba5216f136a4 04-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> am b12bfbd4: am eb6e22f2: Merge "Document Bitmap.createScaledBitmap" into gingerbread

Merge commit 'b12bfbd4df985041ab0e584ef5a746328baac038'

* commit 'b12bfbd4df985041ab0e584ef5a746328baac038':
Document Bitmap.createScaledBitmap
02d9102b3bdebac6989c2b7d12c080fb7c1f8e2b 04-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> Document Bitmap.createScaledBitmap

Change-Id: Ife6a42bc08d17c56274e78a1f5d2c100c2fe4dc8
/frameworks/base/graphics/java/android/graphics/Bitmap.java
d90f23e24a4d1768d5a7ed0e7072e67af6330a45 09-Sep-2010 Romain Guy <romainguy@google.com> Do not convert 8888 bitmaps to 565 when doing a copy.

Bug #2988077
This change keeps the 8888 format for new bitmaps and also keeps,
when possible, the opaque flag.

Change-Id: Ia61f2e89936916b329212a4c59a7d815c329f84e
/frameworks/base/graphics/java/android/graphics/Bitmap.java
601ede9aa3337bb6d54dfb0633b54835421b5720 21-Aug-2010 Chih-Chung Chang <chihchung@google.com> Revert "Don't recycle native bitmap after the finalizer is called."

Bitmap should not be accessed from multiple threads.

This reverts commit 966803ab81f8e9bfefa502fcb533de023825a389.
/frameworks/base/graphics/java/android/graphics/Bitmap.java
966803ab81f8e9bfefa502fcb533de023825a389 20-Aug-2010 Chih-Chung Chang <chihchung@google.com> Don't recycle native bitmap after the finalizer is called.

If an object A's finalizer calls Bitmap B's recycle() when B's
finalizer is already called, we will have trouble because the
native bitmap is already freed in the finalizer.

Change-Id: Ic0be8ed75fb3aacee9ce6e3d9908178a55151eb9
/frameworks/base/graphics/java/android/graphics/Bitmap.java
02890fd0f98b3b8d98baf0bda1ea906afd723d8b 07-Aug-2010 Romain Guy <romainguy@google.com> Replace Bitmap's finalizers with PhantomReferences.

This change also removes the use of SoftReferences for View's
drawing cache.

A bitmap now creates a PhantomReference enqueued in a reference
queue provided by the new Finalizers class. This queue is polled
from a thread started after forking zygote. That thread is in charge
of clearing the references after GC runs and of calling reclaim()
on them. The reclaim() method is now how finalizers are run.

Note that a PhantomReference cannot be kept in the instance it
refers to, which is why they are kept in a separate List.

Change-Id: If3c1a5e9dc23fa49e34857860d730f5cf5ad5926
/frameworks/base/graphics/java/android/graphics/Bitmap.java
ce0537b80087a6225273040a987414b1dd081aa0 30-Jun-2010 Romain Guy <romainguy@google.com> Add hooks for drawBitmap().

Change-Id: I58e962c3a8b2bc75c2605fe369ad3002579d86e0

Add texture cache.

Change-Id: I1c0e5581d228869e114438258a1014e33e024ad7
/frameworks/base/graphics/java/android/graphics/Bitmap.java
0bbae0836426ba2704e38e7f90a9d0ca502ab71d 16-Jun-2010 Romain Guy <romainguy@google.com> Add new API to check whether a Bitmap was modified.

Bitmap.getGenerationId() can be used by caches to find out if a Bitmap has been
modified. This simply exposes an existing Skia API.

This change also adds a small test app for Canvas hardware acceleration. The new
Bitmap API is required to implement a texture cache.

Change-Id: I8547b146cd14c8afe1a2327fcd6d71b1b1cb68fc
/frameworks/base/graphics/java/android/graphics/Bitmap.java
76d1e01d5e65c4631c827831e98ad4e300d99eab 05-Mar-2010 Mike Reed <reed@google.com> hidden api sameAs() to compare the pixels of 2 bitmaps for equality
/frameworks/base/graphics/java/android/graphics/Bitmap.java
a78b0a2d9ebb38b86ed802b3d86de07d0b301262 07-Oct-2009 Mike Reed <reed@google.com> add (hidden) setHasAlpha() to allow clients like the view's cache to hint that a bitmap is opaque.

Knowing that a 32bit bitmap is opaque is a performance boost for some blits.
/frameworks/base/graphics/java/android/graphics/Bitmap.java
de0dfb7b65a02d4dd74c271b558adee0973fc267 23-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2125720 Weather Forecast Widget - graphics do not scale

I forgot to add the new density field to the Bitmaps' parcelable data.

Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
/frameworks/base/graphics/java/android/graphics/Bitmap.java
96e240f25a97c10bba863df328ed73a82c34ff61 27-Jul-2009 Dianne Hackborn <hackbod@google.com> Fiddle with default densities to try to sanitize the API.

An issue with the density API is that bitmaps assumed the old default density,
so new programs would have to explicitly set the correct density for every bitmap
they create.

This is an attempt to fix that situation, by define the default density of bitmaps
to be the main screen's density, except for old apps where it is the original default
density.

Actually implementing this is not so great, though, because the Bitmap constructors
can't really know anything about who is calling them to know which density to use.
So at this level the compatibility mode is defined per-process -- meaning the initial
package loaded into a process defines the default bitmap density, and everyone else
loaded in later on has to live with that.

In practice this shouldn't be much of a problem, there shouldn't be much mixing of
old vs. new apps in a process. It does mean that, going forward, if a developer is
going to use shared user IDs for this, they will need to make sure either that all of
their apps are in the same compatibility mode, or that their code explicitly sets the
density of bitmaps it receives. This isn't all that great, but I think it is worth
the benefit of allowing people who write modern apps to not have to deal with bitmap
densities.

This change also does some cleanup of the density management (making sure to always
copy over bitmap densities, etc) and adds java docs to explain the various ways
density is set and used by the system.
/frameworks/base/graphics/java/android/graphics/Bitmap.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/Bitmap.java
2784ff0af88128f66ae690b73d48fb7e4a211e68 19-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix issue where scaled bitmap sizes could be wrong.

The Bitmap functions to get the scaled width/height couldn't actually
do the right thing because they didn't know the destination they would
be drawing to. Now there are two forms of them, taking an explicit
parameter specifying the destination.
/frameworks/base/graphics/java/android/graphics/Bitmap.java
a53b828635fce8b6b2d3e3377d74d72070056623 17-Jul-2009 Dianne Hackborn <hackbod@google.com> Add "nodpi" density, and expose a bunch of density-related APIs.

Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
/frameworks/base/graphics/java/android/graphics/Bitmap.java
8cdcb12752b716d0407733fecefcf1d9e926310a 18-Jun-2009 Wei-Ta Chen <weita@google.com> 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.
/frameworks/base/graphics/java/android/graphics/Bitmap.java
60b88edea7132ddce90f2dced07c6706f1502270 14-May-2009 Ken Shirriff <kens@google.com> Fix typos.
/frameworks/base/graphics/java/android/graphics/Bitmap.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/Bitmap.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/Bitmap.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/Bitmap.java
f1e484acb594a726fb57ad0ae4cfe902c7f35858 22-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@127436
/frameworks/base/graphics/java/android/graphics/Bitmap.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/graphics/java/android/graphics/Bitmap.java