2827 Commits

Author SHA1 Message Date
Derek Sollenberger
5380709c78 am fad41c8f: am 5db1f5aa: Merge "Fix Java API error where requesting another style for a provided family fails" into klp-dev
* commit 'fad41c8fd1024a8257bdced18dbcbc9cd67e407a':
  Fix Java API error where requesting another style for a provided family fails
2013-09-24 10:22:29 -07:00
Derek Sollenberger
fad41c8fd1 am 5db1f5aa: Merge "Fix Java API error where requesting another style for a provided family fails" into klp-dev
* commit '5db1f5aaacf01e176f2463c212da72eaafc79165':
  Fix Java API error where requesting another style for a provided family fails
2013-09-23 18:59:24 -07:00
Derek Sollenberger
fe8e21fd80 Fix Java API error where requesting another style for a provided family fails
Internally the API uses the same code path as SkTypeface::CreateFromName which
returns NULL if the requested style is not supported by the existing family.
However, the existing Java API expects that we return the default font in the
requested style so this CL ensures that we do.

bug: 10860066
Change-Id: Ide3a0cc24015e97fa35aef283b42e7d7d11edd9c
2013-09-23 09:22:56 -04:00
Glenn Kasten
f045a893ca am dd47d78a: am 543de874: Merge "Revert "Workaround for slow AudioRecord destructor"" into klp-dev
* commit 'dd47d78a5e2b8d6f383e79fd4531fd38403d5614':
  Revert "Workaround for slow AudioRecord destructor"
2013-09-20 15:44:21 -07:00
Glenn Kasten
dd47d78a5e am 543de874: Merge "Revert "Workaround for slow AudioRecord destructor"" into klp-dev
* commit '543de8746e1c238f81a863f687d258ad86f5ef95':
  Revert "Workaround for slow AudioRecord destructor"
2013-09-20 15:41:00 -07:00
Glenn Kasten
543de8746e Merge "Revert "Workaround for slow AudioRecord destructor"" into klp-dev 2013-09-20 22:38:19 +00:00
Svetoslav
6e1e8b17c5 am c0e1ae01: am facc08c7: Merge "Move PdfDocument to android.graphics.pdf" into klp-dev
* commit 'c0e1ae0176b2ce23ea1b19883507cd920712289a':
  Move PdfDocument to android.graphics.pdf
2013-09-20 11:21:05 -07:00
Glenn Kasten
1f6ec93f12 am 0fbb7484: am 9d53e30e: Merge "Workaround for slow AudioRecord destructor" into klp-dev
* commit '0fbb74847aec65b057cad019d86617d9703c7c7a':
  Workaround for slow AudioRecord destructor
2013-09-20 11:20:47 -07:00
Leon Scroggins III
29baa03ba5 am 2360ada9: am 57989c0e: Merge "Skip writing zeroes to java allocated memory." into klp-dev
* commit '2360ada939b0abd4a6cca794288ff06701219f19':
  Skip writing zeroes to java allocated memory.
2013-09-20 11:20:22 -07:00
Eino-Ville Talvala
84fa15ce63 am f3c61c66: am a84ca8a3: Merge "TextureView/GLES20Canvas: Support synchronous GLConsumers" into klp-dev
* commit 'f3c61c6657fb2a25e5ac04e55ce0d7eefabc07f7':
  TextureView/GLES20Canvas: Support synchronous GLConsumers
2013-09-20 11:19:45 -07:00
Glenn Kasten
f69cd6787d Revert "Workaround for slow AudioRecord destructor"
This reverts commit 8d87d7ba113ad90685f1d2669e65251a9b422a5a.

Change-Id: I78cbe73959d29fc0ff3153268503ae685cd0995c
2013-09-20 18:10:28 +00:00
Derek Sollenberger
8fa4e29f16 am 23b7bc1b: am a2c6209f: Merge "Update SkTypeface::CreateFromName to handle NULL if familyName does not match" into klp-dev
* commit '23b7bc1b4409ca5844db5f17992b906aa3e63927':
  Update SkTypeface::CreateFromName to handle NULL if familyName does not match
2013-09-20 09:57:42 -07:00
Svetoslav
c0e1ae0176 am facc08c7: Merge "Move PdfDocument to android.graphics.pdf" into klp-dev
* commit 'facc08c7757cef56da6d10e78ce99ef7949700e3':
  Move PdfDocument to android.graphics.pdf
2013-09-19 18:17:05 -07:00
Svetoslav
facc08c775 Merge "Move PdfDocument to android.graphics.pdf" into klp-dev 2013-09-20 01:14:02 +00:00
Glenn Kasten
0fbb74847a am 9d53e30e: Merge "Workaround for slow AudioRecord destructor" into klp-dev
* commit '9d53e30e5eaf53cb0bd57319e02025ba7182bba3':
  Workaround for slow AudioRecord destructor
2013-09-19 17:13:51 -07:00
Svetoslav
6811f4e92c Move PdfDocument to android.graphics.pdf
1. Move PdfDocument to android.graphics.pdf.

2. Changed the PdfDocument as per API concil request.

3. Updated the documentation.

bug:10461180
bug:10552565
bug:10681585
bug:10552336

Change-Id: I08e15b34cf37bb064248c887e6f59808019cafe8
2013-09-19 17:12:47 -07:00
Glenn Kasten
9d53e30e5e Merge "Workaround for slow AudioRecord destructor" into klp-dev 2013-09-20 00:08:58 +00:00
Glenn Kasten
8d87d7ba11 Workaround for slow AudioRecord destructor
Bug: 10816117
Change-Id: If59028bc7dc7abb84e1e3642c721c2629653631f
2013-09-19 16:46:04 -07:00
Leon Scroggins III
2360ada939 am 57989c0e: Merge "Skip writing zeroes to java allocated memory." into klp-dev
* commit '57989c0e042c4f4e9362d875cf3df481243c0488':
  Skip writing zeroes to java allocated memory.
2013-09-19 16:21:49 -07:00
Leon Scroggins III
57989c0e04 Merge "Skip writing zeroes to java allocated memory." into klp-dev 2013-09-19 23:19:13 +00:00
Eino-Ville Talvala
f3c61c6657 am a84ca8a3: Merge "TextureView/GLES20Canvas: Support synchronous GLConsumers" into klp-dev
* commit 'a84ca8a3ca2525855e705c13666bc5da2eaf3260':
  TextureView/GLES20Canvas: Support synchronous GLConsumers
2013-09-19 14:59:54 -07:00
Eino-Ville Talvala
a3402c33c6 TextureView/GLES20Canvas: Support synchronous GLConsumers
Always update to the newest available frame from a GLConsumer.
Otherwise, with a synchronous queue, rendering can fall behind and
eventually deadlock with producer.

Bug: 10830400
Change-Id: I7f1d752c80ae5dac892a26d82e86806c27f5d955
2013-09-19 13:43:42 -07:00
Leon Scroggins III
1ffe727c06 Skip writing zeroes to java allocated memory.
If pixel memory was just allocated by Java, tell our decoders not
to write 0s, since the memory was initialized to 0. Likewise,
when drawing to a bitmap with memory just allocated by Java, do
not erase to 0.

Depends on a change to external/skia to add the new option on
image decoders:
https://googleplex-android-review.git.corp.google.com/362663

BUG:10016979
Change-Id: I9a3dc969870f8516e7d8495fe96d0a6b8225eda2
2013-09-19 16:22:57 -04:00
Derek Sollenberger
23b7bc1b44 am a2c6209f: Merge "Update SkTypeface::CreateFromName to handle NULL if familyName does not match" into klp-dev
* commit 'a2c6209f6120d300cd28d97ec868b5cabb3ee1a9':
  Update SkTypeface::CreateFromName to handle NULL if familyName does not match
2013-09-19 10:57:00 -07:00
Derek Sollenberger
89ec829908 Update SkTypeface::CreateFromName to handle NULL if familyName does not match
This is a multi-project change with a dependency on external/skia

bug: 10730965
Change-Id: Ida880a86ebd182a221333bbd85eaa30d047a1618
2013-09-19 08:14:53 -04:00
Leon Scroggins III
44f65cb5fd am 2e4e9889: am 3490228e: Merge "Use a native buffer for decoding images." into klp-dev
* commit '2e4e98895b17ef248f5071202a3610ac715eaf0e':
  Use a native buffer for decoding images.
2013-09-18 10:58:27 -07:00
Leon Scroggins III
2e4e98895b am 3490228e: Merge "Use a native buffer for decoding images." into klp-dev
* commit '3490228efb949ad1979c89bb206a3697f5ffc185':
  Use a native buffer for decoding images.
2013-09-18 10:55:43 -07:00
Leon Scroggins III
7315f1baee Use a native buffer for decoding images.
Fixes BUG:10725383

Depends on https://googleplex-android-review.git.corp.google.com/#/c/357300/
in external/skia.

In the previous fix for BUG:8432093 and BUG:6493544
(https://googleplex-android-review.googlesource.com/#/c/346191/),
instead of calling mark on the provided input stream, we
copied the entire stream in native code (except in one case;
more details below), allowing rewind no matter how much of
the stream had been read. This was because two decoders
may rewind after reading an arbitrary amount of the stream:
SkImageDecoder_wbmp and SkImageDecoder_libjpeg.

It turns out that the jpeg decoder does not need this rewind
after arbitrary length (it is a failure recovery case, and
libjpeg has a default recovery we can use - the above referenced
CL in Skia uses the default).

Although the wbmp decoder could read any amount given a
stream with the "right" data, and then return false, such a
stream would not be a valid stream of another format, so it
is okay for this rewind to fail.

Further, the previous fix was inefficient in the common case
where the caller decodes just the bounds, resets, then decodes
the entire image (since we have copied the entire stream twice).
The copy also resulted in the crashes seen in BUG:10725383.

In this CL, buffer only the amount of input needed by
SkImageDecoder::Factory to determine the type of image decoder
needed. Do not mark the input stream provided by the caller,
so their mark (if any) can remain in tact. The new Skia class
SkFrontBufferedStream allows buffering just the beginning
of the stream.

core/jni/android/graphics/BitmapFactory.cpp:
Instead of calling GetRewindableStream (which has been removed),
call CreateJavaInputStreamAdaptor. Then wrap it in an
SkFrontBufferedStream, with a large enough buffer to determine
which type of image is used.

core/jni/android/graphics/CreateJavaOutputStreamAdaptor.h:
core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp:
Remove mark, markSupported, and rewind. CreateJavaInputStreamAdaptor
now turns an SkStream which is not rewindable. If the caller
needs rewind that needs to be handled differently (for example,
by using SkFrontBufferedStream, as is done in BitmapFactory and
Movie.
Remove RewindableJavaStream and GetRewindableStream.
Remove code specific to ByteArrayInputStream, which makes slow
JNI calls. Instead, depend on the caller to buffer the input
in the general case. There is no reason to special case this
stream (especially since we already have decodeByteArray).
Remove CheckForAssetStream, which is now always special cased
in Java.

core/jni/android/graphics/Movie.cpp:
Call CreateJavaInputStreamAdaptor and use an SkFrontBufferedStream.
Add a native function for decoding an Asset, and remove old
call to CheckForAssetStream.

graphics/java/android/graphics/BitmapFactory.java:
Write a helper function for decoding a stream to consolidate
common code.
Buffer enough of the input so that SkImageDecoder::Factory
can rewind after having read enough to determine the type.
Unlike the old code, do NOT mark the caller's stream. This is
handled in native code. The caller's mark (if any) is left alone.

graphics/java/android/graphics/Movie.java:
Check for an Asset stream before passing to native, and
call a native function for handling the asset directly.

BUG:6493544
BUG:8432093
BUG:10725383

Change-Id: Ide74d3606ff4bb2a8c6cdbf11bae3f96696f331a
2013-09-18 12:01:20 -04:00
Leon Scroggins III
5387aa5029 am 3b8a7a04: am b693ef60: Merge "Do not allocate so much memory on the stack." into klp-dev
* commit '3b8a7a0402fbc2cb34e59a5757b8134c8bdadedc':
  Do not allocate so much memory on the stack.
2013-09-16 10:45:01 -07:00
Leon Scroggins III
3b8a7a0402 am b693ef60: Merge "Do not allocate so much memory on the stack." into klp-dev
* commit 'b693ef60ef27538402d941702ab652a57f585158':
  Do not allocate so much memory on the stack.
2013-09-16 10:41:40 -07:00
Leon Scroggins III
b693ef60ef Merge "Do not allocate so much memory on the stack." into klp-dev 2013-09-16 17:36:58 +00:00
Dianne Hackborn
1cd9a73ac0 am f3b4cf7d: am 28eeb420: Merge "Implement #10749688: Improve low memory reporting" into klp-dev
* commit 'f3b4cf7d01b68418dd652e201868d140de081bd8':
  Implement #10749688: Improve low memory reporting
2013-09-13 17:30:31 -07:00
Dianne Hackborn
f3b4cf7d01 am 28eeb420: Merge "Implement #10749688: Improve low memory reporting" into klp-dev
* commit '28eeb42012018bfa3cffc77e9a970e8f5c13f70b':
  Implement #10749688: Improve low memory reporting
2013-09-13 17:15:23 -07:00
Dianne Hackborn
8e69257a9c Implement #10749688: Improve low memory reporting
This significantly reworks the logging we do when
all cached processes are killed:

- We now collect the list of processes in-place so we
  have a snapshot of exactly when the low memory situation
  happened.
- In that snapshot we include the key process state: oom
  adj, proc state, adj reasons.
- The report then asynchronously collects pss information
  for those processes.
- The ultimate data printed to the log looks like a mix
  between the "dumpsys meminfo" and "dumpsys activity"
  output.  This code no longer uses "dumpsys meminfo"
  itself, so some of that data is no longer included,
  in particular pss organized by allocation type.

In doing this, I realized that the existing code that is
supposed to run "procstats" is not currently working.  And
at that point I realized, really, when we are collecting
this pss data we'd really like to include all those native
processes using ghod-only-knows how much RAM.  And guess
what, we have a list of processes available in
ProcessCpuTracker.

So we now also collect and print information for native
processes, and we also do this for "dumpsys meminfo" which
really seems like a good thing when we are printing summaries
of all pss and such.

I also improved the code for reading /proc/meminfo to be
able to load all the interesting fields from there, and
am now printing that as well.

Change-Id: I9e7d13e9c07a8249c7a7e12e5433973b2c0fdc11
2013-09-13 16:02:01 -07:00
Leon Scroggins III
37b82e3232 Do not allocate so much memory on the stack.
Instead, allocate a smaller amount and grow as necessary.

BUG:10697851
Change-Id: Iec57a8a374a4a76a3770e241cf561d58f3c8e1dc
2013-09-12 20:00:46 -04:00
Eric Laurent
835b5f344b am e33b79ef: am 95a18139: Merge "Add HOTWORD as an AudioSource" into klp-dev
* commit 'e33b79ef373fd3db9de035b5ecf2137a0684a441':
  Add HOTWORD as an AudioSource
2013-09-11 17:25:05 -07:00
Eino-Ville Talvala
1663033d96 am fb09a738: am ede3eeb7: Merge changes Ia6300c23,Idd2ae8ad into klp-dev
* commit 'fb09a7381992c6ca88b35d3d0103b38051174928':
  Camera2: Immutable metadata
  Camera2: Listener rework and other API updates
2013-09-11 17:24:56 -07:00
Ruben Brunk
b78b4af70d am fae16ab3: am 91019c9e: Merge "Remove dependency on JNIHelp header side effects." into klp-dev
* commit 'fae16ab39fe651f97bf86e6f5fe07f95342450aa':
  Remove dependency on JNIHelp header side effects.
2013-09-11 17:24:49 -07:00
Igor Murashkin
33069f40e5 am 47869404: am 2cad64c0: Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev
* commit '47869404cb8233c536a0a5d2c5ce4d0089e39882':
  Surface: Change OutOfResourcesException to be a runtime exception
2013-09-11 17:22:40 -07:00
Eric Laurent
e33b79ef37 am 95a18139: Merge "Add HOTWORD as an AudioSource" into klp-dev
* commit '95a181397dad3113b96e3cc7392a5b0f5d742f39':
  Add HOTWORD as an AudioSource
2013-09-11 17:17:50 -07:00
Eric Laurent
95a181397d Merge "Add HOTWORD as an AudioSource" into klp-dev 2013-09-12 00:15:31 +00:00
Eino-Ville Talvala
fb09a73819 am ede3eeb7: Merge changes Ia6300c23,Idd2ae8ad into klp-dev
* commit 'ede3eeb72c9708df023bdfb369905ededd1ebb06':
  Camera2: Immutable metadata
  Camera2: Listener rework and other API updates
2013-09-11 17:10:36 -07:00
Eino-Ville Talvala
ede3eeb72c Merge changes Ia6300c23,Idd2ae8ad into klp-dev
* changes:
  Camera2: Immutable metadata
  Camera2: Listener rework and other API updates
2013-09-12 00:08:04 +00:00
Ruben Brunk
fae16ab39f am 91019c9e: Merge "Remove dependency on JNIHelp header side effects." into klp-dev
* commit '91019c9ef34b2fb00a1c027a57d75ed9e0810df5':
  Remove dependency on JNIHelp header side effects.
2013-09-11 17:05:48 -07:00
Ruben Brunk
91019c9ef3 Merge "Remove dependency on JNIHelp header side effects." into klp-dev 2013-09-12 00:01:28 +00:00
Eino-Ville Talvala
70c2207c34 Camera2: Immutable metadata
Make all camera metadata immutable once created; requests are
created using CameraRequest.Builder.

- Separate CameraMetadata implementation from interface
- Implement deep copying of metadata
- Requests/results/properties have-a native implementation

Bug: 10360518
Change-Id: Ia6300c237219d39f70c63156fa9ca666d951a36e
2013-09-11 13:18:10 -07:00
Igor Murashkin
47869404cb am 2cad64c0: Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev
* commit '2cad64c0fbeba07bb546674e19cfb0166d7ec332':
  Surface: Change OutOfResourcesException to be a runtime exception
2013-09-11 11:30:14 -07:00
Igor Murashkin
2cad64c0fb Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev 2013-09-11 18:28:07 +00:00
Chris Craik
27569f2447 am a180fd6d: am 68fbe16b: Merge "Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref" into klp-dev
* commit 'a180fd6d67819a45bafc052581d43c0ecc1faccf':
  Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref
2013-09-11 10:45:28 -07:00
Chris Craik
a180fd6d67 am 68fbe16b: Merge "Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref" into klp-dev
* commit '68fbe16ba0072326c1c6b09817f46ccdc5ee15b9':
  Avoid ref-ing AndroidPixelRefs that wrap others in globalRef/Unref
2013-09-11 10:42:09 -07:00