3070 Commits

Author SHA1 Message Date
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
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
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
Romain Guy
dd2b7ccabc Merge "Rename getIntent() to getRenderIntent()" into oc-dev am: b2bb3bf268
am: 98e11587f2

Change-Id: Ic5c95f3f4f811a1f668ec6218371efd3fe169371
2017-04-06 22:47:21 +00: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
Seigo Nonaka
815c5b23ce Merge "Pass weight/italic pair instead of style." into oc-dev am: b4e3b344fa
am: 97b35a7089

Change-Id: Id75281df282cf6f0b77def2c7cffcc88ef92c417
2017-04-05 10:19:10 +00:00
TreeHugger Robot
b4e3b344fa Merge "Pass weight/italic pair instead of style." into oc-dev 2017-04-05 10:04:52 +00:00
Alan Viverette
c2c582bded Merge "Refresh opacity and statefulness on tint change" into oc-dev am: 8f6b9d8058
am: 77c7e2548a

Change-Id: Id5a18252950b93d2635a7eb1174052080511a07f
2017-04-04 19:31:19 +00:00
TreeHugger Robot
8f6b9d8058 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-04 19:05:02 +00:00
TreeHugger Robot
4e4252354d Merge changes from topics 'KeyboardFocusHighlight_mUseDefaultFocusHighlight', 'KeyboardFocusHighlight', 'KeyboardFocusHighlight_DetectUnhandled'
* changes:
  Draw a default focus highlight if needed.
  Add a public API defaultFocusHighlightEnabled.
  Detect unhandled keyboard focused state.
2017-04-04 18:38:21 +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
Seigo Nonaka
c802751704 Merge "Reorganize font enumeration API." into oc-dev am: 2ac9698271
am: de5fa6b3d8

Change-Id: I72a02f3f681b3b5f82cffc317fe0668e842464fe
2017-04-04 17:04:40 +00: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
Narayan Kamath
1163568d7c Merge "Properly guard access to CloseGuard in finalizers." 2017-04-04 12:27:02 +00:00
Ian Pedowitz
4d91cb1bd3 Merge "Revert "Refresh opacity and statefulness on tint change"" into oc-dev am: 61117c61d7
am: 3f4d2f28f8

Change-Id: I16f52d3dc55861bdbc9813a5ea2bf91f24eabf87
2017-04-04 03:53:51 +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
Alan Viverette
111f8509ea Merge "Refresh opacity and statefulness on tint change" into oc-dev am: 265dbc1f09
am: 1148bc819a

Change-Id: I76faf6d25666c1b5612c009cfd9081465f319589
2017-04-03 23:06:43 +00:00
TreeHugger Robot
265dbc1f09 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-03 22:47:32 +00:00
Romain Guy
713604726e Merge "Make Color non-final because apps break..." into oc-dev am: c0c524af4f
am: 97497985ad

Change-Id: Id10b82a9f6e6092a121a3fb35b28ff120b35b86f
2017-04-03 21:36: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
126159a88f Merge "Add app bounds to configuration." into oc-dev am: 7efe56b779
am: 59d1f8a024

Change-Id: Iae8e43872eee11214347cfb935793e9356a50e08
2017-04-03 18:00:08 +00:00
Hyunyoung Song
4794829a1e Merge "Prevent NPE when draw is called without bounds being set Test: unit test inside AdaptiveIconDrawableTest.java" into oc-dev am: 891e03203c
am: d16d17881e

Change-Id: I96db9ee1a5bb9fc2085e43733638a6b21f50fe65
2017-04-03 17:49:19 +00:00
Narayan Kamath
492e9e851c Properly guard access to CloseGuard in finalizers.
CloseGuard instances are allocated in constructors and usually
assigned to final fields. This implies they're non-null in finalizers
except in the case where the constructor throws. We add a null check
to make sure we can continue cleaning up other state in the finalizer
(if applicable).

Also, this change decouples closeguard warnings in constructors
from other state based logic. This because the logic there is usually
duplicated with the call to close().

NOTE: This change is not a "complete" fix. Many of these finalizers
are broken in the case where <init> throws. The only objective of
this change is to make such errors more obvious.

Note that some of these classes don't have CTS tests.

Test: make, CtsMediaTestCases.
Bug: 35609098

Change-Id: I24d9e0215f80e44914dba8ab99b6312fd6ed1fc0
2017-04-03 18:12:04 +01: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
0e5adc0d78 Merge changes from topic 'bitmapfactory-options-outdecodecolorspace' into oc-dev am: 81b292abdf
am: 66421a8d81

Change-Id: Ib4f0f82441553ff8862f6f4d2dc7e6ef61f16e47
2017-04-01 04:32:15 +00: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
Jiaquan He
f380072eef 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-03-30 12:28:40 -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
TreeHugger Robot
b37e97bba6 Merge "Update Color API" 2017-03-28 18:32:22 +00:00
TreeHugger Robot
32f93274bd Merge "Do not use many FDs in FontManagerService." 2017-03-28 17:54:05 +00:00
Seigo Nonaka
455f1bfc05 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
2017-03-28 08:34:14 -07:00
TreeHugger Robot
186c0d1d91 Merge "Add RAW_DEPTH image format" 2017-03-28 07:17:11 +00:00
Romain Guy
48f38f1838 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
2017-03-25 23:51:38 +00:00