305 Commits

Author SHA1 Message Date
Dianne Hackborn
dd4a1e3825 am 7d234fab: Merge "Don\'t drop the drawable cache completely on configuration change"
* commit '7d234fabe61cd5f034fe4ff4484209fbf5130c4d':
  Don't drop the drawable cache completely on configuration change
2011-01-14 16:11:40 -08:00
Christopher Lais
8d71769b9b 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
2011-01-14 00:43:16 -06:00
Wei-Ta Chen
62cd5c9788 am 61d9ffbf: Merge "Do not merge." into gingerbread
* commit '61d9ffbfd86dfe6bacce431b8ed9eebe1cfd8178':
  Do not merge.
2011-01-13 12:06:38 -08:00
Wei-Ta Chen
25bce3a673 Do not merge.
Backport changes related to BitmapRegionDecoder from HoneyComb to
Gingerbread.

Bug: 3309014

////////////////////////////////////////////////////
This is a combination of 7 commits.
Revert "Do not merge."

This reverts commit f7681f84918c27f6a626681ce37ed2a236c44e82.

Change-Id: I46fd710600b1649773eaea2d9abc2b21a592f9a6

Fix a initialization bug in BitmapRegionDecoder.

Change-Id: I6c1151fd34970a84d4de52d664d9a5dc464892c5

Fix segfault when tring to throw IOException.

Change-Id: I530cc4409ba4ca17cec933afad077c5f60ba554f

Fix 3122139, where previewing an attachment for the second time will
fail.

Use AutoFDSeek to mark and restore the position before we read data from
the descriptor.

Change-Id: I3d4f012dce486e19b113bc90a98b94031cfa8195

Add inPreferQualityOverSpeed into BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925
Change-Id: I93d55b7226e47a43e639325cd1a677694d6f2ee4

Unhide inPreferQualityOverSpeed in BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925

Related changes: https://android-git.corp.google.com/g/#change,83291 and
                 https://android-git.corp.google.com/g/#change,83294

Change-Id: I969f5c413f9b2179454aeb90e18ae8222ee583b4

Correct the API comments.

BitmapRegionDecoder supports PNG as well.
2011-01-11 22:54:10 -08:00
Brad Fitzpatrick
3a2c6bf0fc am 69ea4e15: Documentation fixes found over vacation hacking.
* commit '69ea4e15e52c456537575d21443ac1efdb03a902':
  Documentation fixes found over vacation hacking.
2011-01-05 13:52:53 -08:00
Brad Fitzpatrick
69ea4e15e5 Documentation fixes found over vacation hacking.
Change-Id: I28900026465d66d950cf4f05f0c202b46c3c2d43
2011-01-05 13:07:34 -08:00
Brad Fitzpatrick
b12bfbd4df am eb6e22f2: Merge "Document Bitmap.createScaledBitmap" into gingerbread
Merge commit 'eb6e22f29ded58e7e51702c34878fd01e20ff802' into gingerbread-plus-aosp

* commit 'eb6e22f29ded58e7e51702c34878fd01e20ff802':
  Document Bitmap.createScaledBitmap
2010-10-04 12:23:58 -07:00
Brad Fitzpatrick
02d9102b3b Document Bitmap.createScaledBitmap
Change-Id: Ife6a42bc08d17c56274e78a1f5d2c100c2fe4dc8
2010-10-04 10:52:18 -07:00
Brad Fitzpatrick
3d019a374f am 83d52229: Doc fix: duplicate word \'of\'
Merge commit '83d522290e56f614d0d9373d47c2b54b9e207795' into gingerbread-plus-aosp

* commit '83d522290e56f614d0d9373d47c2b54b9e207795':
  Doc fix: duplicate word 'of'
2010-10-03 21:13:51 -07:00
Brad Fitzpatrick
83d522290e Doc fix: duplicate word 'of'
Change-Id: I45a4ca443becc2f2cf02cbca2bd61ef2ee590b5c
2010-10-03 21:07:21 -07:00
Wei-Ta Chen
eeac43ad3c am f7681f84: Do not merge.
Merge commit 'f7681f84918c27f6a626681ce37ed2a236c44e82' into gingerbread-plus-aosp

* commit 'f7681f84918c27f6a626681ce37ed2a236c44e82':
  Do not merge.
2010-10-01 12:36:05 -07:00
Wei-Ta Chen
f7681f8491 Do not merge.
Fix 3052285 by not publishing the BitmapRegionDecoder API until the honeycomb release.

Bug: 3052285
Change-Id: Ie339e414c1a5581e1d38684621e0e97162616977
2010-10-01 12:16:38 -07:00
Sonia Serafimova
d45a33554c Prevent unhandled exception in NinePatchDrawable
Added null check in computeBitmapSize() to avoid unhandled
exception "java.lang.NullPointerException" at
android.graphics.Rect.<init>(Rect.java:72).

This problem was discovered in the wild.

Change-Id: I9d40629a052f1390e1811288af6209d8cc3f679b
2010-09-26 09:07:02 -07:00
Jean-Baptiste Queru
ca3f968c6f am 7d9c73fb: Merge "Prevent unhandled exception in NinePatchDrawable"
Merge commit '7d9c73fb6f6f79f7f92b77482a0edbd7b89f2564' into gingerbread-plus-aosp

* commit '7d9c73fb6f6f79f7f92b77482a0edbd7b89f2564':
  Prevent unhandled exception in NinePatchDrawable
2010-09-26 08:39:03 -07:00
Wei-Ta Chen
ac487f708f am 6b849e21: Unhide BitmapRegionDecoder.
Merge commit '6b849e2123be98eb2a1a25b8abf0b13a279ce952' into gingerbread-plus-aosp

* commit '6b849e2123be98eb2a1a25b8abf0b13a279ce952':
  Unhide BitmapRegionDecoder.
2010-09-22 23:03:30 -07:00
Wei-Ta Chen
6b849e2123 Unhide BitmapRegionDecoder.
1. Rename LargeBitmap to BitmapRegionDecoder
2. Move the instantiations of BitmapRegionDecoder out of BitmapFactory.
3. Remove the use of MemoryFile in BitmapRegionDecoder, since MemoryFile's API had been modified in master. Otherwise, the change will break the master build.
4. Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Most of the modifications, except for (2) and (3), were reviewed in https://android-git.corp.google.com/g/#change,64716 .
However, that change broke the master build due to (3) and was reverted eventually.
So, instead of withdrawing this change and waiting for that change to be checked in again, I merge the two changes into one.

Change-Id: I2202c0fbbbd6d6676bbd9637e690023ea4099c40
2010-09-23 13:56:52 +08:00
Sonia Serafimova
279d006b1d Prevent unhandled exception in NinePatchDrawable
Added null check in computeBitmapSize() to avoid unhandled
exception "java.lang.NullPointerException" at
android.graphics.Rect.<init>(Rect.java:72).

This problem was discovered in the wild.

Change-Id: I8a4729ceadcfc9744f11b8ceafdf24d6de88c645
2010-09-15 13:22:43 +02:00
Joseph Wen
94db0238a3 am 219eb7ec: Merge "Fix bug in JNI BitmapFactory" into gingerbread
Merge commit '219eb7ec8403ef9b98125f2b58cc27669ae69712' into gingerbread-plus-aosp

* commit '219eb7ec8403ef9b98125f2b58cc27669ae69712':
  Fix bug in JNI BitmapFactory
2010-09-10 02:35:50 -07:00
Joseph Wen
2dcfbefbbe Fix bug in JNI BitmapFactory
In nativeCreateLargeBitmapFromFileDescriptor() if the file descriptor
can not be rewinded isShareable should be set to false.

Change-Id: I7dd545c9d52d21c226e11b8921e35a1d9bba9515
2010-09-10 17:24:15 +08:00
Wei-Ta Chen
8fc6f8b215 am 1b214be9: Merge "Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."" into gingerbread
Merge commit '1b214be92ac206d8ac6ef4967db6e2859d91ab49' into gingerbread-plus-aosp

* commit '1b214be92ac206d8ac6ef4967db6e2859d91ab49':
  Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
2010-09-07 21:48:48 -07:00
Wei-Ta Chen
340ce75b44 Revert "Rename LargeBitmap to BitmapRegionDecoder for having a better API."
This reverts commit 50ba3d2c09a9131f3578d271adf2bc8258ca1742.
2010-09-08 10:44:21 +08:00
Wei-Ta Chen
a295a3908b am b356f8ac: Merge "Rename LargeBitmap to BitmapRegionDecoder for having a better API." into gingerbread
Merge commit 'b356f8acec9fdfd36f01e5cca4fe3a28ecd6e628' into gingerbread-plus-aosp

* commit 'b356f8acec9fdfd36f01e5cca4fe3a28ecd6e628':
  Rename LargeBitmap to BitmapRegionDecoder for having a better API.
2010-09-07 17:07:12 -07:00
Wei-Ta Chen
50ba3d2c09 Rename LargeBitmap to BitmapRegionDecoder for having a better API.
Move AssetStreamAdaptor, AutoFDSeek and nullObjectReturn to Utils.h because
BitmapFactory.cpp and BitmapRegionDecoder.cpp both need to use these utility functions.

Change-Id: I3e60c7fe4abd0289e1384e69a08fd20fe6fb0e10
2010-09-07 21:02:13 +08:00
Chih-Chung Chang
d51a933b94 am 72ecb00a: Merge "Revert "Don\'t recycle native bitmap after the finalizer is called."" into gingerbread
Merge commit '72ecb00a89b7a49eadb9c3bb880102eef97c8eb6' into gingerbread-plus-aosp

* commit '72ecb00a89b7a49eadb9c3bb880102eef97c8eb6':
  Revert "Don't recycle native bitmap after the finalizer is called."
2010-08-22 04:31:38 -07:00
Chih-Chung Chang
601ede9aa3 Revert "Don't recycle native bitmap after the finalizer is called."
Bitmap should not be accessed from multiple threads.

This reverts commit 966803ab81f8e9bfefa502fcb533de023825a389.
2010-08-22 00:23:18 +08:00
Romain Guy
5a14271aac am d6f7f225: Merge "Load bitmaps in the correct format." into gingerbread
Merge commit 'd6f7f225689ecd33dc54699acc01cfafc781c20d' into gingerbread-plus-aosp

* commit 'd6f7f225689ecd33dc54699acc01cfafc781c20d':
  Load bitmaps in the correct format.
2010-08-20 15:45:09 -07:00
Romain Guy
f92a0a6d4e Load bitmaps in the correct format.
Bug #2936873

Change-Id: Ide93ffd8227cea6c610dde625163ccffb4590e90
2010-08-20 15:43:52 -07:00
Chih-Chung Chang
3a59ddc67c am dc2eabd1: Merge "Don\'t recycle native bitmap after the finalizer is called." into gingerbread
Merge commit 'dc2eabd10847d8e7f016fec5232d40b723ce2828' into gingerbread-plus-aosp

* commit 'dc2eabd10847d8e7f016fec5232d40b723ce2828':
  Don't recycle native bitmap after the finalizer is called.
2010-08-20 03:56:33 -07:00
Chih-Chung Chang
966803ab81 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
2010-08-20 17:10:49 +08:00
Gilles Debunne
a842d143d2 am d018a0ce: Merge "Text selection without trackball." into gingerbread
Merge commit 'd018a0ce72124f668d859b19fe3e73f5637d3c7c' into gingerbread-plus-aosp

* commit 'd018a0ce72124f668d859b19fe3e73f5637d3c7c':
  Text selection without trackball.
2010-08-19 18:01:20 -07:00
Gilles Debunne
d018a0ce72 Merge "Text selection without trackball." into gingerbread 2010-08-19 17:59:08 -07:00
Gilles Debunne
b0d6ba1ec4 Text selection without trackball.
Backported from HC.

Squashed commit of the following:

commit af214a595c7a9fdd11a2dc384f7d4665abf751c0
    Fixes in TextView's selection.

commit eb9fd59ebe6500a66c2003d46b5802299970ae8d
    TextView with Selection Contextual Mode

commit 4c4c338ef355b369ce4b57d6c6fba7ee8f9dddf4
    Cosmetic changes around TextView.

commit d4b4b054e87480d984ad18766f5e76553e3080d8
    Double and one and a half tap removed from TextView.

commit 897c2847ba1fca8ef01eadadd1bc3de007af3ee5
    Selection handlers in TextView

commit 832be74a5394649e28927484d9a86c6d53b430e7
    New cursor controller in TextViews.

Change-Id: I01cc64736e2abea605317ee53907a1713617fc17
2010-08-19 15:55:02 -07:00
Romain Guy
d88e0680ed am 288471d8: DO NOT MERGE. Load assets in place instead of deferring until draw.
Merge commit '288471d8a57e1c318742cbfc28697877436fdb87' into gingerbread-plus-aosp

* commit '288471d8a57e1c318742cbfc28697877436fdb87':
  DO NOT MERGE. Load assets in place instead of deferring until draw.
2010-08-19 15:06:50 -07:00
Romain Guy
288471d8a5 DO NOT MERGE. Load assets in place instead of deferring until draw.
Before this change, all framework assets would be decoded at drawing time
outside of zygote. This was forcing all apps to re-decode the assets and
zygote to keep an in-memory copy of each asset. This behavior is now
opt-in by setting the inPurgeable flag on BitmapFactory.Options.

Change-Id: Ief823139163d8071b8ee1267746622faf52eb8ec
2010-08-19 15:02:31 -07:00
Joseph Wen
81dcea6093 am f1f48bc7: Do JPEG tile-based decoding.
Merge commit 'f1f48bc7f200f54c76b22d845d8ba8419879b375' into gingerbread-plus-aosp

* commit 'f1f48bc7f200f54c76b22d845d8ba8419879b375':
  Do JPEG tile-based decoding.
2010-08-17 00:31:34 -07:00
Joseph Wen
f1f48bc7f2 Do JPEG tile-based decoding.
Change-Id: I5c1b4ac3c02eb4350ef0ba9a7877b22cfd730cfb
2010-08-17 14:34:02 +08:00
Scott Main
4fd416880e am 5352d237: am 38137d7a: Merge "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" into froyo
Merge commit '5352d2378d2f92ebe0657e4caedb4498492fc404' into gingerbread-plus-aosp

* commit '5352d2378d2f92ebe0657e4caedb4498492fc404':
  docs: lots of additions to the resources docs
2010-07-15 11:23:08 -07:00
Scott Main
5352d2378d am 38137d7a: Merge "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" into froyo
Merge commit '38137d7a27b037611c70a9d900aa53b4c15563bf' into gingerbread

* commit '38137d7a27b037611c70a9d900aa53b4c15563bf':
  docs: lots of additions to the resources docs
2010-07-15 11:20:32 -07:00
Mathias Agopian
98704f14ea am 38eea8bf: Merge "Remove the YV16 format for simplicity\'s sake." into gingerbread
Merge commit '38eea8bf990540360b45b963195a7766c30b55d2' into gingerbread-plus-aosp

* commit '38eea8bf990540360b45b963195a7766c30b55d2':
  Remove the YV16 format for simplicity's sake.
2010-07-14 16:35:55 -07:00
Mathias Agopian
058d0390a4 Remove the YV16 format for simplicity's sake.
Change-Id: Iee03d100933ba0c67b13d51e0435be3b4cd953cf
2010-07-14 15:12:05 -07:00
Scott Main
dfe5c20440 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
2010-06-21 15:19:23 -07:00
The Android Open Source Project
cefdedc369 merge from froyo-plus-aosp
Change-Id: I58f1d905b3fa781e4f5827d4d7b9323a4cdcc04e
2010-06-07 16:42:09 -07:00
The Android Open Source Project
c1038e778f merge from open-source master
Change-Id: I1a36964a723bce72139f1bc2402520b7f8d5e47b
2010-06-07 16:37:22 -07:00
Erik Faye-Lund
92ce5734b5 Canvas.drawVertices: correct color range-check
The range-check in drawVertices previously checked that the color
count was equal to the vertex count. However, the vertex count is
specified in array elements, and there's two array elements per
vertex for the positions, but only one array element per vertex
for the colors.

Correct the code so the check is consistent with the element count.

Change-Id: Id043f1003f9245f18adc91bac49dc33727ca765e
2010-06-02 23:47:01 +02:00
Peter Eliasson
417675cab0 Improved error handling when font loading fails.
Without this patch, an application could trigger a platform crash
by calling:

  Typeface typeface = Typeface.createFromFile("");
  boolean isbold = typeface.isBold();

The crash occurs since the Skia error that occurs when font loading
fails is not propagated.
With this patch, the Typeface constructor throws an
IllegalStateException when Skia fails to load the font (i.e. when
the native instance is null).

Change-Id: I1002b37b7b32840cb7eeef6819d2982cb18c9003
2010-04-26 12:32:40 +02:00
Mathias Agopian
8b138323d5 don't hardcode "mSurface" throughout our source code
this is used in a few places to get access to the android.view.Surface
native surface. use a macro instead. Also rename the field to mNativeSurface.

Change-Id: I1c6dea14abd6b8b1392c7f97b304115999355094
2010-04-12 16:29:36 -07:00
Brett Chabot
16d77b8d42 am c162668e: Merge "More framework tests cleanup." into froyo
Merge commit 'c162668e870cda9d336741f24c177cd925fef8e0' into froyo-plus-aosp

* commit 'c162668e870cda9d336741f24c177cd925fef8e0':
  More framework tests cleanup.
2010-04-01 21:50:00 -07:00
Brett Chabot
0dc59e78e1 More framework tests cleanup.
Move all tests for android.* classes from tests/AndroidTests and
tests/CoreTests into framework/base/<core|graphics>/tests.

Consolidate all tests for java.* classes to tests/CoreTests.
Eventually hopefully these will be moved to dalvik/ somewhere.

Remove tests/AndroidTests entirely.

Change-Id: I86584d086ab7bd045bb38a10b699907805298a95
2010-04-01 18:31:11 -07:00
The Android Open Source Project
b7248b7b81 merge from open-source master
Change-Id: Iad50c5ab4915d0868b3f79ea6ba0d657a6f98525
2010-03-30 11:13:47 -07:00
The Android Open Source Project
5849606df7 merge from open-source master
Change-Id: I6a7542e696e69bc8788f3b3b77fcec50512ba81c
2010-03-29 11:04:30 -07:00