3033 Commits

Author SHA1 Message Date
Chris Craik
b581e6704f Support for shader mutation
Bug: 36025103

Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases
Test: cts-tradefed run singleCommand cts-dev --module CtsUiRenderingTestCases
Test: manually inspected for leaks via SK_TRACK_SHADER_LIFETIME and forcing a GC after ComposeShaderTest

Change-Id: Ib5d33a80d2f9f468705806b05832e753508143cc
2017-03-09 15:19:46 -08:00
TreeHugger Robot
7cf9be0246 Merge "Make Bitmap.get/setPixel[s] color space aware" 2017-03-09 02:06:10 +00:00
Romain Guy
ce217faddb Make Bitmap.get/setPixel[s] color space aware
Bug: 32984164
Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.BitmapColorSpaceTest
Change-Id: Iee8c4abb264f0d2a44bae59788fbf4dcb2d0fdf7
2017-03-08 16:45:20 -08:00
TreeHugger Robot
dfcebf672d Merge "Write Bitmap's color space in parcel" 2017-03-08 02:06:49 +00:00
TreeHugger Robot
6587430d6f Merge "AdaptiveIconDrawable should handle all usage cases of setBounds Test: runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/AdaptiveIconDrawableTest.java" 2017-03-08 00:02:44 +00:00
Romain Guy
5acc476878 Write Bitmap's color space in parcel
This change also resets the cached color space field in Bitmap.java
when reconfigure() is called or when a bitmap is reused by the
bitmap factory.

Bug: 32072280
Test: CtsGraphicsTestCases.BitmapColorSpaceTest
Change-Id: I232b729b7a29e65bfff21dc749570c3c80adf855
2017-03-07 15:41:07 -08:00
Hyunyoung Song
0bbf4f5974 AdaptiveIconDrawable should handle all usage cases of setBounds
Test: runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/AdaptiveIconDrawableTest.java

b/35950873
b/35673169
b/34902453

adb  shell am instrument -e class 'android.graphics.drawable.AdaptiveIconDrawableTest' -w 'com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner'
android.graphics.drawable.AdaptiveIconDrawableTest:..

Time: 1.241

OK (2 tests)


Change-Id: I6498f6acc782a30188fc2afc50781cef83e4747b
2017-03-07 11:42:29 -08:00
TreeHugger Robot
7ef25b7894 Merge "Add ColorSpace information on Bitmap" 2017-03-07 18:37:13 +00:00
Clara Bayarri
3c4be77db9 Support non-system Font Providers
To do this, the developer must specify the set of certificate
hashes that represent the authority's app. This allows us to
verify that the authority we find is indeed the one intended
by the developer.

Bug: 35025705
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
CTS attached to topic
Change-Id: I605f9a93bbca8705936ead08efb4a5b4fdcc4882
2017-03-07 14:59:33 +00:00
Romain Guy
efb4b06493 Add ColorSpace information on Bitmap
This is the first step toward interpreting color spaces at render time.

Bug: 32984164
Test: BitmapColorSpaceTest in CtsGraphicsTestCases

Change-Id: I0164a18f1ed74a745874fe5229168042afe27a04
2017-03-06 19:33:25 -08:00
Roozbeh Pournader
b85f02e9ad Merge "Frameworks support for hyphenation for various complex cases" 2017-03-06 19:19:11 +00:00
Roozbeh Pournader
46c6f4c5ea Frameworks support for hyphenation for various complex cases
This adds better support for Arabic script languages, Armenian,
Catalan, Hebrew, Kannada, Malayalam, Polish, Tamil, and Telugu by
adding various hyphenation types and edits appropriate for the
locales.

The actual implementations are in Minikin. This CL takes care of the
changes needed in frameworks, to support different end-of-line and
start-of-line hyphen edits.

Two bugs in TextLine.java are also fixed:

1. Where hyphen edits on non-spanned texts were not eliminated in
handleRun() when they should have. This had manifested itself in
double hyphenation in some bidi paragraphs.

2. Some no op assignments and comparions around the change for the
above bug are removed.

Test: thorough manual testing for various cases
Bug: 19756624
Bug: 19950445
Bug: 19955011
Bug: 25623243
Bug: 26154469
Bug: 26154471
Bug: 33387871
Bug: 33560754
Bug: 33752592
Bug: 33754204
Change-Id: I48c047d1f6a75c39a78a6ea38a0a3282f63326ec
2017-03-03 15:34:42 -08:00
Hyunyoung Song
e4179e2c4e Change MaskableBitmap to AdaptiveBitmap
Test: $ make dist -j30
b/35399620

Change-Id: I96d6eaceaf7ce9dec7de21634a5fa2bd40b0deba
2017-03-01 15:14:02 -08:00
TreeHugger Robot
5d8caaafa6 Merge "Fix ShapeDrawable mutate, add clone() support to ArcShape, OvalShape" 2017-02-27 19:34:13 +00:00
TreeHugger Robot
d41189339b Merge "Make Half look like and behave like a boxed instance" 2017-02-27 17:19:10 +00:00
Romain Guy
95b52fd187 Make Half look like and behave like a boxed instance
Bug: 35765416
Test: HalfTest
Change-Id: I7ef52428f8b4e2c05b91d7eb37cc4cb5ecc5c6b9
2017-02-26 09:37:52 -08:00
Alan Viverette
446d988b44 Fix ShapeDrawable mutate, add clone() support to ArcShape, OvalShape
Also cleans up stray white space and fixes docs. Adds getters to ArcShape
properties so that we can write proper CTS tests.

Fixes: 35419960
Test: ArcShapeTest, OvalShape#testClone, ShapeDrawableTest
Change-Id: Icf1bae7f79f9294b2a60c49b85ce8749473ed61e
2017-02-24 11:14:24 -05:00
Romain Guy
4db2c229be Add CIECAT02 chromatic adaptation transform
Bug: 32984164
Test: CtsGraphicsTestCases
Change-Id: Id13ff88ab7a21901bd914ed740f859588099a18e
2017-02-23 15:23:55 -08:00
Andreas Gampe
a7993241a9 Graphics: Make SurfaceTexture compile-time initializable
Ensure that all static initializer code can be executed in the
compiler. Move native field caching into the native method
registration function.

Bug: 34956610
Test: m
Test: Device boots (Pixel)
Change-Id: Icf68c8fbadcaaa133a152942a3a7ba7aba84a1df
2017-02-20 16:18:24 -08:00
TreeHugger Robot
d89cf81f80 Merge "Change MaskableIconDrawable to AdaptiveIconDrawable" 2017-02-18 01:04:59 +00:00
Hyunyoung Song
be8835e86b Change MaskableIconDrawable to AdaptiveIconDrawable
Test: $ make -j31 dist

Bug: 35399620
Change-Id: I5e54f75b3df21ffe546e0e54dbd7ea29499d1789
2017-02-17 12:13:22 -08:00
Romain Guy
172873f5e6 Merge "Add RGBA 10:10:10:2 format for surfaces" 2017-02-17 19:25:08 +00:00
Clara Bayarri
b44abf2901 Use weight & style data for fonts from xml source
Bug: 34916944
Test: manual tests
Change-Id: I1d6e1c4c52859c5e9d7a8b0a247e4d0581935833
2017-02-16 18:21:23 +00:00
Romain Guy
8ec21062de Add RGBA 10:10:10:2 format for surfaces
Bug: 2984164
Test: CtsHardwareTestCases
Change-Id: I4a42cb9002d8f1f1362999f2739d06c712157620
2017-02-15 18:29:50 -08:00
Hyunyoung Song
966ad0b2f5 Remove color attribute from MaskableIconDrawable foreground/background tag
Test: manual test

Change-Id: Ia8426051aed8c4451b10cf415e179930caede974
2017-02-14 10:23:06 -08:00
TreeHugger Robot
02761acc67 Merge "Declarative downloadable fonts" 2017-02-14 15:39:04 +00:00
Clara Bayarri
4b5a4d221f Declarative downloadable fonts
Implement support for downloadable font requests in xml. Given the
xml fonts feature in O, this adds support to not only declare
local font files as font resources, but also Downloadable fonts
from a fonts provider.

A provider returns a font family (of one or more files) given a
query, so the new attributes are added to the font-family tag.

Additionally, add support to pre-declare downloadable font resources
in the Android Manifest. These will then be fetched at app startup
time so they are available to use from the Typeface cache asap.

When retrieving downloadable fonts via resources, the cache is
checked to see if the font is already there and is used, otherwise
a request is sent to the provider and the default font is returned
as we need a result synchronously.

To do this, the developer declares an additional fonts xml resource
file with the list of fonts to preload and links it in the manifest
with a meta-data tag.

E.g.:

res/font/mydownloadedfont.xml

<font-family xmlns:android="http://schemas.android.com/apk/res/android"
        android:fontProviderAuthority="com.example.test.fontprovider"
        android:fontProviderQuery="myrequestedfont">
</font-family>

res/font/preloaded_fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
    <font android:font="@font/mydownloadedfont" />
</font-family>

and in the AndroidManifest.xml

<meta-data android:name="preloaded_fonts"
    android:resource="@font/preloaded_fonts" />

Bug: 34660500, 34658116
Test: WIP, need to add more
Change-Id: I1d92555e115e241bf23b59e6f5c6cca6c7361de7
2017-02-14 13:32:41 +00:00
Derek Sollenberger
7183b6908b Merge "Deprecate Canvas save/saveLayer flags." 2017-02-14 13:31:21 +00:00
Hyunyoung Song
4d20ee8c46 Merge "Icon class should support Maskable bitmap type" 2017-02-13 23:36:15 +00:00
Derek Sollenberger
427acd7c77 Merge "Deprecate Canvas clipping for arbitrary Region.Ops." 2017-02-13 20:16:26 +00:00
Hyunyoung Song
9ee90a42dc Icon class should support Maskable bitmap type
Test: Unit test on IconTest
$ runtest --path=frameworks/base/graphics/tests/graphicstests/src/android/graphics/drawable/IconTest.java

b/34196580

Change-Id: I321c4b02f17ad9426c053216c4c88616a605aacf
2017-02-13 09:56:05 -08:00
Romain Guy
e8d2ebb5c2 Report bitmap config when decoding only metadata
With the introduction of support for 16 bit images, bitmaps returned
by BitmapFactory may be using the RGBA_F16 configuration. Some apps
and libraries assume the returned configuration is always ARGB_8888
and make assumptions based on that to compute cache sizes, etc.

This changes extract the output config when BitmapFactory is invoked
with the inJustDecodeBounds option. Despite its name, this option
is already used (and documented!) to decode more than bounds as it
also decodes the MIME type.

Bug: 35108998
Test: CtsGraphicsTestCases
Change-Id: If71959751458816678e42b21ab26c889aba5dea0
2017-02-10 11:37:54 -08:00
Derek Sollenberger
8c5759624c Deprecate Canvas clipping for arbitrary Region.Ops.
Operations that can expand the clip are difficult to support and
don't fit the parent child model that is used by the view system.

Test: compile
Bug: 14650725
Change-Id: I67e99d3e1a1eb0b231910ee5d277a38e8a953dc4
2017-02-09 14:17:55 -05:00
Derek Sollenberger
b8201195df Deprecate Canvas save/saveLayer flags.
Test: compile
Bug: 14650725
Change-Id: I6424ac46bae0a7a87c4b7743e81319945dfdd087
2017-02-09 13:18:25 -05:00
Phil Weaver
1e2758256a Merge "Provide text locations to accessibility services." 2017-02-07 19:14:09 +00:00
Phil Weaver
c2e28932d2 Provide text locations to accessibility services.
Bug: 30170631
Test: New CTS tests on linked CL.
Change-Id: I723e3777189c8df71c59dada00abdf339ebc983d
2017-02-06 12:57:17 -08:00
Clara Bayarri
b12397e57e Cache Downloaded Fonts in Typeface
If the requested Typeface is already loaded into memory, return
from the cache.

Test: none, optimization
Change-Id: I32422c47c68502ba83b7d976f6e05f70dda5daed
2017-02-06 10:46:34 +00:00
Hyunyoung Song
3084ec2df4 Handle nullable drawables inside MaskableIconDrawable
Test: manual test
b/34902453

Change-Id: I36fc48f7e4c1f6503a9c26b8f239c62da729b490
2017-02-02 00:59:13 -08:00
TreeHugger Robot
cf45c85297 Merge "Introduce set/getFontVariationSettings." 2017-01-31 05:46:27 +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
fe98ad919b Merge "Implement .xml font resource support" 2017-01-30 09:37:13 +00:00
Clara Bayarri
ed00bfdfae Implement .xml font resource support
This change implements the loading and parsing
of xml type font resources, and makes sure it is
used properly by TextView styles.

Test: run cts -m CtsContentTestCases -t android.content.res.cts.ResourcesTest
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources*

Change-Id: I5a2930b3ba7dad67d9607e9036a5dde6bab0c5a4
2017-01-27 20:16:48 +00:00
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
9b21265b2c Fix @links in reference docs. am: 54de77470d am: ab978c035e
am: 28ba4722a9

Change-Id: I98177a8cf0a20677e140406bb7371474ca259e5b
2017-01-26 04:44:54 +00:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
Seigo Nonaka
c65ea181da Fix crash with FontProvider
Need to freeze the FontFamily otherwise the FontFamily is not created.

Test: manually done
Change-Id: I81a6f0d295f13bbeb059deafb4283654f97c0090
2017-01-25 22:25:10 +09:00
TreeHugger Robot
68eb1ac342 Merge "Follow minikin::FontFamily constructor signature change." 2017-01-25 07:05:50 +00:00
Hyunyoung Song
8d07bfa437 Merge "Adds MaskableIconDrawable class to android.graphics.drawable package" 2017-01-24 23:01:40 +00:00
Hyunyoung Song
f665a32950 Adds MaskableIconDrawable class to android.graphics.drawable package
Test: manual test ag/1774462, cts tests ag/1813947

Bug: 32063838
Design doc: http://go/layered-icons-eng

- Reads in the mask path from config.
- If <maskable-icon> is dynamically created, clip the drawable using the mask path.
- Instead of using clipPath method, used BitmapShader for performance.

Change-Id: If5b4a24127bf823477c6c5d8a81d5093501d58e7
2017-01-24 12:00:02 -08:00
Clara Bayarri
b0812a3049 Introduce Fonts Content Provider
This change exposes to developers the ability to request fonts
from a provider via Typeface.

Until further security is implemented, only system apps can
provide fonts.

Test: See topic for CTS change
Change-Id: Ic7d5e2648340ee561f4d4c2d73a673748d2af076
2017-01-24 19:32:09 +00:00