471 Commits

Author SHA1 Message Date
Mathias Agopian
caf8930960 fallout of splitting libsensor out of libgui
Test: compile & run
Bug: treble cleanup
Change-Id: Ib696126506cc9df01dcf9e09779ce05ddb69e4b6
2017-03-06 16:09:55 -08:00
Paul Lawrence
1ee4025af0 Merge "Make seccomp honor setenforce" am: c337e32bb0 am: 071dcc02b4
am: fb350eb0c7

Change-Id: Id8d8c478d9e1d929d216286bbf0fbdc423018c17
2017-03-04 02:29:36 +00:00
Paul Lawrence
071dcc02b4 Merge "Make seccomp honor setenforce"
am: c337e32bb0

Change-Id: I9d1bfd35f7da304188da2d6aff6b937108ae4680
2017-03-04 02:17:43 +00:00
Paul Lawrence
ffad2adfa5 Make seccomp honor setenforce
Note: This code is in frameworks, since we might want to have tools
linked against seccomp_policy that continue to enforce seccomp

Bug: 35950093
Test: Builds, Seccomp: 2 is in zygote & zygote64 status
      Run setenforce 0 && stop && start
      Seccomp: 0 is in zygote & zygote64 status

Change-Id: I797a6c29f58725f84089c570f784125fb99f57ce
2017-03-03 13:08:08 -08:00
Mathias Agopian
fee4a985fd fallout of libandroid.so split
Test: compiled & booted
Bug: 35164655
Change-Id: I786167a21453e17493969cdacfc9d31bdb781d98
2017-02-23 23:28:20 +00:00
Matt Sarett
327c7207a0 BitmapFactory: Remove legacy premultiply hacks
Skia now has a mode that will perform color correction,
but still do the premultiply on gamma encoded bytes.

Test: Flashed device, ran cts.

Change-Id: Ib1d1ea1074b5e6d1a49ecfc45e25552643dc04bc
2017-02-22 17:38:28 -05:00
Yifan Hong
41894b468d Merge "android.os.HwBinder.getService() in Java respects VINTF." am: 01f374c635 am: 71e77c865b am: 2e943c5379
am: 229e2d09ce

Change-Id: I12223be235ec60ef67c8e327226b816d7843bad9
2017-02-10 18:57:22 +00:00
Yifan Hong
229e2d09ce Merge "android.os.HwBinder.getService() in Java respects VINTF." am: 01f374c635 am: 71e77c865b
am: 2e943c5379

Change-Id: Ibbf18bc51e146abef1ab211614a98ec59031b1b9
2017-02-10 18:53:07 +00:00
Po-Chien Hsueh
c5ae595e6f Remove build flag ANDROID_ENABLE_RENDERSCRIPT
remove this flag and consider renderscript is always enabled

Bug: 34693640
Test: compile
Change-Id: I22464e1d64f2a55a60ba9f8ab1510f2811605552
2017-02-09 15:00:09 +08:00
Yifan Hong
0382be2f32 android.os.HwBinder.getService() in Java respects VINTF.
Also cleans up usage of different strings
in getService.

Test: wifi and fingerprint works.

Bug: 34691352
Change-Id: Id1f68115b15c21f70b0be8e7a1400de563d1da11
2017-02-06 14:59:08 -08:00
Paul Lawrence
46e48b9aa4 resolve merge conflicts of fde0a41065eb to master
Test: Make sure builds, boots
Change-Id: Idf86dc5d888c09e8a65ada51fc2f32aae6d5570d
2017-02-02 13:28:45 -08:00
Paul Lawrence
fde0a41065 Install seccomp into zygote not init am: ef85477470 am: 521d25294b
am: e6e8c7a1dd

Change-Id: I97d2843a2c2940b558f216cf550891a80963be54
2017-02-02 18:37:22 +00:00
Paul Lawrence
ef85477470 Install seccomp into zygote not init
Bug: 34710876
Test: Boots, correct size filter installed, blocks unallowed calls

Change-Id: I3e66e8724ace37f7d30451b98a5e574766252ea0
2017-02-02 17:45:11 +00:00
Seigo Nonaka
9ff994d988 Introduce set/getFontVariationSettings.
This is 2nd attempt of I249d464f8cdaa56017a987588b94ed685aadeb58.
The original CL was reverted due to conflicting with another CL submitted
before.
Nothing has changed except for following class name changes.

Here is the original commit message of reverted change.

This CL enables developers to specify axis values to the underlying
font collection. The specification of the font variation settings is
the same as the CSS font-variation-settings attribute in CSS working
draft as of 2016-11-30.

Code example: Here is an example to set width 100 and weight 1.5.

  TextView tv = (TextView) findViewById(R.id.textView);
  tv.setFontVariationSettings("'wdth' 100, 'wght' 1.5");

Bug: 33062398
Test: Manually done. Ran FrameworksGraphicsTests, CtsGraphicsTestCases
      and CtsWidgetTestCases

Change-Id: I9cdfbdecc87c995d805096883ef2652768c6c21e
2017-01-30 20:22:41 +09:00
TreeHugger Robot
953038d1ce Merge changes from topic 'anb'
* changes:
  Adding HardwareBuffer, a Java wrapper around AHardwareBuffer.
  AHardwareBuffer implementation.
2017-01-23 19:29:05 +00:00
Craig Donner
1a4d07d919 Adding HardwareBuffer, a Java wrapper around AHardwareBuffer.
Bug: 34050596
Test: new CTS test added in other topic CL; tested with cts-tradefed on Pixel XL
Change-Id: I177107757f917fcab5bc1f1dcdbb5b81a605f777
2017-01-20 18:52:01 -08:00
Siyamed Sinir
24fac986ec Merge "Revert "Introduce set/getFontVariationSettings."" 2017-01-20 01:59:52 +00:00
Siyamed Sinir
a3b9f2e3c6 Revert "Introduce set/getFontVariationSettings."
This reverts commit ba3028c1fc9fca2d45acc841557da2c9a83923bf.

Bug: 34378805
Change-Id: I8250c87af5d65fb45789632580be4ae1b8711372
2017-01-20 01:13:23 +00:00
Josh Gao
e7b977d56e Switch android.os.Debug to libdebuggerd_client. am: 3ce369601e am: 18e852e9aa am: e84a027259
am: 6f2436873a

Change-Id: I20b09418489286153146a34a2c01ef04beae5686
2017-01-19 00:44:45 +00:00
Josh Gao
6f2436873a Switch android.os.Debug to libdebuggerd_client. am: 3ce369601e am: 18e852e9aa
am: e84a027259

Change-Id: Iffda01846d96d4ba6b4d13678d999c4cc8350e87
2017-01-18 23:58:13 +00:00
Josh Gao
3ce369601e Switch android.os.Debug to libdebuggerd_client.
Bug: http://b/30705528
Test: m
Change-Id: Iac3860d0e63660b91a4b08075fca8a4a222ac913
2017-01-17 13:55:20 -08:00
Jesse Hall
17ee3aac28 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
(cherry picked from commit b12249b67193df07a8ffc3cad0c41643662b887b)
2017-01-15 05:55:46 +00:00
Jesse Hall
b12249b671 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
2017-01-14 17:31:56 -08:00
TreeHugger Robot
e5bab865b3 Merge "Remove dependence on SkTRegistry" 2017-01-13 11:44:36 +00:00
Leon Scroggins III
0517766a0e Remove dependence on SkTRegistry
Test: Existing CTS tests for Movie.

SkTRegistry was renamed and moved (with the intent of being private to
Skia) in https://skia-review.googlesource.com/c/6881.

There is only one class registred anyway, so make Movie::DecodeStream
just check GIF manually.

Change-Id: I7fa668cf13c902b49f2848bce4d86ad83020970f
2017-01-12 11:21:02 -05:00
Seigo Nonaka
ba3028c1fc Introduce set/getFontVariationSettings.
This CL enables developers to specify axis values to the underlying
font collection. The specification of the font variation settings is
the same as the CSS font-variation-settings attribute in CSS working
draft as of 2016-11-30.

Code example: Here is an example to set width 100 and weight 1.5.

  TextView tv = (TextView) findViewById(R.id.textView);
  tv.setFontVariationSettings("'wdth' 100, 'wght' 1.5");

Bug: 33062398
Test: Manually done. Ran FrameworksGraphicsTests, CtsGraphicsTestCases
      and CtsWidgetTestCases
Change-Id: I249d464f8cdaa56017a987588b94ed685aadeb58
2017-01-12 18:11:03 +09:00
Robert Sesek
8225b7c951 Split core/jni/fd_utils-inl.h into a .h/.cpp pair.
(cherry picked from commit 44afe8be8f654192dc436a9c4238a925c22b14bf)

Test: m
Test: sailfish boots

Change-Id: I9ca93f31f6c20b702b2207333a9d56f6592630b0
2017-01-10 11:41:01 -08:00
Sergei Vasilinetc
ab08c65533 Merge changes I68d56d76,Iad432577
* changes:
  Hidden method to get a graphic buffer from a hardware bitmap
  Move GraphicBuffer to graphics package
2017-01-06 20:36:41 +00:00
Matt Sarett
33e3741cad Decode images to sRGB, premultiply based on framework define
This reenables color conversion to sRGB at decode time.

Use the value ANDROID_LINEAR_BLENDING_ENABLED to decide
whether to use the codec's linear premultiply or manually
perform a legacy premultiply.

Test: Demonstrated that legacy premultiply is still
faster than the linear premultiply.  So the performance
of the two pass approach (decode, then premultiply)
is acceptable.  Skia tests both of these decoding modes.

BUG:33741991
BUG:8860389
BUG:24279600

Change-Id: Idea0f359565bd8c7c3ba06e77a897173677db1c6
2017-01-05 10:45:18 -05:00
sergeyv
0a0f23163a Move GraphicBuffer to graphics package
Test: locally tested Bitmap.createHardwareBitmap method
bug: 30999911
Change-Id: Iad432577f26f2362ede9e77cd8a5425c010692e5
2017-01-04 14:01:52 -08:00
Ashutosh Joshi
19753cca3f Switch to HIDL service based HAL
Switch to using HIDL service based HAL.
Some cleanup.

Test: GTS tests pass

Change-Id: Icf133fe4ead56336973dc50c4ec2aab18382a8ca
2016-12-22 12:28:57 -08:00
Ashutosh Joshi
420e45e9cb Move ContextHubService to a better location.
Move ContextHub service from system core to a more appropriate place
for a service.

Test: GTS tests pass.

Change-Id: Ie0f25414fc472a0214c0dd94e7ad4564cd38f842
2016-12-21 11:33:28 -08:00
Robert Sesek
44afe8be8f Split core/jni/fd_utils-inl.h into a .h/.cpp pair.
Test: m
Test: sailfish boots

Change-Id: I9ca93f31f6c20b702b2207333a9d56f6592630b0
2016-12-16 14:51:30 -05:00
Todd Kjos
8175f0955a Revert "Add boost to increase the load on newly-forked zygote processes."
This reverts commit 6d43a861d01ef48f37c69f96346a13d23164a585.

(cherry picked from commit 0f2ded62ae3d88ddb732df182c3bfee3e2729018)

Test: m
Test: Device boots
Change-Id: I627e47c6ead4ce2d2bffa923a32a56d06c022df7
2016-12-16 09:05:50 -08:00
Colin Cross
cae60e0f90 Move libandroid_runtime headers into frameworks/base/core/jni am: 71044fe7e5 am: 7f63febbc4 am: b1a3ae1f54
am: 4f8c759959

Change-Id: I1044f4a4c89f5e5135dfd30af2a0cdc933c27e9f
2016-12-16 09:18:09 +00:00
Colin Cross
71044fe7e5 Move libandroid_runtime headers into frameworks/base/core/jni
Move libandroid_runtime's headers into its source directory, and export
them to modules that link against libandroid_runtime.  Also fixes
one unused-paramter warning that was hidden by the use of -isystem to
include frameworks/base/include.

Bug: 33630870
Test: m -j native
Change-Id: Id6c2561d6c7d82a7ca2d183f11b1d3d3dcb42843
2016-12-14 13:35:40 -08:00
Derek Sollenberger
dcc3630100 Remove Rasterizer and its subclasses from the public API.
Test: compile
Bug: 14650725
Change-Id: I99e1942d4d1b85f4efdcb3faf3fee1aa6c839b7e
2016-12-12 10:53:58 -05:00
TreeHugger Robot
3cf4b56a92 Merge "Add libziparchive explicitly." 2016-12-06 14:08:45 +00:00
Marco Nelissen
ed6824ccad Remove unneeded dependencies from libandroid_runtime
Test: build/boot
Change-Id: I67b89c3f916f81f5efe251bba73ce204e47cfa2f
2016-12-01 20:50:40 +00:00
Daichi Hirono
878e86f38f Adding FUSE loop thread in app side.
The CL adds FuseAppLoop internal class to the framework. It parses FUSE commands
from the proxy in the system service and invokes a callback provided by
application.

Bug: 29970149
Test: None, will be tested with CTS for StorageManager#openProxyFileDescriptor.
Change-Id: I10b2add4c2743fb91eae3cb194f55843a74fb668
2016-12-01 13:16:14 +09:00
Jaekyun Seok
ef53652a82 Add libziparchive explicitly.
libvulkan won't link libziparchive statically. So libziparchive
should be linked explicitly.

Test: building succeeded, and the image was tested on angler.
Bug: 33056637
Change-Id: Icb392968f65227919ebccf66677961868e692613
2016-12-01 10:02:44 +09:00
Yifan Hong
d6658ac131 Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: I0df309a1096b663cc51ce8badacf05e2a47836a8
2016-11-18 15:15:32 +00:00
Yifan Hong
c46d1b44eb Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: I0df309a1096b663cc51ce8badacf05e2a47836a8
2016-11-18 00:03:59 +00:00
Derek Sollenberger
450756ab69 Update bitmap shaders to the special no-copy image shaders.
Test: hwui unit tests and CTS graphics tests pass
Change-Id: Ifd031076d0eac95a30bce9ecaa6f43e9c70f3c54
2016-11-07 15:57:07 -05:00
Marco Nelissen
74abdda6a0 Use libaudioclient
Test: build/boot
Change-Id: I7c730bfd47297f311e00798b5927888ddc3f5062
2016-11-04 19:31:54 -07:00
Marco Nelissen
20edcbc89c Use libaudioclient
Test: build/boot
Change-Id: I7c730bfd47297f311e00798b5927888ddc3f5062
2016-11-03 10:58:33 -07:00
Leon Scroggins III
b5e74b90b2 Move SkMovie into frameworks/base
Test: Refactor. Relying on existing tests of android.graphics.Movie.

Skia is no longer working on SkMovie, so move it to the only place that
it is used.

Files moved from Skia (all the added files) are unchanged except for
renames (SkMovie -> Movie; SkGIFMovie -> GIFMovie).

Change-Id: I5f12d5def5fe825dda637f8aecf84e73e2dae9ca
2016-10-27 13:56:58 +00:00
Andreas Gampe
ca5ef5f076 Merge "Debug: Use UniqueFile" am: 546f755bf8 am: 8d151b26c2 am: 77a2f22f77
am: 34030a16ba

Change-Id: Iae938803213da2bb3b05204c1796ffa4babb39d0
2016-10-14 19:41:14 +00:00
Romain Guy
f60cc20048 JNI does not use hwui_flags but LOCAL_CFLAGS
Test: Manual
Change-Id: I109cb9dbce61079d2aa8d313b88f45e882ed9254
2016-10-12 18:25:05 -07:00
Romain Guy
253f2c213f Linear blending, step 1
NOTE: Linear blending is currently disabled in this CL as the
      feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
  or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
  colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
  to disable linear blending. This is only for GLES 2.0 GPUs
  with no hardware sRGB support. This flag is currently assumed
  to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
  This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
  why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
  of the source pixel. The asumption is that a bright pixel will be
  blended on a dark background and the other way around. The source
  alpha is gamma corrected to thicken dark on bright and thin
  bright on dark to match the intended design of fonts. This also
  matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
  could not be sampled in sRGB without a yet-to-be-defined GL
  extension
- The last column of color matrices is converted to linear space
  because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
2016-10-11 17:47:58 -07:00