• Home
  • History
  • Annotate
  • only in /packages/apps/UnifiedEmail/src/com/android/bitmap/
History log of /packages/apps/UnifiedEmail/src/com/android/bitmap/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1720626d328003884855097a58ae379e450bde09 20-Aug-2013 Andy Huang <ath@google.com> fix possible duplicate images from bitmap recycling race condition

There was a case where a cache hit would not increment the result's ref
count in time, which allowed the bitmap to be erroneously reused
(becaused poll() looks for refCount=0 bitmaps).

Bug: 10253182
Change-Id: I64d8f31c42f2847145c22cd27bcfb5a79f84aa44
ltPooledCache.java
ooledCache.java
7b1e10093f127dd3fcc00a7d1a3c5d717a0f1dea 13-Aug-2013 Mark Wei <markwei@google.com> Respect orientation of attachment previews.

Previews with orientation will not be eligible for pooling.

Bug: 10036191
Change-Id: Id7d625dde612742e4b12cc650c119f5c308456a3
ecodeTask.java
eusableBitmap.java
a9c0a61d1821d10b0ed6aa73dabc47cba127da2f 12-Aug-2013 Mark Wei <markwei@google.com> Fix NPE.

Do not allow the same key to be added twice.

Bug: 10288109
Change-Id: I830e7ccf186c41e4f54be2ed714ad92f20708171
ontiguousFIFOAggregator.java
13c9dcd5774d04b8df2c538ef12ed666d8c233e9 08-Aug-2013 Mark Wei <markwei@google.com> Stop using LinkedHashMap.

Revert to using a Queue + SparseArray instead.

The only way to get the first item in a LinkedHashMap is to create an Iterator.
This was causing GCs that blocked the UI thread.

Change-Id: Iaa72611cc8429eb9a8e22d63fd84a47e609a2e7b
ontiguousFIFOAggregator.java
1aba32575a08da6cbad80af8446201d73c59783d 08-Aug-2013 Mark Wei <markwei@google.com> Bust some jank.

Avoid view inflation in coordinates constructor. 22ms -> 14ms.

Sleep background decode tasks sooner during fling. This avoids the 30ms GC alloc
that may occur when we create file descriptors and use them to decode bounds.

Bug: 10132860
Change-Id: I44bb731dde18efcc95e789f53247eca213d5804e
ltBitmapCache.java
ontiguousFIFOAggregator.java
ecodeTask.java
b41b91112df8b4bf5adee6f0360dc7848f95fe26 03-Aug-2013 Mark Wei <markwei@google.com> Fix nit 4. Prevent multiple progress bars from showing up.

Bug: 10083052
Change-Id: I39f49195cc62a95e375730b51aa23e9f5bcf9685
ontiguousFIFOAggregator.java
ecodeAggregator.java
670c280136f587688d41027ce1ff1596068a35e0 01-Aug-2013 Mark Wei <markwei@google.com> Fix nit 5. Do not decode in background thread if cache is not warm.

When the ReusableBitmap pool is initially empty, all decodes must construct new
ReusableBitmap objects, which often causes GCs that cause jank during scroll.
This prevents the jank by notifying the ReusableBitmap pool that a scroll is in
progress, which causes the pool to block on poll() if no ReusableBitmaps can be
returned.

Bug: 10083052
Change-Id: Iaf8b244617a05d4736df041e888c9140d182c3a3
ltBitmapCache.java
itmapCache.java
ecodeTask.java
e9c39b5e816b06d1ad819dff59a1d9388826d62a 02-Aug-2013 Andy Huang <ath@google.com> fix the bitmap cache when size=0

Disable the non-pooled cache entirely when size=0.

Change-Id: Ia304a1822d36699e77897161db69618de6983964
ltPooledCache.java
14cfb945f9edfecf91cb07b4fae50a137723c7a0 02-Aug-2013 Tony Mantler <nicoya@google.com> Ensure nonPooledSize is >= 1 to avoid crash

Change-Id: Ieff3fad5581acc1d80025f495f2f778c6d6ef754
ltPooledCache.java
a5156ecf4b761dd60b5e0c16a7f99612336631e1 01-Aug-2013 Mark Wei <markwei@google.com> Fix nit 10. Fade and pulse now play nice with each other.

Bug: 10083052
Change-Id: I0e237ac8ec6d81a3319bb2b921d3482f499f369f
ecodeTask.java
0266692a394e5a6888595d154c5120726edadd6f 02-Aug-2013 Andy Huang <ath@google.com> add GIF fallback support

BitmapRegionDecoder doesn't support GIFs. Upon decode failure, fall back
to BitmapFactory (and disable inBitmap as it's too picky to be useful).
This means GIF decode always allocates a Bitmap!

Even if decode fails, we should offer any inBitmap to the pool for
reuse. This was previously causing excess allocations upon GIF failure.

Because GIF decode doesn't crop to our desired parallaxable rect, amend
the rect calculation to narrow the srcRect when necessary to ensure that
some height is reserved for parallax.

Partition the pooled cache and reserve some space for non-poolable, non-
reusable entries. This is basically reserved for GIFs. Let's assume 10%
for now.

Change-Id: Iac316a2f8c62be74cca487a02d9468ede29ea787
ltBitmapCache.java
ltPooledCache.java
itmapUtils.java
ecodeTask.java
oolable.java
efCountable.java
eusableBitmap.java
65b6d180f50922a3393795203cae68a5a2f6a33d 31-Jul-2013 Mark Wei <markwei@google.com> Fix attachment nit 4.

Add ContiguousFIFOAggregator to aggregate decode results and display them in the
correct order.

Bug: 10083052
Change-Id: I28b00fe44818f7882e44ef222d85d58ce111c7fe
ontiguousFIFOAggregator.java
ecodeTask.java
1b6fe5b1181ed3d0d0dde44baf5766db1e9c32e6 01-Aug-2013 Andy Huang <ath@google.com> fix 2x1 attachment grids not parallaxing

For 2x1 previews, make sure to pick more a appropriate aspect ratio
that's taller than for 1x1. The dimensions are based on that tile's
drawable bounds.

Because the requests are now specific to tile bounds, add the new
variable to Request objects so requests and cached data don't get mixed
up.

Change-Id: Ide447c5eb07ddd61bf85e77b235ac1c9ccd2eced
itmapUtils.java
ecodeTask.java
c93032dc09d7cd4890b584d5f28bd5910f689213 01-Aug-2013 Mark Wei <markwei@google.com> Add copyright headers.

Change-Id: I95bcfd62086890fc1cdc354571a8ca17cc213177
ltBitmapCache.java
ltPooledCache.java
itmapCache.java
itmapUtils.java
ooledCache.java
efCountable.java
eusableBitmap.java
race.java
695e7725b77463d0ebfbe83bc89b5bb10ef6fb29 30-Jul-2013 Mark Wei <markwei@google.com> Fix nits
in https://googleplex-android-review.googlesource.com/#/c/336488

Bug: 10083052
Change-Id: I2d00b549accb3a4c9df1f0197b78fce3d14f9496
itmapUtils.java
bb594cc2fcb06a9205d834cf4330959c816bd86b 30-Jul-2013 Mark Wei <markwei@google.com> Attachment preview parallax fixes.

Fix nits 1 and 3.

Bug: 10083052
Change-Id: I70285f0da1e4edb60fef576285ad6736eb0d977a
itmapUtils.java
ecodeTask.java
74db99555be46ccf44691805c359839268326d2e 30-Jul-2013 Andy Huang <ath@google.com> (re)add rendition support to attachment previews

Create new FAILURE state, which is also used when no renditions are
available. In this state, only a static placeholder appears.
Fix state transitions into failure state not clearing pulse animation.
Transitions from thumbnail->full rendition are special cased to not
cause transition effects.

Bug: 9566006
Change-Id: I0b833960a8839b1b6945c3c1fb749eedb14b6157
ltPooledCache.java
ecodeTask.java
79c3e1ed9cb1e1660c5d34b7bf3f3ab5c5dd5162 22-Jul-2013 Andy Huang <ath@google.com> new allocation-minimizing bitmap decoder

Use a new image decoding and caching framework. This one maximizes
bitmap reuse by decoding into fixed-sized Bitmaps and relying on
BitmapRegionDecoder to only decode a desired region. The ultimate goal
is to allocate memory less often, as each large allocation triggers
GC jank.

The overall request/response abstraction and threading model are now
cleaner, and caching is no longer a required fixture. Multi-core
decoding is now supported, with a currently fixed thread pool size of 4.

Attachment images are the only client for now, but contact photos will
switch to this framework next.

Bug: 9566006
Change-Id: I7c437941fd984cc0038da8f0ffd1df1a9ced4dd3
ltBitmapCache.java
ltPooledCache.java
itmapCache.java
itmapUtils.java
ecodeTask.java
ooledCache.java
efCountable.java
eusableBitmap.java
race.java