3034 Commits

Author SHA1 Message Date
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Ian Pedowitz
61117c61d7 Merge "Revert "Refresh opacity and statefulness on tint change"" into oc-dev 2017-04-04 03:38:58 +00:00
Yohei Yukawa
55fed16929 Revert "Refresh opacity and statefulness on tint change"
This reverts commit 1eda069f7c9a36e58c17ecf185a5c0906be5df95.

Reason to revert:
The setup wizard started throwing android.view.InflateException due to
I89f6d804fb025f426aefdee67559778cf03015bb. Temporarily reverting that
change until we figure out what is going on.

Change-Id: I9344a3402f2fab02f4fe49a6a8ad91970b2d3b3e
Test: Manually verified that the setup wizard no longer crashes.
Bug: 33124798
Bug: 36870685
2017-04-04 03:30:01 +00:00
TreeHugger Robot
265dbc1f09 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-03 22:47:32 +00:00
TreeHugger Robot
c0c524af4f Merge "Make Color non-final because apps break..." into oc-dev 2017-04-03 21:21:18 +00:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
Romain Guy
bae8b52c71 Make Color non-final because apps break...
Bug: 36858735
Test: Manual run of crashing app
Change-Id: I3eb06260074ee6950bc91731e7093a26d7e32b49
2017-04-03 11:51:11 -07:00
Bryce Lee
7efe56b779 Merge "Add app bounds to configuration." into oc-dev 2017-04-03 14:30:49 +00:00
Hyunyoung Song
55211c032c Prevent NPE when draw is called without bounds being set
Test: unit test inside AdaptiveIconDrawableTest.java

Change-Id: Ic3260ce9c6bae595c7eba7be1cd7ae249939a1cf
2017-04-03 00:23:49 -07:00
Bryce Lee
7566d76c61 Add app bounds to configuration.
The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.

This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.

Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
2017-03-31 21:34:30 -07:00
Romain Guy
c7dacca008 Documentation for PorterDuffXfermode
It tooks 10 years, but better late than never!

Bug: 32984164
Test: Compiled documentation and checked in Chrome
Change-Id: I6dfd7fba6d3077f8c774b203589083bdbc15f9d2
2017-03-31 18:56:37 -07:00
Romain Guy
90fc43b33d Query color space before decoding a bitmap
This follows the pattern established by other "out" fields
in BitmapFactory.Options

Bug: 32984164
Test: CtsGraphicsTestCases

Change-Id: Ie72e47338b578b41c550453e2698d2d49eddf6da
2017-03-31 09:09:57 -07:00
Alan Viverette
1eda069f7c Refresh opacity and statefulness on tint change
Bug: 33124798
Test: DrawableContainerTest#testOpacityChange #testStatefulnessChange
Test: LayerDrawableTest#testOpacityChange #testStatefulnessChange
Change-Id: I89f6d804fb025f426aefdee67559778cf03015bb
2017-03-29 20:26:09 +00:00
Seigo Nonaka
c0cf4f09f4 Do not use many FDs in FontManagerService.
Currently there are over 170 font files are installed in system directory.
Opening 170+ files and keep them is not unacceptable. Pass URI instead.

At the same time, this CL hides full font path from FontConfig since
/system/fonts directory will be deprecated in future.

Bug: 36660849
Test: android.text.cts.FontManagerTest passed
Change-Id: I1d216dc9c6dec702a4ce3b946bfda6dcbe12b7fe
(cherry picked from commit 455f1bfc05bf972ee4fe8cd5fa135ed232126bb7)
2017-03-29 17:01:16 +00:00
Romain Guy
026a558ab0 Update Color API
Make the class final because its instances are immutable and
it contained only static methods prior to O. Fix a couple of
typos/issues reported by external developers. Add a new variant
of getComponents() to avoid allocations, as requested by
external dev.

Test: Color_ColorLongTest
Bug: 32984164
Change-Id: I3c22e124c9fdf66142d530afa4beb05fe0669359
(cherry picked from commit 48f38f18385e8aed0df48524d8ea3d20eba9199f)
2017-03-28 18:33:47 +00:00
Seigo Nonaka
a4ab320e0a Use variation settings for Typeface creation.
Bug: 35416390
Test: android.graphics.cts.TypefaceTest passed
Change-Id: Ieefa2cf095fb1031d3c7ac99fd59710311d7ede3
2017-03-23 10:03:55 -07:00
TreeHugger Robot
2a820bdf50 Merge "Revive old method to prevent crash internal app." 2017-03-22 18:03:45 +00:00
Philip P. Moltmann
6a4486e1c5 Merge "Use only official pdfium APIs" 2017-03-22 16:20:41 +00:00
Seigo Nonaka
2660aca491 Revive old method to prevent crash internal app.
Bug: 36509029
Test: N/A
Change-Id: I4e04847de7b61a790323257c09da9a960a6689d5
2017-03-22 09:14:33 -07:00
TreeHugger Robot
c34f786677 Merge "Unhide Typeface construction APIs." 2017-03-22 15:40:23 +00:00
Clara Bayarri
fb483cc90c XML Support for non system font providers
The certs needed to identify non preinstalled providers
can now be declared in XML, using a resources array.

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
Bug: 35025705
Change-Id: Ibf12ad409aa5a873ddb32b1383c147728e664c23
2017-03-22 11:47:51 +00:00
Seigo Nonaka
b2c20d880d Unhide Typeface construction APIs.
These APIs are necessary to construct Typeface from various combination
TTC index, variation settings, etc.

Bug: 33062398
Test: android.graphics.cts.TypefaceTest passes
Change-Id: Ie069700ed4f67efbec55331bef867f94d58e2a61
2017-03-21 19:55:38 -07:00
TreeHugger Robot
713b869aad Merge "Expose Typeface creation APIs with ttc and font variation." 2017-03-21 22:50:20 +00:00
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