Bug: 71578461
Test: CtsGraphicsTestCases
Switch to SkCodec::MakeFromStream, and use its error code to determine
the Exception/error message. Then pass that to
SkAndroidCodec::MakeFromCodec. This is essentially what happened
previously (minus error reporting).
Change-Id: Iabaa61a4321d2f2e257db587013afda605b005b0
Bug: 63909536
Test: CTS: I8d1672180d8325ae1caf44f0bbf41036b94e6253
In ImageDecoder. The goal is to tell the client that there is a partial
image (which they can use if the callback returns true) and also allow
them to know why the image is partial.
Change how the return value is handled. Instead of returning null, which
is inconsistent with the rest of ImageDecoder, throw the Exception.
Change-Id: I56c38a624c978aa6e6d00fc927b5e355bf9c718a
Bug: 63909536
Test: CTS: Ib2877276da8464b5f3eef0bbb848de202c90e97e
Allows a listener to determine the mimetype.
Change-Id: I0d2aa32f2dbfb37dba97a896037c48814390273d
Bug: 63909536
Test: CTS: I0f36ce34c968fd7fae4d8edebabea3a421859615
Add ImageDecoder.createSource(ContentResolver, URI), allowing a client
to decode images from files, content, resources, etc.
Prefer using a file descriptor to using an InputStream so the input can
be cheaply seeked and rewound if necessary.
Make ImageDecoder implement AutoCloseable to handle closing the input.
Make decodeDrawable/decodeBitmap always return an object or throw an
IOException. Avoid checking for a file in the Source constructor.
Fix a bug where inner Exception classes were not static.
Update JavaInputStreamAdaptor to be usable by ImageDecoder:
- previously it always swallowed exceptions. Allow them to propagate
(optionally) so that they can be reported back to the client.
- Add refs to the InputStream and byte[]. ImageDecoder returns from
native and then uses the JavaInputStreamAdaptor again, making the
local refs go out of scope.
- Hold on to the JavaVM and convert to the JNIEnv when necessary. Pass
local env pointers to avoid looking it up multiple times in one call.
- If an exception is thrown inside the doRead() loop, return the number
of bytes successfully read.
Change-Id: I869dad55521cf942efd010c06baf3f44c1c08374
Plus a regression test which throws an Exception for the old version. It
shouldn't be an issue in the real world because there's absolutely no
reason any app should be creating 1920*3px icons.
Found while porting the code somewhere else.
Test: runtest -x ./core/tests/coretests/src/android/graphics/drawable/IconTest.java
Change-Id: I1283d982507221914ddad1313e16f63af13e245a
The CL updates the documentation of the ttcIndex attribute added for P,
according to the API review comments.
Bug: 71555180
Test: none
Change-Id: I44a617c4f0a10314008fe5d5b380c6a830f3e04f
Bug: 63909536
Bug: 63908092
Test: CTS: I0f36ce34c968fd7fae4d8edebabea3a421859615
One-pager:
https://docs.google.com/document/d/1IWSdXb5O9lu-Zbj7SaNWo5pS7-FHlonFnqazjnecozM/
Design doc:
https://docs.google.com/document/d/15S6DSAV4EwOuJLv29UC_9cdSGdPg3KvOJVn2EHoP3fw/
ImageDecoder is designed to streamline certain patterns of BitmapFactory
use:
- choosing sample size based on actual dimensions
- choosing a specific output size
- post-processing (e.g. for rounded corners)
- copying to HARDWARE
- decode directly to ashmem
- creating a Drawable
- use as an alpha mask
- save RAM (e.g. use RGB_565)
In addition, it will include new features:
- animated drawables (TODO)
- report failures *and* optionally create a partial image
- crop
Add PostProcess to handle post-processing. It is separate from
ImageDecoder so that it may be used in the future by other commands that
might want something similar (e.g. capturing a View).
Consolidate NinePatch code for sharing between BitmapFactory and
ImageDecoder.
Some features left out of this CL:
- Create from ContentResolver + URI
- animation
- report more info in ImageInfo
- more overloads (e.g. null OnHeaderDecodedListener)
Change-Id: Icf011dc1b97b492788e47cf51fcf8abe8e9c7b88
* Fixes the ripple interpolator to match UX spec
* Adjusts behavior if the ripple is re-sized mid-ripple
to look less bad
Bug: 63635160
Test: mashed a bunch of buttons
Change-Id: I26de59fe81372512b287a646ca7377d052227aee
Bug: 69322344
Test: visual inspection on VectorDrawableTest with AA off. Jagged edges
that are otherwise smooth were spotted.
Change-Id: Ib2dfbd3a941be0b4ff92b8458346f8c8f5015a4b
* Updates press state ripple to match UX spec
* Makes it ungodly silky smooth LIKE BUTTAH
* Update hover & focus states to be closer to UX spec,
still needs a final pass.
Bug: 63635160
Test: Clicked on a bunch of stuff
Change-Id: I162ab9d8d669002f2ae511f93b5d9fe67f99c533
Indroduced DisplayFrames object to track frames used to calculate
window insets per display vs. at a global level in PhoneWindowManager.
Bug: 64148922
Change-Id: I19f166920eba0a4f933a223a77e096bcc8dab0c1
Test: bit FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Test: go/wm-smoke
Indroduced DisplayFrames object to track frames used to calculate
window insets per display vs. at a global level in PhoneWindowManager.
Bug: 64148922
Test: bit FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Test: go/wm-smoke
Change-Id: I4a668d6c2dd0bfa666cb6acecf663cf83545ea87
This CL contains followins:
- Use enum class FontVariation instead of legacy enum.
- Store FontStyle in MinikinPaint.
Bug: 65024629
Test: minikin_tests
Change-Id: I86bf64fd5d9a8c08eff47db851fa4655da84b1e4
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.
This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.
Test: Treehugger
Bug: 67901714
Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
This change adds support for specifying the TTC index on font entries,
relevant in the context of .ttc font files used to deliver multiple
fonts in the same file.
Bug: 37853920
Test: adb shell am instrument -w -e class android.content.res.FontResourcesParserTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I3f74e87dec78e1f5a68ccead80b0f637af1aa7a3
Matching the interpolators to be declerate on both enter and exit.
According to the UX team feedback.
b/63635160
Test: demo app, settings app and calculator app
Change-Id: I49b88ef73f0bd45cd2b2c26feb2443633f171575
1. Consistent enter and exit duration and speed. Both bounded and
unbouned. It used to be that exit is much faster than enter.
2. Instead of starting from 0 size radius, we start from some size
according to the current drawable's bound.
b/63635160
Test: demo app, settings app and calculator app
Change-Id: I1135fefc9d9103f170ab889269b38a9900835450
For camera devices, DEPTH_POINT_CLOUD coordinates are in meters and
are in the camera's local coordinate system.
Test: Built docs, manually verified output.
Bug: 67308479
Change-Id: I028e13a2fb79688a7ce440f905fa82826fc38a03
According to the spec, the foreground will cover the whole area at
the end of expansion, and do not show the background.
In bounded case, the ripple exit should start from the current value.
b/63635160
Test: demo app, calculator and settings
Change-Id: I64d8b941e2b28ea11165d29de3e6ef77d5ee78f5
We didn't trace the draw from cache.
Here we add trace for draw into bitmap, which is normally heavy.
fix: 65060698
Bug: 65060698
Test: run test app and get systrace and check
Change-Id: Ia81127c4aa285b3277e9c9edbdf356d85cb28b5e
(cherry picked from commit cf0c41dbc2)
This will also show circular ripple when focus is on.
Previously, bounded case behaved differently than unbounded case. Now
they are consistent, too.
b/63635160
Test: sample app and calculator app
Change-Id: I5c96c8079c789d6e571af2c2356e3ce6add37b46
We didn't trace the draw from cache.
Here we add trace for draw into bitmap, which is normally heavy.
fix: 65060698
Test: run test app and get systrace and check
Change-Id: Ia81127c4aa285b3277e9c9edbdf356d85cb28b5e