300 Commits

Author SHA1 Message Date
Neil Fuller
38b63f0ede am dfcf0655: am 09fd5a18: Merge "Replacing FloatMath native implementation with calls to Math"
* commit 'dfcf065505a12aa358af5cd2607fd355eee964c4':
  Replacing FloatMath native implementation with calls to Math
2014-10-20 10:16:08 +00:00
Nick Kralevich
7b3db39aa4 Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: If07fcbd78543d13bc6d75f9743f999860e8d58d7
2014-10-20 09:24:11 +01:00
Elliott Hughes
5fc9f9c293 am 84e6d466: am 4cd671e4: Merge "Revert "Replacing FloatMath native implementation with calls to Math""
* commit '84e6d466edc2aba711f90431a1cd209d11c0e70d':
  Revert "Replacing FloatMath native implementation with calls to Math"
2014-10-18 20:53:38 +00:00
Elliott Hughes
b3b68d0333 Revert "Replacing FloatMath native implementation with calls to Math"
This reverts commit 32b88b48daa7383880088246d7222dd93cf55285.

Change-Id: I40ea17f3a68f2b53eb013aebd3ba1becdc724f94
2014-10-18 20:41:27 +00:00
Neil Fuller
4ef9403577 am 8a3785ca: am fd2d41b7: Merge "Replacing FloatMath native implementation with calls to Math"
* commit '8a3785cafec4b47fe8d61614b04a0e193d616428':
  Replacing FloatMath native implementation with calls to Math
2014-10-16 09:32:33 +00:00
Neil Fuller
32b88b48da Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I8d1947d88b3c576643138b1df589fb9da7c1ab88
2014-10-15 11:47:58 +01:00
Christopher Ferris
5684e714a4 am 7d113829: am b6f891c4: Merge "Remove MALLOC_LEAK_CHECK references."
* commit '7d1138298b37bca2340fc4610090b53f5b838f7a':
  Remove MALLOC_LEAK_CHECK references.
2014-09-20 01:03:08 +00:00
Dan Albert
c04d92cac9 resolved conflicts for merge of 1a4527ce to lmp-dev-plus-aosp
Change-Id: Iee4e93e3a2b049ec5f13166dbbffdd77b301fe5c
2014-09-19 15:57:26 -07:00
Christopher Ferris
8b1dfddf50 Remove MALLOC_LEAK_CHECK references.
Bug: 17378595
Change-Id: Ib9680ef97dfea6bc20d96f0bed90f4553186315c
2014-09-19 12:24:59 -07:00
Dan Albert
88ba339aef Clean up makefile cruft.
The build system already takes care of all these things.

Change-Id: Idef80b554e07cef5e5ed2adf1b5740a76f13ef6d
2014-09-11 16:21:19 -07:00
Svetoslav
62ce332c14 Trim unnecessary pages when printing.
A user may request a subset of the document's pages to be printed.
In this case the expectation is that the resulting document does
not include not selected pages. While print serivices can do the
trimming themselves or the printer may do so, moving, potantually
many, redundant pages is inefficient. The real problem is when
saving to a PDF file where the saved file must not have the pages
the user did not select. This change adds shredding of undesired
pages from the PDF before saving it or passing it to a print service.
:
bug:17285994

Change-Id: I7deba535af99457bea3c118202314f0f3812e809
2014-09-09 09:38:07 -07:00
Yong WU
03c866020b Integrate NativeActivity with NativeBridge interfaces
Bug: 16884833

Change-Id: I73aab8e212860ba5aee9444d801806d3da326a41
2014-08-15 10:18:40 +01:00
Yong WU
abd76d0a09 Integrate NativeActivity with NativeBridge interfaces
Bug: 16884833

(cherry picked from commit I73aab8e212860ba5aee9444d801806d3da326a41)

Change-Id: I67f037ea81d2a4ede4294afd8b84b7640e534a13
2014-08-15 13:22:30 +01:00
Neil Fuller
3b852e3489 Rewriting android.text.format.Time without the native _tz functions
(cherry picked from commit d7f0849b8c053ccc6abf0dc7d5bc07da502782a4)
Bug: 15765976

Change-Id: I00f72bd1043ef20f22d25559206b2f741334ba9c
2014-07-24 11:37:20 +01:00
Behdad Esfahbod
6ba30b85dd Add android.Paint that inherits SkPaint
The idea is that extra paint parameters that only affect text layout
(not rendering) will go in android.Paint instead of going into
SkPaintOptionsAndroid.  We will eventually move those out of SkPaint
too.

This is currently implemented in PaintImpl.cpp.  Will be renamed when
current Paint.cpp that has JNI bits is moved to android_graphics_Paint.cpp.

Change-Id: Iba66c34dea5da503a13b9c864cb9f2211ac4ba7d
2014-07-22 14:01:09 -04:00
Neil Fuller
d7f0849b8c Rewriting android.text.format.Time without the native _tz functions
Bug: 15765976
Change-Id: I666b72ecf9da8a9dcfb97cc503006b415909a558
2014-07-22 15:06:16 +01:00
Derek Sollenberger
8872b38ef4 Separate Canvas JNI code from the implementation.
This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation.  The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.

BUG:15672762
Change-Id: Ibaccdddb87d3b9358f4f0c1d317ead5282d4ee16
2014-07-21 12:08:57 -04:00
John Reck
580ff8142b Revert "Separate Canvas JNI code from the implementation."
This reverts commit e28a5afee885cd69a5be5809f88116b601cb1a72.

 Appears to cause memory corruption and random appearances of
 chinese

 Bug: 16343240
 Bug: 16336642

Change-Id: Ife169181f40adff4b12948ed5f9d3a88dcec935b
2014-07-17 17:36:24 +00:00
Derek Sollenberger
f5d6c555c3 Separate Canvas JNI code from the implementation. DO NOT MERGE
This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation.  The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.

BUG:15672762
Change-Id: Idefadede356f688edb8eb09b4a02aa01b4077f62
2014-07-15 15:08:29 +00:00
destradaa
a4fa3b5aa5 Add support in the platform for Activity Recognition Hardware.
Change-Id: I7c4fff3526583475a5edf1f4ba8fede4e9419ead
2014-07-11 15:58:36 -07:00
Eino-Ville Talvala
e1f57d6f44 Camera2: Add CPU/GPU overhead measurement to legacy mode
Dumps GL and CPU processing duration and frame timestamps to a file,
whenever the device is closed or the stream configuration is changed.

- Add PerfMeasurement class to legacy mode
- Wire up minimal usage to SurfaceTextureRenderer

Change-Id: Ic9d74ca26f706780b746175aa615c7aae4ae52e7
2014-07-10 23:49:07 +00:00
Colin Cross
0769e55001 android.os.Process: add killProcessGroup
Add Process.killProcessGroup to interface between ActivityManager and
libprocessgroup.

Bug: 15313911
Change-Id: I5226a6d86153b863e30d936cf1c84e256f0d7ea5
2014-07-10 18:08:08 +00:00
Elliott Hughes
92b1896dfd Switch frameworks/base/core/jni to the new icu.
Change-Id: Id12ce02da377ce78f318e10633c47f500237d9d9
2014-07-09 16:56:11 -07:00
Elliott Hughes
b58d385e17 resolved conflicts for merge of f6be5a7a to master
Change-Id: I6dcfb33981df90877fb9f3752b853cf377633edf
2014-07-09 17:40:24 -07:00
Anish Athalye
88b5b0be88 Implement line breaking using ICU break iterator
Change-Id: I4ad98757aa2eab5dbc2ae44c0391e900ef20c4d0
2014-06-30 22:14:05 +00:00
Raph Levien
3660789f06 Switch all text layout to Minikin
This patch switches all text layout operations to use Minikin, removes
the USE_MINIKIN #ifdef, and deletes some of the code that was only used
in the old TextLayout path (although some more refactoring remains).

Change-Id: I51b5c4e2bb46cfd9d204c12b9f16f135c769f5b5
2014-06-26 08:23:48 -07:00
Derek Sollenberger
4b0959d8db Refactor android.graphics.Picture JNI bindings.
This is the first CL in a series of CLs to refactor the Graphics JNI bindings.

bug: 15672762
Change-Id: I1455fa1330c7426407c06eeaad81ad37a57373b1
2014-06-17 15:31:43 -04:00
Robert Phillips
b59508fce5 Changes to framework for ToT Skia.
Consists of 3 cherry-pick from changes by robertphillips@google.com
in master-skia:

-----------------------------------------------------------------------

New AndroidPicture wrapper class

Address code review comments & use new SkPictureRecorder::partialReplay
entry point

Addressing code review issues

Switch MakePartialCopy to makePartialCopy

Conflicts:
	core/jni/android/graphics/Picture.cpp

Ie530ab15b3d549f0ecfb0ecc131f9144a7b72a91

Remove AndroidPicture from GraphicsJNI and split into .h and .cpp

-----------------------------------------------------------------------

Fix lingering legacy picture recording behavior
Address code review issues

Iaf870c2c400dbe70dc32d6d445574904f5ea718f

-----------------------------------------------------------------------

Update Android to new SkCanvas::drawPicture interface

As of Skia 9b14f26d (Alter SkCanvas::drawPicture (devirtualize,
take const SkPicture, take pointer) -
https://codereview.chromium.org/313613004) SkCanvas::drawPicture
has an alternate signature. The old entry point is deprecated.

I63395da61ecc3b58bfd2bc094752081f4b2f7535

-----------------------------------------------------------------------

Change-Id: I041133aeb5639abd853370e512acf93870f82aea
2014-06-11 18:27:48 -04:00
Eric Laurent
5edb85c17d Merge "add sound trigger JNI" 2014-06-05 21:04:50 +00:00
Eric Laurent
60b62bc5c1 add sound trigger JNI
Add JNI for sound trigger hardware native service.

Change-Id: Idd0ee42c7af5fe20e7d8295994211de3a517bd13
2014-06-04 17:59:12 -07:00
John Reck
84a4c887a0 Remove GLRenderer
Change-Id: I180286417c1a354fc7eb1eadb1884ac6add0795c
2014-06-02 16:33:52 -07:00
Ruben Brunk
94ecb5506a am a7c97c55: Merge "camera2: Move DngCreator to hardware/camera2." into lmp-preview-dev
* commit 'a7c97c552a280ed3a2ff3535a5085f8601f45820':
  camera2: Move DngCreator to hardware/camera2.
2014-05-24 00:30:06 +00:00
Ruben Brunk
b6079005ed camera2: Move DngCreator to hardware/camera2.
Bug: 15091253
Change-Id: Ibe2ee376436e5c796e33c0b782ea68278589f2e6
2014-05-22 22:57:11 +00:00
Paul Jensen
985086276f Merge "Implement bind-to-network functionality of android.net.Network." 2014-05-22 16:14:21 +00:00
Ruben Brunk
94520c7460 Merge "camera2: Add HAL1 compatibility shim skeleton." 2014-05-22 06:08:56 +00:00
Paul Jensen
3876495129 Implement bind-to-network functionality of android.net.Network.
This is implemented by calling through to netd_client.
Included are functions to bind-to-network-for-process strictly for DNS to
facilitate startUsingNetworkFeature() reimplementation.

Change-Id: Ib22c7d02ea81d251bdfeeb0f64a47ce32eefcb1b
2014-05-22 04:16:54 +00:00
Jesse Hall
7ab63acdd0 opengl: Add GLES31 and GLES31Ext classes
Bug: 15028495
Change-Id: Ie967c1938060edb42864dd48efa668ae7bf5cd76
2014-05-21 21:04:20 -07:00
Ruben Brunk
feb50af361 camera2: Add HAL1 compatibility shim skeleton.
This adds basic support for running the Camera2 API on a device running
a camera HAL version lower than CAMERA_MODULE_API_VERSION_2_0.

This CL includes support for:
- N-way preview output streams
- N-way jpeg output streams
- CameraDevice emulation at the binder interface
- Basic camera metadata querying in the CameraManager

Bug: 15117269
Bug: 15116722

Change-Id: I8322955034c91f34bb348d4b28c2b774dbef38f6
2014-05-21 16:37:59 -07:00
Svetoslav Ganov
519c77b710 Switching to the final PDF rendering library
Change-Id: Id92674ce762af894a5c4b0df0f8e9a711131bccc
2014-05-21 12:43:51 -07:00
Ed Heyl
a5291466ea Fix the build: Revert "Switching to the final PDF rendering library"
This reverts commit e7a8f476ea3873941ace96751fa2d633c95b7c10.

Change-Id: I457e45b0a536bbde721a3355ed860b2363e36467
2014-05-21 19:21:06 +00:00
Svetoslav
89ff50cea8 Switching to the final PDF rendering library
Change-Id: I5bad4fc620378f3ca6b070bbaeee631f526b66c7
2014-05-21 10:40:42 -07:00
Ruben Brunk
f967a5486a camera2: Plumb DngCreator to native library.
Change-Id: Ic58bf6cf5086808b503460ef8e451fc0d6f1f850
2014-05-16 23:25:51 -07:00
Svetoslav
dbef65f1a1 Merge "Adding APIs to render PDF documents." 2014-05-15 20:15:06 +00:00
Mike Reed
4c9355c35a Frameworks changes to support latest Skia (r14729)
Required for a merge in external/skia
(I88b4d5cc81c357a8e223bd7860b1029590265200).

Includes two cherry-picks:

I456df543e1925b280f785c7b3bb81370157f9b09:
replace SkRasterizer* with NativeRasterizer* in JNI

I98adb200e023369d3ee75f21927fa98f23095a77:
Fix Paint.getFlags,setFlags wrt FILTER_BITMAP_FLAG

In Paint.setFlags(), turn FILTER_BITMAP_FLAG into a call to
SkPaint::setFilterLevel().

In Paint.getFlags(), read SkPaint::getFilterLevel() to determine
whether to include FILTER_BITMAP_FLAG in the result.

Fixes CTS tests with ToT Skia.

Change-Id: I2736f3f68683651574d79a169ff0ab563e0a469e
2014-05-15 10:17:44 -04:00
Raph Levien
2836c4722a Merge "Start of Minikin integration" 2014-05-15 02:03:05 +00:00
Svetoslav
2961769ea9 Adding APIs to render PDF documents.
We need to render PDF documents for two main use cases. First,
for print preview. Second, for resterizing the PDF document by
a print service before passing it to a printer which does not
natively support PDF (most consumer ones).

Adding PDF rendering APIs improves guarantees for print quality
as the same library is used for preview and rasterization. Also
print vendors do not have to license third-party rendering engines.
Last but not least as the platform uses PDF as its main print
format it should also be able to natively render it.

Change-Id: I57004a435db147663cafea40cf3296465aba7f99
2014-05-13 18:32:42 -07:00
John Reck
315c329544 Add TimeInterpolator support to RNA
Bug: 14678626

Change-Id: I6554e7fcd42c49fac3618ca792083bb68e358f55
2014-05-12 14:41:06 -07:00
Raph Levien
1a73f732f9 Start of Minikin integration
This is the current state of the Minikin integration. All changes are
hidden behind USE_MINIKIN #ifdef, so it should be safe to apply. To
play with the Minikin branch, set this in your BoardConfig.mk .

This change also merges in 64-bit changes that were happenening in
parallel.

Change-Id: Idd94553bcbe324c5875d0ff06495c966c3e95b7f
2014-05-12 10:41:42 -07:00
John Reck
9fa4071c47 Refactor VirtualLightRefBase & JNI
Change-Id: I8e244e7109e59d5be96871b23bb9b1201c7f9eaa
2014-05-09 15:28:54 -07:00
Ying Wang
29894c6176 am db55bb06: am 4463cbc6: am 3b9600b6: Merge "Remove unused LOCAL_LDLIBS."
* commit 'db55bb0622e9fbe4b858d59409f516de01c1f1fd':
  Remove unused LOCAL_LDLIBS.
2014-05-08 18:31:18 +00:00