3109 Commits

Author SHA1 Message Date
Seigo Nonaka
20e5d91739 Expose Typeface creation APIs with ttc and font variation.
Introduce Builder class for creating Typeface from various
sources with optional TTC index and font variation settings.

Bug: 33062398
Test: Manually verified new Builder create Typeface.
Change-Id: Ia23ee6a73516707d854c7387fe75fbb22f80673d
2017-03-21 13:27:33 -07:00
sergeyv
b94f89094a Allow draw hw bitmap on software canvas for hierarchyviewer
Test: runs hierarchyviewer on app with hw bitmaps
bug:34745484
Change-Id: I35f70f7927be23edebac171f3bc96405b14ca794
2017-03-21 17:26:22 +00:00
Philip P. Moltmann
d55f20d301 Use only official pdfium APIs
Fixes: 28051413
Test: cts-tradefed run cts-dev -m CtsGraphicsTestCases -t android.graphics.pdf.cts
      cts-tradefed run cts-dev -m Print -t android.print.pdf.cts
Change-Id: Iab52463ba225d3cddb1e97fe52cb9f56318cce68
2017-03-20 12:31:30 -07:00
TreeHugger Robot
7d50ff11db Merge "Notify caller if none of settings are effective." 2017-03-20 17:37:15 +00:00
Chris Craik
97b4ccbd97 Merge "Expose color filter mutate methods" 2017-03-17 00:32:21 +00:00
Hyunyoung Song
5d0a358b62 Merge "Add LauncherIcons.AdaptiveIconDrawableWithShadow class to support shadow b/36088922" 2017-03-16 22:51:43 +00:00
Chris Craik
6097eca721 Expose color filter mutate methods
Bug: 36025103
Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases

Now, similar to Shaders, we defer native creation until Paint is being
used, and ensure that we have an up to date filter when drawing.

Also implements ColorMatrix#equals to behave like Matrix#equals.

Change-Id: I5f74addd97f5662800802e6f660fead58d518725
2017-03-16 15:45:43 -07:00
Hyunyoung Song
547010ff86 Add LauncherIcons.AdaptiveIconDrawableWithShadow class to support shadow
b/36088922

Test: Settings app
This utility class can be used to bake shadow in drawable level in
system ui surfaces such as Settings, Overview and ShareSheet.

Change-Id: Iaec867d9ce5b949380c1e5004b68269d1bbeacd4
2017-03-16 13:51:28 -07:00
Clara Bayarri
c4a6d29ac6 Merge "Provide ApplicationContext to Typeface for font requests" 2017-03-16 09:40:39 +00:00
Seigo Nonaka
0763650a13 Notify caller if none of settings are effective.
Now setFontVariationSettings returns false if the given settings is not
effective.

Bug:35764323
Test: ran TextViewTest and PaintTest in cts
Change-Id: Ic31d9e47ec006c8e7bb2c907ff0ea2936bd71d01
2017-03-15 14:05:37 -07:00
TreeHugger Robot
2bd530e156 Merge "Pass advances to Minikin for calculating getTextRunCursor" 2017-03-15 19:53:16 +00:00
TreeHugger Robot
aa0b3a8da1 Merge "Modify createBitmap w/ crop and matrix to not rely on Canvas.setBitmap" 2017-03-15 19:23:08 +00:00
Clara Bayarri
ff221613ec Provide ApplicationContext to Typeface for font requests
We were using a generic context that caused crashes for
the content providers.

Bug: 34657204
Test: manual, calling getCallingPackage() from the provider
doesn't crash anymore.

Change-Id: I2b61e6510d8c6647007987373d03ee5dc97c0889
2017-03-15 17:38:56 +00:00
Seigo Nonaka
ac873c9f25 Clean up public FontConfig APIs
This CL contains following clean up:

- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.

Test: ran android.content.res.FontResourcesParserTest

Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
2017-03-15 10:16:55 -07:00
Derek Sollenberger
29cd3e9226 Modify createBitmap w/ crop and matrix to not rely on Canvas.setBitmap
Test: CtsGraphicsTestCases BitmapTest
Bug: 36218535
Change-Id: I972f3ed6d037f6cae7a36fd2e612df9ab40a8b2d
2017-03-15 11:28:50 -04:00
Chris Craik
95e8afbb5e Merge "Revert "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip"" 2017-03-14 23:35:29 +00:00
Tony Mantler
4f641d1e45 Revert "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip"
https://buganizer.corp.google.com/issues/36218535

This reverts commit 269f989fbf198b17994baf9141c4640aeaf34b4e.

Change-Id: Ib2473e4fce90c9abaa39eea2b77082ae26197b80
2017-03-14 22:40:31 +00:00
Romain Guy
5ccb12294e Merge "Use d=0.039 for Display P3 instead of sRGB's 0.04045" 2017-03-14 22:28:08 +00:00
Roozbeh Pournader
5d74b1c76f Pass advances to Minikin for calculating getTextRunCursor
Previously, the getTextRunCursor() implementation in Minikin ignored
the font and just used the characters in the buffer in order to
determine cursor positions. Now we calculate the advances beforehand
in order to find potential Indic clusters.

Test: Manually tested some Tamil sequences
Bug: 35721792
Change-Id: I2500bd4c2c9d07bb6c965b2d41e04853886a7391
2017-03-14 13:11:40 -07:00
Romain Guy
494f784e47 Use d=0.039 for Display P3 instead of sRGB's 0.04045
Bug: 32984164
Test: ColorSpaceTest
Change-Id: I4dd38a660e5130f36e424a3e7eb62e3d65ef2d2f
2017-03-13 14:12:57 -07:00
Chris Craik
00128ab0b5 Merge "Fix ShapeDrawable#mutate" 2017-03-13 17:34:40 +00:00
TreeHugger Robot
1965d2898c Merge "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip" 2017-03-13 17:33:05 +00:00
Mike Reed
269f989fbf Change behavior of setBitmap to cleanly reset the canvas
- identity matrix
- no save stack
- wide-open clip

Behavior around the new bitmap is the same.

Tests : CtsGraphicsTestCases

Change-Id: Ieaf8c2a1b96262ed33940dd852a86089eb93efdb
2017-03-13 15:39:57 +00:00
Chris Craik
957b3372f2 Add comment to Shader#mLocalMatrix
Test: just comments, none

Change-Id: Idd337deef5fa796f3d83ffbddca58949b27d5169
2017-03-10 16:54:39 -08:00
Chris Craik
374347a5fe Fix ShapeDrawable#mutate
Fixes: 35940396
Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases --test android.graphics.drawable.cts.ShapeDrawableTest

Change-Id: I5731ce131785ded07bcde9e54ecb9d4f5dcfa96b
2017-03-10 16:39:09 -08:00
TreeHugger Robot
a2b2a29078 Merge "Allow Font providers to return status codes" 2017-03-10 18:10:43 +00:00
Clara Bayarri
bacf2352ab Allow Font providers to return status codes
This was requested by the current users, need to state
that a font is unavailable (needs downloading) or that
the query is unsupported.

Also add tests :)

Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
Also CTS attached to topic
Bug: 35097775
Change-Id: Ib15bf4c70185d81a4c20426722eb44c4210771c2
2017-03-10 16:24:04 +00:00
Chris Craik
b20f320954 Merge "Support for shader mutation" 2017-03-10 01:46:08 +00:00
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