3109 Commits

Author SHA1 Message Date
Seigo Nonaka
16caccbcd9 Merge "Fix boot loop issue on Android Wear." into oc-dev am: 5f9fde884b
am: f08388e8ea

Change-Id: I5c61dfb5166e4456f55ef79a122c8fc0b312ed86
2017-04-14 22:24:34 +00:00
TreeHugger Robot
5f9fde884b Merge "Fix boot loop issue on Android Wear." into oc-dev 2017-04-14 22:16:22 +00:00
Romain Guy
908370bb27 Merge "Add BitmapFactory.Options.inColorSpace" into oc-dev am: c99bcc69f7
am: f713a1960e

Change-Id: Ie1d361e946cf68ba97352ef6946f9d82ed5b784b
2017-04-14 21:19:25 +00:00
Romain Guy
e9cbbea820 Merge "Clarify doc for Bitmap.createBitmap()" into oc-dev am: 1eaab2db82
am: fd715c7fbe

Change-Id: I1b97afca9c46a6e2c1c33a9f68da49e43c039b46
2017-04-14 21:10:00 +00:00
Romain Guy
c99bcc69f7 Merge "Add BitmapFactory.Options.inColorSpace" into oc-dev 2017-04-14 21:08:42 +00:00
Romain Guy
c6866a988a Merge "Fix API feedback on Color" into oc-dev am: 03758701fb
am: 7700c2b238

Change-Id: I64f6dcabfd1722475947be3b3e3cc636b724dbed
2017-04-14 20:57:07 +00:00
TreeHugger Robot
1eaab2db82 Merge "Clarify doc for Bitmap.createBitmap()" into oc-dev 2017-04-14 20:53:26 +00:00
TreeHugger Robot
03758701fb Merge "Fix API feedback on Color" into oc-dev 2017-04-14 20:42:19 +00:00
Seigo Nonaka
24c6464663 Merge "Use provided style for fallback font selection" into oc-dev am: 43112fd26e
am: 83c52e0a40

Change-Id: Ia42f6a377c2617c8da9a84cb8bd7781326e464a1
2017-04-14 18:09:55 +00:00
Romain Guy
65d8ce4676 Merge "Merge "Add more doc to ColorSpace.getName()" into oc-dev am: 4cae059bb9" into oc-dev-plus-aosp
am: e9277ebe4a

Change-Id: I187ec4ffcb2db909443e3c7286e1cdde7bc9193b
2017-04-14 17:29:55 +00:00
Romain Guy
95648b8a59 Add BitmapFactory.Options.inColorSpace
This allows applications to load bitmap in a preferred
target color space, similar to inPreferredConfig for
configurations.

This change also applies recent changes made to BitmapFactory
to BitmapRegionDecoder: support for outColorSpace, inColorSpace
and outConfig.

Bug: 32984164, 36905374
Test: CtsGraphicsTestCase (BitmapColorSpaceTest/BitmapRegionDecoderTest)
Change-Id: I4eded9190d1aa9c7f3033f9bb78a6854cc48a3ef
2017-04-14 10:14:27 -07:00
Romain Guy
b7c30edeb1 Merge "Range check transfer params in float domain" into oc-dev am: 819740cc73
am: 1f1667122a

Change-Id: I5240515f1dd5939227f90b8b2aaf59622af6bea7
2017-04-14 16:33:12 +00:00
Seigo Nonaka
659c9cfac3 Merge "Introduce setFallbackTypeface" into oc-dev am: 729a515e5e
am: 17452ee553

Change-Id: I66fe816727aae3fdf617c41796b25478090704fe
2017-04-14 15:31:25 +00:00
Seigo Nonaka
43112fd26e Merge "Use provided style for fallback font selection" into oc-dev 2017-04-14 15:13:15 +00:00
Romain Guy
7c42e16eb0 Clarify doc for Bitmap.createBitmap()
Bug: 37323693
Test: compiles
Change-Id: I8cf316cf4c67b69c47c67848c576af6399a0111f
2017-04-13 20:48:29 -07:00
Romain Guy
26ca96ecb8 Fix API feedback on Color
Bug: 37323188
Test: Color_ColorLongTest and ColorSpaceTest in CtsGraphicsTestCases
Change-Id: I1e52d3f63f95b9bdb4410938b727a87c45429aac
2017-04-13 20:40:46 -07:00
TreeHugger Robot
4cae059bb9 Merge "Add more doc to ColorSpace.getName()" into oc-dev 2017-04-14 03:10:16 +00:00
Seigo Nonaka
bf629ed080 Fix boot loop issue on Android Wear.
The boot loop was seen after I65e220aca823fd815a52437b11c8e6dc952de8e2
but only on Android Wear. On Android Wear, some font files are missing
but are listed in fonts.xml. Before that patch, we created a Typeface
object with an empty FontFamily even if there was no valid font entry
in font-family tag. However, after that patch, FontFamily stopped
creating native objects and holds a null pointer instead. As the
result, SIGSEGV happens.

The right fix is skipping Typeface creation if native code failed to
create the font family object.

Since Typeface.init cannot be called twice, this is hard to test
automatically.

Bug: 37328609
Bug: 37326002
Test: Boot succeeded even after removing CutiveMono.ttf from system.

Change-Id: I125de07343252784986d728c3bbaa46b24ace601
2017-04-13 18:58:36 -07:00
Seigo Nonaka
d154829cb1 Use provided style for fallback font selection
If the developer gives some weight/italic to the Typeface.Builder
the fallback used the metadata in the font file. We should use
provided data instead.

This CL also adjusts upper and lower limits on weight, from 100..900 to
1..1000

Bug: 37257745
Bug: 37251569
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I7cf390d96b49afcce359928373698b0c9a9babd8
2017-04-14 00:54:46 +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
Seigo Nonaka
b87a2f041d Merge "Introduce FontsContract.requestFont and deprecate Typeface.create" into oc-dev am: d09be1c0e9
am: 284944c7f8

Change-Id: Idae84335677a859641b6660589848e04b4a38474
2017-04-13 17:57:46 +00:00
Hyunyoung Song
47da8197b1 Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev am: 76c13a5fce
am: e99cf60039

Change-Id: Ib821f43548e938a7652f62ef444e0a116aa8a58b
2017-04-13 17:31:16 +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
Lucas Dupin
0f328d480a Merge "Add transfer mode support to ShapeDrawable" into oc-dev am: 498a44f33a
am: 914519abfb

Change-Id: Ib61666ec7103dab2e40d6e68e8a49fcf4c46a9b2
2017-04-13 17:14:58 +00: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
Seigo Nonaka
193743ad1c Merge "Introduce FontsContract.fetchFonts and expose URI for watching." into oc-dev am: 061db23b79
am: c0c5763793

Change-Id: Ibe1167effdbe6ae39f10793691e2722900cd7af7
2017-04-13 13:33:28 +00: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
ecc3afd49a Merge "Update Typeface.Builder API to reflect API feedback." into oc-dev am: 1e924df63e
am: fa4b862518

Change-Id: I0aa32f46d20a5d46454f2a6057db2ca0e70f1d84
2017-04-12 21:37:09 +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
Derek Sollenberger
86a1c30a11 Merge "Change behavior of setBitmap to cleanly reset the canvas" into oc-dev am: 7944962b7e
am: 43844db75d

Change-Id: I8e362993a2fc51ce93015924d4819884301aa0c1
2017-04-12 17:59:18 +00:00
Seigo Nonaka
7bb1c18b58 Merge "Remove unused public APIs." into oc-dev am: feaa8b0f01
am: d40151e581

Change-Id: Iaf7d6950c821acd48c87dd76b747a8065193de29
2017-04-12 17:50:10 +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
e5f46a433a Merge "Hide ColorSpace.Renderer" into oc-dev am: 5094caafc2
am: 3509d1f790

Change-Id: Ic7bb2ee6326a9152bbd3bb015025d8f39d7a2527
2017-04-11 16:51:25 +00: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
0246a298f9 Merge "Color management, the missing pieces" into oc-dev am: 7dfa16c2ef
am: 3eafcb2d8b

Change-Id: I079d8d17982eecc022f2a53e1e6ca193dc7a3ace
2017-04-07 18:48:57 +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