3064 Commits

Author SHA1 Message Date
TreeHugger Robot
4cae059bb9 Merge "Add more doc to ColorSpace.getName()" into oc-dev 2017-04-14 03:10:16 +00:00
Romain Guy
819740cc73 Merge "Range check transfer params in float domain" into oc-dev 2017-04-13 23:35:27 +00:00
Romain Guy
bfa58aab0a Range check transfer params in float domain
Our native code uses floats for transfer parameters, the range
check was too small (using the next representable double instead
of the next representable float).

Bug: 37013532
Test: Manual run of broken app, CtsGraphicsTestCases
Change-Id: Id91a3e62068be0abf13ee75e39c758eb106a5f24
2017-04-13 12:59:38 -07:00
TreeHugger Robot
729a515e5e Merge "Introduce setFallbackTypeface" into oc-dev 2017-04-13 19:21:25 +00:00
Romain Guy
cb7a24539b Add more doc to ColorSpace.getName()
Bug: 37084802
Test: make offline SDK docs
Change-Id: Ia2c3406951d615dcee1eafad8035c5c8aea4305b
2017-04-13 10:21:05 -07:00
TreeHugger Robot
d09be1c0e9 Merge "Introduce FontsContract.requestFont and deprecate Typeface.create" into oc-dev 2017-04-13 17:13:37 +00:00
Seigo Nonaka
5b6347a6af Introduce setFallbackTypeface
setFallbackTypeface is returned by Builder.build() method when the
provided font is not loaded due to some reasons.
The fallback family is resolved with width/italic passed to Builder.

Bug: 36794225
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I65e220aca823fd815a52437b11c8e6dc952de8e2
2017-04-13 10:12:27 -07:00
Hyunyoung Song
76c13a5fce Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev 2017-04-13 16:53:43 +00:00
Lucas Dupin
498a44f33a Merge "Add transfer mode support to ShapeDrawable" into oc-dev 2017-04-13 16:52:01 +00:00
Seigo Nonaka
0b73a4287e Introduce FontsContract.requestFont and deprecate Typeface.create
Since background fetch should be synchronized with life cycle of
Activities, so should not create new background thread inside this
method. Not to break existing apps, mark as deprecated and will be
removed from public API untile next release.

New API accepts Handler so that the developer can pass their own thread
.

Test: TBD
Bug: 37253785
Change-Id: I87fdc6a354a829db679253824f42489f25698fa0
2017-04-13 06:48:07 -07:00
TreeHugger Robot
061db23b79 Merge "Introduce FontsContract.fetchFonts and expose URI for watching." into oc-dev 2017-04-13 13:22:10 +00:00
Hyunyoung Song
92e3da2354 Update API, add more documentation on AdaptiveIconDrawable
and fix multiple miscellaneous bugs.

Bug: 37079814
Bug: 37100106
Bug: 34829216

Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java
Test: $ runtest --path=frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/grpahics/drawable/AdaptiveIconDrawableTest.java

Change-Id: I0f5b2232853031bf3860ebea2736e894d17e4d2e
2017-04-12 16:06:45 -07:00
TreeHugger Robot
18d993bb72 Merge changes from topics 'KeyboardFocusHighlight-oc-dev', 'KeyboardFocusHighlight_ mDefaultFocusHighlightEnabled-oc-dev', 'KeyboardFocusHighlight_ hasFocusStateSpecified-oc-dev' into oc-dev
* changes:
  Fix broken CTS tests.
  Draw a default focus highlight if needed.
  Add a public API defaultFocusHighlightEnabled.
  Detect unhandled keyboard focused state.
2017-04-12 22:40:15 +00:00
Seigo Nonaka
69754bf66d Introduce FontsContract.fetchFonts and expose URI for watching.
FontsContract.fetchFonts provides a low level font access with fonts
provider.
This CL also includes:
- Introduce new class FontFamilyResult/Font as the inner static class
of FontsContract which are used to for result value of fetchFont..
- Introduce a functionality to FontsContract to be able to create
Typeface from an array of FontResult.
- Expose URI of each file entries to be able to register ContentObserver

Bug: 36494487
Bug: 36085028
Test: android.provider.FontsContract passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.fonts.cts.FontResultTest passes

Change-Id: Id6f85039d0e86be063ef099d7ec6bfd97e4424c5
2017-04-12 13:52:37 -07:00
Seigo Nonaka
1e924df63e Merge "Update Typeface.Builder API to reflect API feedback." into oc-dev 2017-04-12 19:39:50 +00:00
TreeHugger Robot
7944962b7e Merge "Change behavior of setBitmap to cleanly reset the canvas" into oc-dev 2017-04-12 17:37:08 +00:00
TreeHugger Robot
feaa8b0f01 Merge "Remove unused public APIs." into oc-dev 2017-04-12 17:31:44 +00:00
Seigo Nonaka
5421e81023 Update Typeface.Builder API to reflect API feedback.
- Stop pooling and remove reset method.
- Introduce overloaded constructors instead of setSource methods.
- Make italic parameter boolean and treat "not called" as
  RESOLVE_BY_FONT_TABLE.
- Remove constants and move them to Typeface with private static
  constant.
- Fix JavaDoc.

Bug: 37082657
Test: android.graphics.cts.TypefaceTest passed
Change-Id: I0c50cf3e2d50c0021f7e12bbb7ed7ae89fa1c2a1
2017-04-12 07:12:41 -07:00
Seigo Nonaka
042741ce4f Remove unused public APIs.
By I9ccafe7a53935960566243e2856e166878ca59ae, FontManager was gone.
So FontConfig is no longer need to be parcelable.
We can drop Parcel interface from FontVariationAxis.

Bug: N/A
Test: N/A
Change-Id: I33e92abf1e1063af312f0b7d9d6b8bd938d09c0e
2017-04-11 13:02:49 -07:00
Derek Sollenberger
eb69cbbe22 Change behavior of setBitmap to cleanly reset the canvas
- identity matrix
 - no save stack
 - wide-open clip

This reverts commit 4f641d1e4586b027969052cc0ad6b65c1158e72e

Test: bit CtsGraphicsTestCases:.CanvasTest
Bug: 36218535
Change-Id: Id11deb06e37d6df61f1f171d424ab150d812a7a8
2017-04-11 14:00:25 -04:00
Romain Guy
66d7da6a41 Hide ColorSpace.Renderer
Bug: 37073273
Test: Compile, make sure CTS does not rely on this API
Change-Id: Ia5d2638676be44464a173f904a21158c554b9ebf
2017-04-11 16:24:56 +02:00
Jiaquan He
4a81674b45 Detect unhandled keyboard focused state.
A View uses a Drawable as its background, which changes
its appearance according to the View's state. This commit
adds an algorithm to detect undefined state_focused in
state specs for those Drawables.

Test: cts-tradefed run singleCommand cts --skip-device-info
--skip-preconditions --abi armeabi-v7a -m CtsGraphicsTestCases
-t android.graphics.drawable.cts.DefaultFocusHighlightTest
Bug: 35096940

Change-Id: I5e9f07141679881fe88f9040aa116ea2f9d537c9
2017-04-10 21:01:49 +00:00
Romain Guy
8242656f49 Color management, the missing pieces
Implement missing color management pieces for bitmaps:

- Bitmap.createBitmap(Bitmap src, ...) now creates a bitmap
  in the same color space as the source bitmap
- Bitmap.createScaledBitmap() now creates a bitmap in the
  same color space as the source bitmap
- Bitmap.createBitmap(..., ColorSpace colorSpace) to create
  bitmaps in a specific color space
- Fix copy from A8 to F16
- Copying bitmaps in F16 or with a color space does not work,
  it's currently a limitation in Skia

Bug: 36905374
Test: BitmapColorSpaceTest
Change-Id: I0092fe4432511db50daa3a9393389a9db05e0c2a
2017-04-07 07:56:14 -07:00
TreeHugger Robot
b2bb3bf268 Merge "Rename getIntent() to getRenderIntent()" into oc-dev 2017-04-06 21:34:17 +00:00
Romain Guy
1cf7b4fcb3 Rename getIntent() to getRenderIntent()
Bug: 37077433
Test: compile and ColorSpaceTests
Change-Id: I8eb1fa6136582eaac1d509ebfef7f67b0fffe1aa
2017-04-06 12:37:03 -07:00
Lucas Dupin
98bf27bff4 Add transfer mode support to ShapeDrawable
Test: runtest --path cts/tests/tests/graphics/src/android/graphics/drawable/cts/ShapeDrawableTest.java
Change-Id: I754cf20fda3fe5c28ba70aab089f9bebd27ca2bf
2017-04-05 11:05:15 -07:00
TreeHugger Robot
b4e3b344fa Merge "Pass weight/italic pair instead of style." into oc-dev 2017-04-05 10:04:52 +00:00
TreeHugger Robot
8f6b9d8058 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-04 19:05:02 +00:00
Seigo Nonaka
fe04aa840e Pass weight/italic pair instead of style.
Typeface.NORMAL/BOLD/ITALIC/ITALIC_BOLD is used for specifying relative
from current Typeface. For example

  Typeface face = Typeface.create("serif");
  Typeface thickerFace = Typeface.create(face, Typeface.BOLD);
  Typeface moreThickerFace = Typeface.create(tickerFace, Typface.BOLD);

For the purpose of providing font information, we should use weight/italic
value instead of style in Typeface.
The Columns.STYLE field was kept for preventing runtime crash of demo
apps.

Test: Manually
Change-Id: I732e8ee04a66f61321fc0a98dbfb8fdc0a4dd7a4
2017-04-04 10:12:55 -07:00
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Alan Viverette
ad7e748543 Refresh opacity and statefulness on tint change
Also warns when LayerDrawable is created with an invalid child. This
is not guaranteed to fail, but it's usually a bad sign.

Bug: 33124798
Test: LayerDrawableTest, DrawableContainerTest
Change-Id: Ie3e4200b27a9814cee7f5711d7df9710db513953
2017-04-04 11:02:37 -04: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