BUG:13191516
Original CLs below:
In nativeDecodeFileDescriptor, use fdopen.
Instead of attempting to mmap the entire file, create an
SkFILEStream from a FILE.
BUG:11669944
BUG:11028218
Cherry-pick from: If67da91484acc79f9f3dde6d05201409c0c75e41
-------------------------------------------------------------------------
Decode file descriptor from the correct offset.
Fix a few bugs in nativeDecodeFileDescriptor:
1. Restore the FD's offset when exiting the function.
2. Copy the data when potentially using an SkImageRef.
The old behavior would have continued to modify the
file descriptor's offset each time a new decode was
required. The copy ensures that the file descriptor
remains unchanged.
3. Buffer the file stream.
Prior to this change, if the image was not a PNG,
the stream would be rewound to the beginning of the
file, even if the file descriptor was passed in with
an offset. Thanks to the buffer, the stream is only
rewound to the original offset.
Depends on https://googleplex-android-review.googlesource.com/#/c/415821/1
in external/skia
BUG:12807677
BUG:12895876
Cherry-pick from: I38b8cf5d210dbbc0107e6562e3884867de57fc4b
(These CLs are already in master.)
Bug: 13246311
This cherry-picks 7 CLs:
-----------------------------------------------------------------------
Remove calls to deprecated SkBitmap::setIsOpaque()
setIsOpaque() has been removed from ToT Skia.
Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.
cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
-----------------------------------------------------------------------
Merge AssetStream with AssetStreamAdaptor.
Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.
The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.
cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56
-----------------------------------------------------------------------
Deprecate Android-specific SkPaint functions.
The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);
Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.
Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08
-----------------------------------------------------------------------
pass SkGlyphCache into updateGlyphCache()
Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.
Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89
-----------------------------------------------------------------------
Updates to the Skia API needed to merge the WebView m33 version of Skia.
cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3
Bugfix for screenshots (recent apps) due to incorrect rowBytes computation
bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714
-----------------------------------------------------------------------
Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.
cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5
-----------------------------------------------------------------------
Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
Conflicts:
core/jni/android/graphics/Bitmap.cpp
core/jni/android/graphics/Graphics.cpp
core/jni/android/graphics/Typeface.cpp
graphics/java/android/graphics/Bitmap.java
When Intent.FLAG_ACTIVITY_REORDER_TO_FRONT was set the TaskRecord
member frontOfTask was being set true incorrectly for the top
activity. It should only be true for the bottom activity. This fix
ensures that frontOfTask is always set correctly for all activities by
consoldating it into one method.
Fixes bug 12171535.
Change-Id: If982dad3c81b2b816adc5d89e7e0496923098a70
If flag for error after attach is not reinitialized, it may cause
NullPointerException on subsequent onAttachedWindow if error text
was reset to null.
Change-Id: I8976c28a6ca71017e5c4b3f29d4eeeb2eda48c38
For managing the ui mode, consider the device to be a television if it
has either the FEATURE_TELEVISION or FEATURE_LEANBACK system features.
When leanback is available for non-television devices, we need to
reconsider the use of these features for setting the television ui mode.
Change-Id: I7b82372ce19067e010be9b42111816bab186f95b
Due to an internal rounding in the renderer, the calculations
for the cropping area could be slightly offset, getting out
of the image boundaries. I sanitized the rect by ensuring they
are inside the image.
Bug: 12174629
Change-Id: Icc37790732ddd479631b898b23c05501d2dcd5be
Cherrypick of I0f8d33b0c77129f72581bc43e7f4fdc25469b520
This CL allows the Framework class InputMethodManager to behave
in a more deterministic way, that is to say, with an I/O barrier.
InputMethodManager#setAdditionalInputMethodSubtypes is internally
implemented as a RPC to the corresponding counterpart in
InputMethodManagerService. The problem here is that this RPC is
marked as "oneway". As a consequence, this public API call
returns immediately without waiting the additional subtypes are
actually added. This behavior is also not documented so far
unfortunately.
See the following demo code:
Final InputMethodManager imm = ...;
imm.setAdditionalInputMethodSubtypes(id, subTypes);
Final List<InputMethodInfo> ims = imm.getInputMethodList();
Currently, it is not guaranteed that the InputMethodInfo returned
from #getInputMethodList reflects the result of the previous call
of #setAdditionalInputMethodSubtypes because of its undocumented
asynchronous nature.
With this CL, InputMethodManager#setAdditionalInputMethodSubtypes
behaves as if it has I/O barrier. This change should make it easy
for IME developers to use additional subtype mechanism.
BUG: 13033954
BUG: 13291370
Change-Id: I0455b176bfb3176c533ba3241881f05092b98abc