1494 Commits

Author SHA1 Message Date
TreeHugger Robot
a2113aa4ad Merge "AnimatedImageDrawable: Eliminate unnecessary calls to redraw" into pi-dev 2018-05-17 19:54:50 +00:00
Leon Scroggins III
4afdd1caa4 AnimatedImageDrawable: Eliminate unnecessary calls to redraw
Bug: 78866720
Test: Manual + systrace; existing CTS

Previously, we set hasAnimations to true when the AnimatedImageDrawable,
so that we would get a call to redraw. But if the image does not need to
show its next frame yet, the redraw was unnecessary.

Instead, add a new field to TreeInfo::Out, representing the delay time
until the image will need to be redrawn - i.e. when the duration of the
current frame has passed. Each call to prepareTree will post at most one
message to redraw, in time for the earliest animated image to be
redrawn. Post the message for one rendered frame ahead of time, so that
when it is time to show the next frame, the image has already gotten the
message to update.

On a screen with a single animated image, this drops the number of calls
to dispatchFrameCallbacks to as infrequent as possible. It is called
only when we need to draw a new frame of the image. On a screen with
multiple animated images, the calls may be redundant, but they will not
be more frequent than they would be without this change.

Switch to nsecs_t and systemTime internally, matching the rest of HWUI.

Remove mDidDraw and related. Its purpose was to prevent advancing the
animation while the image is not being drawn. But it isn't really
necessary. If it's not drawn, onDraw is not called, which is where we
trigger decoding. And onDraw already has a defense against getting too
far ahead - if its timer indicates that it should skip a frame or show
it very briefly, it will back up its timer. More importantly, mDidDraw
caused a bug, when combined with less frequent redraws. If the display
list containing the drawable doesn't need to be redrawn for other
reasons, the drawable's timer never advanced, so its animation stopped.

Fix software drawing. Compute the milliseconds in the future to draw the
next frame, and add that to SystemClock.uptimeMillis() to compute the
time to pass to scheduleSelf.

Change-Id: I13aab49922fa300f73b327be25561d7120c09ec4
2018-05-16 18:51:07 -04:00
Leon Scroggins III
0c699add01 Allow ImageDecoder to read SkFILEStream directly
Bug: 78866720
Test: Manual

If the input stream is seekable, SkGifCodec will read from it directly.
If not, it has to copy (parts of) the input in order re-decode when it
loops. Directly use the seekable SkFILEStream so that SkGifCodec skips
the copy, saving memory proportional to the size of the file.

Depends on a change in upstream Skia which allows SkFILEStream to treat
the initial offset as the beginning of the file:
https://skia-review.googlesource.com/c/skia/+/126511

Change-Id: Iefb58785157ba684ad3603778175b3dba97567b2
2018-05-07 16:28:16 -04:00
Leon Scroggins III
0492eefece Allow AssetStreamAdaptor to be seekable
Bug: 78866720
Test: Manual

It already supports rewinding, and the underlying Asset supports
seeking. Allow it to be seeked so that SkGifCodec can read directly from
it rather than copying data it needs for internal use.

Change-Id: I0765dcf4a507724878a5a700a770d35802c4b7be
2018-05-07 11:02:17 -04:00
Leon Scroggins III
7d940ba43d Never scale nine-patches in ImageDecoder
Bug: 76448902
Bug: 70889348
Test: Manual + CtsThemeHostTestCases
(Ica5e7e81848c3880accee922ee6f1cc9e26262ca)

Scaling a nine-patch requires scaling its divs. When the scale factor is
not an integer, we have to round. This gets out of sync with the way the
decoder scaled the image, resulting in stretching or keeping fixed the
wrong portions of the image. Making this worse, when we scale down, we
end up with divs colliding with each other, and we have to arbitrarily
adjust them further so they do not collide.

NinePatchDrawable and the drawing code already know how to handle
drawing from the originally-sized image and do a better job stretching
appropriately, so allow them to do their job.

We already do something similar for Bitmaps created by ImageDecoder on
apps targeting P and above - instead of scaling them up, we allow the
BitmapDrawable's scaling code to handle density differences. We
preserved the old behavior (scale up) on apps targeting pre-P because
those apps may rely on the size of the Bitmap contained in a
BitmapDrawable without accounting for its density (see Bug: 74061412).
But that is not an issue for NinePatchDrawables, which do not allow
peeking at their internal Bitmaps.

Rewrite ImageDecoder.computeDensity. There is no need for it to be
static, since it takes an ImageDecoder as a parameter and reads its
fields, including the new field mIsNinePatch. Set mIsNinePatch in the
constructor to avoid another down call into native. Split up the
conditions that result in returning srcDensity without calling
setTargetSize for clarity.

Remove ImageDecoder constructor from the graylist. It was accidentally
added due to the fact that it is called transitively from public APIs.

Change-Id: I3c5ddd67f3352c991515f30ce1c477c9a608833f
2018-04-05 12:50:32 -04:00
Leon Scroggins
bf1fe9aecd Merge "Add in/out ColorSpace to ImageDecoder" into pi-dev 2018-03-29 20:27:43 +00:00
Leon Scroggins III
1a69f4598f Add in/out ColorSpace to ImageDecoder
Bug: 76448408
Test: I851173b771668f0e6712bebfe06bfb8559801199

Add ImageInfo.getColorSpace() for retrieving the default ColorSpace.
This matches BitmapFactory.Options.outColorSpace.

Add ImageDecoder.setTargetColorSpace() for choosing a new ColorSpace.
This matches BitmapFactory.Options.inPreferredColorSpace.

Rename setSampleSize to setTargetSampleSize to match setTargetSize and
setTargetColorSpace.

Change-Id: If2f4e755dfc163f754849f896de24659198973db
2018-03-29 13:44:22 -04:00
John Reck
205d83e108 Move Path to NAR
Bug: 74686528
Test: PathTest#testUseAfterFinalize
Change-Id: Ic1c9df6f1b63ea5795a6c3a54b8fc50fdaf0a5f4
2018-03-28 14:36:58 -07:00
Leon Scroggins
ceb14e015b Merge changes from topics "DecodeException_ERROR", "AID_autoStart", "onPartialImage" into pi-dev
* changes:
  Rename ImageDecoder.ERRORs
  Add the ability to autoStart AID from xml
  Re-write onPartialImage API
2018-03-22 21:53:05 +00:00
Leon Scroggins III
cf7294fda6 Rename ImageDecoder.ERRORs
Bug: 73788969
Test: I501e8b76aacd785cb994165ab01dc1b39fea3a1c

Move them into ImageDecoder.DecodeException, which is where they are
actually used. This also provides some more context, so that the prefix
"ERROR_" is no longer necessary, fixing the redundancy/awkwardness in
ERROR_SOURCE_ERROR. Further rename that to SOURCE_MALFORMED_DATA, which
is more descriptive, and does not imply a Java Error.

Change-Id: Ied17ad343650f9c33d9a35b0f9d00ccc22264bd6
2018-03-22 13:09:02 -04:00
TreeHugger Robot
b09f2b5926 Merge "Fix wrong SafeUnref type" into pi-dev 2018-03-21 21:34:10 +00:00
John Reck
97c7f4b84b Fix wrong SafeUnref type
Test: builds
Change-Id: I5a03551c408736722802ba0e8692c3d85e375112
Fixes: 76029886
2018-03-21 10:50:47 -07:00
Leon Scroggins III
1d2bf2b846 Re-write onPartialImage API
Bug: 73788969
Test: If9e27a6ce2604128a619bc4843d62711f94b4d87

Add a new Exception subclass that contains information about the type of
error, and the original Exception, if any. Remove the old
IncompleteException class. If the decode creates a partial image, pass
the information up to Java, where we create the new Exception and pass
it to the callback and/or throw it. Rewrite nDecodeBitmap to always take
the ImageDecoder as a parameter for this callback, and simply use a
boolean to determine whether to call onPostProcess

Check for exceptions in some overlooked cases in native code, and
route to the new type.

Remove FIXME to avoid parsing the whole image. In my limited testing,
it didn't seem to speed anything up, and this should be called in a
background thread anyway. Parsing now also ensures that we've read the
stream when we can have a chance to handle the exception from the right
place.

Remove fixme for b/70626068, which has been marked as WontFix.

Add a TestApi for testing an Exception thrown by an InputStream.

Remove onPartialImage from hiddenapi-light-greylist.txt to fix the build
error this change introduces. onPartialImage was erroneously added to
the list.

Change-Id: I12f69857328e63c993bd669412b06addeb6a74f1
2018-03-21 12:55:46 -04:00
Leon Scroggins
d848f75f99 Merge "Report native allocation size of AnimatedImageDrawable" into pi-dev 2018-03-21 16:48:19 +00:00
Leon Scroggins III
eb3b38e22c Report native allocation size of AnimatedImageDrawable
Bug: 73641604
Test: infeasible

Fix nNativeByteSize's return value to be jlong, instead of long.
Add up the bytes used by the SkAnimatedImage and SkPictures and store
them on the AnimatedImageDrawable for registration.
Note that this is an approximation, and it assumes it will be drawn to a
hardware canvas and animated.
2018-03-21 09:28:00 -04:00
TreeHugger Robot
173d0e9b34 Merge "Handle PDFium API change" into pi-dev 2018-03-20 20:07:11 +00:00
Philip P. Moltmann
e8800b232d Handle PDFium API change
It now does not flip coordinate system anymore.

Bug: 72134075
Test: atest CtsPdfTestCases
Change-Id: I4dce299738f24a44478c06fa7179306a4904b5d5
2018-03-19 16:01:34 -07:00
TreeHugger Robot
c45c2d65a5 Merge "Work around incorrect Skia gamma" into pi-dev 2018-03-19 22:10:31 +00:00
TreeHugger Robot
6d39e55020 Merge "Move computation of decodeColor- Type and Space" into pi-dev 2018-03-15 21:26:24 +00:00
Seigo Nonaka
83143d005b Remove mtOffset from drawTextRun
Bug: 72998298
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: Ia886c1ce9f7387559d7fe00b34ce03378d56ecec
2018-03-15 04:09:19 +00:00
Leon Scroggins III
ce89a6e656 Work around incorrect Skia gamma
Bug: 74408046
Test: Ic6acdc4a1a16840ec6ad9b13b4926c643d0f81ae

Skia incorrectly sets the gamma for LINEAR_EXTENDED_SRGB to 0 as a
misguided optimization attempt. As a result, a HARDWARE Bitmap which
natively has this color space does not match it properly. (Note that we
already catch an F16 Bitmap, above.) Add a workaround in
Bitmap.getColorSpace() to check for the color space explicitly.

Change-Id: Id595e365d1c8d572cfcea214d230a8ce1decdc01
2018-03-13 15:39:39 -04:00
Leon Scroggins III
8d592f9a7d Move computation of decodeColor- Type and Space
Bug: 70846442
Test: I5110881203c000474116a94a48f2afc9a9b62001

Delay computing decodeColorType until right before we may change it (and
delay reinterpreting the pointer along with it). More interestingly,
defer computing decodeColorSpace until *after* we may have changed the
decodeColorType. Along with a change in Skia, this allows us to match
the color type of inBitmap, as intended.

Change-Id: If0ca4a61d338a13473a96faf900c84010ae46d41
2018-03-12 16:03:29 -04:00
Leon Scroggins III
4856210398 Encode F16 Bitmaps to 8-bit P3
Bug: 73743812
Bug: 71430152
Test: If2c3ee0f32eff77b11ce5a7fe82c02811ed1beb3

This matches how we handle decoding images with a wide gamut. For WebP
and JPEG, we cannot encode with more precision anyway. For PNG, we could
in theory encode to 16 bit linear PNGs. This would be more precise, but
would still throw away information due to normalization. Using 8-bit P3
matches the behavior for the other formats, so it is nice to be
consistent.

Change-Id: I69a44a3eff70e26448a75ecc63ed7604b9c74a95
2018-03-12 14:01:57 -04:00
TreeHugger Robot
7d968346bf Merge "Stop using finalizer in Typeface and FontFamily" into pi-dev 2018-03-08 21:16:47 +00:00
Seigo Nonaka
abe5031416 Stop using finalizer in Typeface and FontFamily
Use NativeAllocationRegistry instead.

Verified this doesn't cause performance regressions:

StaticLayout creation time:
 MeasuredText Balanced Hyphenation  :    721,055 ->    723,812: (+0.4%)
 MeasuredText Balanced NoHyphenation:    527,880 ->    505,843: (-4.2%)
 MeasuredText Greedy Hyphenation    :    476,982 ->    460,241: (-3.5%)
 MeasuredText Greedy NoHyphenation  :    471,074 ->    459,013: (-2.6%)
 RandomText Balanced Hyphenation    : 18,566,915 -> 18,514,633: (-0.3%)
 RandomText Balanced NoHyphenation  :  7,697,772 ->  7,658,458: (-0.5%)
 RandomText Greedy Hyphenation      :  7,648,606 ->  7,602,026: (-0.6%)
 RandomText Greedy NoHyphenation    :  7,643,946 ->  7,618,898: (-0.3%)

MeasuredText creation time:
 NoStyled Hyphenation               : 18,377,293 -> 18,521,296: (+0.8%)
 NoStyled Hyphenation WidthOnly     : 17,852,099 -> 17,889,073: (+0.2%)
 NoStyled NoHyphenation             :  7,608,972 ->  7,614,311: (+0.1%)
 NoStyled NoHyphenation WidthOnly   :  7,194,461 ->  7,192,043: (-0.0%)
 Styled Hyphenation                 : 15,396,698 -> 15,352,501: (-0.3%)
 Styled Hyphenation WidthOnly       : 14,356,020 -> 14,379,205: (+0.2%)
 Styled NoHyphenation               : 14,926,657 -> 14,971,723: (+0.3%)
 Styled NoHyphenation WidthOnly     : 13,964,537 -> 13,874,324: (-0.6%)

StaticLayout draw time:
 MeasuredText NoStyled              :    644,795 ->    635,241: (-1.5%)
 MeasuredText NoStyled WithoutCache :    637,943 ->    616,369: (-3.4%)
 MeasuredText Styled                :    866,664 ->    860,322: (-0.7%)
 MeasuredText Styled WithoutCache   :    917,795 ->    897,164: (-2.2%)
 RandomText NoStyled                :    538,196 ->    533,253: (-0.9%)
 RandomText NoStyled WithoutCache   :  7,012,076 ->  7,047,498: (+0.5%)
 RandomText Styled                  :  3,011,941 ->  2,999,661: (-0.4%)
 RandomText Styled WithoutCache     :  3,486,225 ->  3,462,493: (-0.7%)

Bug: 70185027
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases

Change-Id: I7ebb8a219a8eb07c8ad9fa432e8454e4e06be386
2018-03-07 11:46:13 -08:00
Leon Scroggins III
5e8447f74d Draw AnimatedImageDrawable mirrored if desired
Bug: 73529437
Test: I27af7c3b2e08fa50bc19e08930d970931ce4b5e9

If isAutoMirrored, and the layout direction is RTL, make
AnimatedImageDrawable draw flipped.

Change-Id: I9a3436ef4cb9df2845a67663a2503c2c1a3dba89
2018-03-05 15:06:40 -05:00
TreeHugger Robot
3a4f974c91 Merge "AID: Change loop to repeat and set from xml" 2018-03-05 01:23:19 +00:00
Adam Lesinski
40a32d9ff0 Merge "Refactor AssetManager" 2018-03-02 22:05:45 +00:00
Leon Scroggins III
6de55b88f7 AID: Change loop to repeat and set from xml
Bug: 73529437
Test: I60fbee6d3610070413e8c46f363ec3c19c2e7c52

Allow setting AnimatedImageDrawable's loop count in xml. Use
"repeatCount" to match the existing attr used by other objects, and
change the Java api from "loop" to "repeat".

Cache the repeat count in the State object for the situation where we
inflate but are waiting on a theme, so that when we get a src we can
apply the existing repeat count.

Change-Id: Ie723fe9a40c64dd0e1e8fd7b5d5cf81e5c5ccd0d
2018-03-02 16:11:37 -05:00
Adam Lesinski
bebfcc46a2 Refactor AssetManager
Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
2018-02-28 19:06:48 -08:00
Leon Scroggins
a89d2c2129 Merge "Fixes for YuvToJpegEncoder::encode" 2018-02-28 20:51:43 +00:00
Leon Scroggins III
1c3ded39f2 Fixes for YuvToJpegEncoder::encode
Bug: 70969260
Test: Existing CTS tests

Call jpeg_destroy_compress after compression (and failure), eliminating
a memory leak.

In addition, use a custom method for handling errors. skjpeg_error_exit
was previously used, but that method expects a skjpeg_error_mgr, which
isn't used here. skjpeg_error_mgr is more complex than necessary; it
allows for multiple methods to set their own jmp_bufs, even if they call
each other. The entire compression here is contained in one method. The
code for handling this single jmp_buf is simple, so no need to share
code.

This is a follow-on to If9a33ed10ea60131906a632a7030e0b69a21f4ea, which
removed skjpeg_error_mgr, but incorrectly left the skjpeg_error_exit.

Change-Id: Ib76e07ae0d29b093d3709f60e427b18e0e32bd9d
2018-02-28 13:30:40 -05:00
Nicolas Capens
b9a6515ea3 Fix texture image internalformat/type validation.
checkInternalFormat() was not properly checking that the Skia bitmap
color type matches the OpenGL format and type combination. In some
cases this would lead to visual artifacts (e.g. when a 565 type is
uploaded to a 4444 type), while in other cases it would cause reading
out of bounds (e.g. when uploading Alpha_8 with a GL_RGBA format).

Note that valid Bitmap formats are documented at
https://developer.android.com/reference/android/graphics/Bitmap.Config.html
checkInternalFormat() now also matches getInternalFormat() and
getType().

Bug: 73084222

Change-Id: I47cb08657c7d03723d3318c99e0da94434d80ee6
2018-02-26 10:16:36 -05:00
Leon Scroggins
08ddee7303 Merge "Add AnimatedImageDrawable.getLoopCount" 2018-02-23 20:39:21 +00:00
Leon Scroggins III
1474b78888 Add AnimatedImageDrawable.getLoopCount
Bug: 73791004
Test: Id0335f15fdf0ebdc16d1edcabca547b9399c506f
Change-Id: I1c048196e45b91a1039c1f89e2176592765d2967
2018-02-23 09:43:00 -05:00
Seigo Nonaka
beafa1f9d2 Reorganize MeasuredText API (2nd)
This is 2nd attempt of I7db9e2ca4db68a16648cfb8fcf63555f501304c2

This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
  (It can not be used for TextView)

Bug: 67504091
Bug: 72861572
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
    CtsWidgetTestCases:TextViewFadingEdgeTest \
    FrameworksCoreTests:TextViewFallbackLineSpacingTest \
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
    CtsTextTestCases

Change-Id: Ie73bce52c6c673cda58973ddad04627a7cf2e5e9
2018-02-16 19:42:00 -08:00
Seigo Nonaka
4e90fa262d Revert "Reorganize MeasuredText API"
The last change needs more discussion and found some edge cases. Revert and make small step-by-step changes.

Bug: 73091756

This reverts commit 7fd36d19e309ea515b4048cfaabb8035ceab7baf.

Change-Id: I89ff52a70cf6a5d6c553afa20f83719e1f9eb726
2018-02-14 17:03:16 +00:00
Seigo Nonaka
7fd36d19e3 Reorganize MeasuredText API
This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- PrecomputedText is no longer a Spanned.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
  (It can not be used for TextView)

Here is a performance scores: (median, walleye-userdebug, N=20)

StaticLayout creation time (w/o patch -> w/ patch)
 PrecomputedText Balanced Hyphenation  :    743,615 ->    737,145: (-0.9%)
 PrecomputedText Balanced NoHyphenation:    551,544 ->    542,715: (-1.6%)
 PrecomputedText Greedy Hyphenation    :    500,343 ->    499,601: (-0.1%)
 PrecomputedText Greedy NoHyphenation  :    497,987 ->    492,587: (-1.1%)
 RandomText Balanced Hyphenation       : 19,100,592 -> 19,135,289: (+0.2%)
 RandomText Balanced NoHyphenation     :  8,015,088 ->  7,954,260: (-0.8%)
 RandomText Greedy Hyphenation         :  7,950,915 ->  7,877,424: (-0.9%)
 RandomText Greedy NoHyphenation       :  7,939,337 ->  7,863,471: (-1.0%)

PrecomputedText creation time (w/o patch -> w/ patch)
 NoStyled Hyphenation                  : 18,935,638 -> 18,925,422: (-0.1%)
 NoStyled Hyphenation WidthOnly        : 18,469,726 -> 18,978,413: (+2.8%)
 NoStyled NoHyphenation                :  7,940,792 ->  7,919,127: (-0.3%)
 NoStyled NoHyphenation WidthOnly      :  7,463,230 ->  7,922,643: (+6.2%)
 Styled Hyphenation                    : 14,822,501 -> 14,809,017: (-0.1%)
 Styled Hyphenation WidthOnly          : 13,891,770 -> 14,656,617: (+5.5%)
 Styled NoHyphenation                  : 14,511,134 -> 14,301,503: (-1.4%)
 Styled NoHyphenation WidthOnly        : 13,495,345 -> 14,264,314: (+5.7%)

StaticLayout draw time (w/o patch -> w/ patch)
 PrecomputedText NoStyled              :    663,974 ->    661,610: (-0.4%)
 PrecomputedText NoStyled WithoutCache :    648,294 ->    648,766: (+0.1%)
 PrecomputedText Styled                :    879,322 ->    852,770: (-3.0%)
 PrecomputedText Styled WithoutCache   :  1,084,570 ->  1,110,147: (+2.4%)
 RandomText NoStyled                   :    565,682 ->    555,435: (-1.8%)
 RandomText NoStyled WithoutCache      :  9,070,533 ->  9,064,825: (-0.1%)
 RandomText Styled                     :  2,955,202 ->  2,962,008: (+0.2%)
 RandomText Styled WithoutCache        : 12,242,325 -> 12,228,573: (-0.1%)

Bug: 67504091
Bug: 73091756
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
    CtsWidgetTestCases:TextViewFadingEdgeTest \
    FrameworksCoreTests:TextViewFallbackLineSpacingTest \
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
    CtsTextTestCases
Change-Id: I7db9e2ca4db68a16648cfb8fcf63555f501304c2
2018-02-12 20:50:41 -08:00
Adam Lesinski
bde1df21ad Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit 1187590da38457809dd368d4901c9c47ac5a6958.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
2018-02-09 12:43:24 -08:00
Seigo Nonaka
0606a8874d Use new minikin::Font constructor
This is 2nd attempt of I4d7af881ed1a6c

Bug: 37567215
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases \
      CtsWidgetTestCases:EditTextTest \
      CtsWidgetTestCases:TextViewFadingEdgeTest \
      FrameworksCoreTests:TextViewFallbackLineSpacingTest \
      FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
      CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
Test: bit  FrameworksCoreTests:android.text.

Change-Id: I596c67b9453688f998a88031b9724425e2305b20
2018-02-07 13:10:35 -08:00
Seigo Nonaka
ecc00786d0 Merge "Revert "Use new minikin::Font constructor"" 2018-02-07 19:06:26 +00:00
Seigo Nonaka
36dadcfc7e Revert "Use new minikin::Font constructor"
This causes a regression for some characters

This reverts commit ab40df9e6979c955f89a06a358385ecec361c9d9.

Bug: 73054061
Change-Id: Icf1f9d2b89b75031aabb47507135e45a21bc5363
2018-02-07 18:38:58 +00:00
TreeHugger Robot
451832a5ed Merge "Use new minikin::Font constructor" 2018-02-06 22:47:46 +00:00
Adam Lesinski
1187590da3 Replace AssetManager with AssetManager2 implementation
Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
2018-02-05 18:38:49 -08:00
Seigo Nonaka
ab40df9e69 Use new minikin::Font constructor
Bug: 37567215
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases \
      CtsWidgetTestCases:EditTextTest \
      CtsWidgetTestCases:TextViewFadingEdgeTest \
      FrameworksCoreTests:TextViewFallbackLineSpacingTest \
      FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
      CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
Test: bit  FrameworksCoreTests:android.text.

Change-Id: I4d7af881ed1a6cceb79e827d88e050789da46d01
2018-02-02 22:11:55 -08:00
TreeHugger Robot
5d446ec5b9 Merge "Stop supporting broken font fallback" 2018-02-01 22:44:30 +00:00
Leon Scroggins III
beaf5d919f Fixes for animationEnd in AnimatedImageDrawable
Bug: 63908092
Test: Manual

If the animation is running on the render thread, post a message (in
JNI) to call the listener.

Use a weak reference in the native listener so that it does not create
a cycle.

Don't add a listener if it's already in the list. Remove the native
listener when the Java listeners are all removed.

Call onAnimationEnd when the animation is stopped manually.

Change-Id: I5dc070089fb1cf399ac3316292592f614f2738f0
2018-01-31 19:26:28 -05:00
Seigo Nonaka
fcd2af9ca8 Stop supporting broken font fallback
The supporting broken font is over engineering and it works the same as
default font fallback in most cases.
Removing fallback logic and return default fallback.

Test: bit CtsTextTestCases:*
Test: bit CtsGraphicsTestCases:*
Test: ./gradlew appcompat-v7:connectedDebugAndroidTest
Test: ./gradlew support-compat:connectedDebugAndroidTest
Bug: 65024629
Change-Id: Ib3fc0d638c6aee904cdf865082f8d5ae7d31ba48
2018-01-31 15:14:47 +00:00
Leon Scroggins
013918947d Merge "Respect the EXIF orientation in ImageDecoder" 2018-01-30 20:56:51 +00:00
TreeHugger Robot
8307014768 Merge "Use a separate thread to decode AnimatedImageDrawable" 2018-01-30 18:43:06 +00:00