When decoding from a file descriptor, if the descriptor is seekable and
has no offset, use SkFILEStream directly instead of wrapping in an
SkFrontBufferedStream.
This will let the SkRawCodec take advantage of a seekable stream.
One can see 2x speed up for RAW cases.
Bug: 27097104
Change-Id: I369fbb3af1170c94ec7cd9bb35e8e0007dde9fd5
This fixes a TODO to use kUTF32_TextEncoding directly. This avoids
encoding UTF32 codepoints from HarfBuzz into UTF16 to pass to Skia,
which will then re-decode to UTF32. This also removes a use of
SkUtils.h which Skia desires to move to private use.
Change-Id: I087f4216c25f7874e496920cd33e2f109530c397
measureText is a light weight method dedicated to measure text width.
With this CL, breakText, doRunAdvance and doOffsetForAdvance use
measureText.
Bug: 24505153
Change-Id: Ibd62de2e0fe2e196cf07472f2270cc8c6325daab
With ttc and gx variation fonts, it is now possible and common that a
number of fonts will use the same font file for data but with different
parameters. In the current code each font will map the font file data,
taking up an unecessary amount of virtual address space and is
inefficient with respect to memory management (like the tlb). This CL
deduplicates these file mappings so that a given font file will only be
mapped into memory once.
DO NOT MERGE
Change-Id: I5ca69f963a434c72ec4028402ecbf9e0f0ee7148
(cherry picked from commit fffcf0a31fd4c9a4ec8aa7de70b1eda0d48fb337)
This adds an 'axis' child element to the 'font' element. The 'axis'
element has attributes 'tag' (a four byte identifier) and 'stylevalue'
(a float value) to the parser. This also modifies reading the font file
name in a backwards compatible fashion by using only the direct #text
children of the 'font' element. (Both the Minikin and Skia parsers now
allow the font file name on a separate line in the fonts.xml file).
This information is then passed through to Skia in order to select the
desired variation. The Skia parser already parses this way and has for
some time, so Chrome and WebView can already read this format.
Change-Id: I15623fe864fa92b2bf0705af5e389daedfb77e5c
(cherry picked from commit b8e367fb7428076ff2e4aa2a97adaed1ef806e92)
This should not change decode behavior, but it's worth noting that
the number of bytes buffered will decrease from 64 to 30.
Change-Id: I66b0e38a487c1786823b0125686b094dae5d13dc
This is used by BitmapRegionDecoder to decode into a recycled
bitmap.
Since the specification does not guarantee that the recycled
bitmap will be larger than the decoded region, we must be careful
to only to copy min(recycledHeight, decodeHeight) rows.
This should fix flakiness in the BitmapRegionDecoderTest on cts.
BUG:26978886
Change-Id: I318468b0eaa67bd9a7860824f75d45df9bf5fbce
This only affects kIndex_8 Bitmaps, which can only be created by
decoding particular images (e.g. GIF). Without locking the SkBitmap,
colorTable() always returns NULL. Lock it so we can write the color
table to the Parcel.
BUG:26527976
Change-Id: Ifc54b06ca08db26ba6455a3830b7e671b64f37c4
We updated the API of SkShader (changed in
https://codereview.chromium.org/1553743002) but the function still does
the same thing. As such, undo the changes in
f4eca05cdc19c095cdc0a9140d512737533a87c5 which call the method
differently.
BUG:26549769
This partially reverts commit f4eca05cdc19c095cdc0a9140d512737533a87c5.
Change-Id: I52f2fab7da748cfe351e2fa27ade24aa572176a7
The original intention for forcing ninepatches to be encoded as
RGBA (with alpha) was to avoid the possibility of the decoder
producing 565 output.
565 output is bad for ninepatches because dithering tiny images
that we intend to scale later leads to bad results. I would
argue that, since the new BitmapFactory does not dither, we might
now be ok to allow 565 decodes for ninepatches. However, we
will maintain the old behavior by disabling 565 decodes for
ninepatch.
There are two changes to PNG encodings:
(1) Allows ninepatch images to be encoded in any mode. Forcing
them to RGBA makes things awkward for the decoder. Currently,
BitmapFactory's png decoder checks every pixel for alpha.
That way, RGBA images that are actually opaque can be marked
as opaque, in order to optimize drawing. We want to remove
this complexity from the decoder.
(2) Make sure ninepatch chunks are stored in the png header. That
way we know immediately that the png is a ninepatch, and can
refuse to decode to 565 (if we feel this is best).
Change-Id: I724f5dbefb1be7b412f9b362dff83cbc0603f0bf
This is 2nd attempt of I277a08b5a17d45c3edb8fb597fdf6786bbe9f83b
The language code to BCP47 conversion is done by Minikin.
Also this CL addresses the signature changes by
I8df992a6851021903478972601a9a5c9424b100c
Bug: 26168983
Change-Id: Id106e9bb5c3eaa6652b44a1735f427accaca1368
This changes the documentation for inPreferQualityOverSpeed,
inDither, and requestCancelDecode().
These changes are a result of modifying the backends of
BitmapFactory and BitmapRegionDecoder to be faster, higher quality,
and to use standard libraries.
BUG:26266063
BUG:25556965
Change-Id: I9008fd276a38c737e242bcc6930ffe4e36d9fd1d
Check for OOM after calling encodedFormatToString().
Do not correct Alpha8 to Gray8. This will be handled in Skia.
Change-Id: Id573548608fbd5fbeef2898844480d8f8f73e1d0
The language code to BCP47 conversion is done by Minikin.
Also this CL addresses the signature changes by
I8df992a6851021903478972601a9a5c9424b100c
Bug: 26168983
Change-Id: I277a08b5a17d45c3edb8fb597fdf6786bbe9f83b
SkImageDecoder is being phased out. The SkImageDecoder::Peeker has been
repurposed as SkPngChunkReader, which is shared by SkImageDecoder and
SkCodec (SkImageDecoder's replacement). Make NinePatchPeeker inherit
from the new class, and make its SkImageDecoder mHost optional, so we
can easily switch to SkCodec.
Change-Id: I74eeb909d1a4f4fe928d079857f92c142351b496
ttcIndex is used for specifying index of the TrueType Collection.
No user visible change is expected with this CL.
BUG: 10861108
Change-Id: I76a1c890164bb55a7ece7b9c7db2ce2bac3f8b89
Setting the LocaleList to the native Paint object is not a lightweight
operation since it needs to propagate a string object to the native code
which then needs to parse it for making minikin language list.
To avoid performance regressions, cache the minikin language ID in
android.graphics.Paint and send the LocaleList with cached ID
instead of a string the next time native code is called.
BUG: 25122318
Change-Id: Ib5ce8bcff8a1c0a2b1a1c3d1868ea8be5a0e642f
With this CL, Paint.hasGlyph returns true if the typeface supports
the passed code point and variation selector pair.
Bug: 11256006
Change-Id: If29cd0c5942dc78bd862804106e29539bdeee569
This is temporary, we are planning to delete this class.
Renaming will allow us to have an SkBitmapRegionDecoder class
in Skia.
Change-Id: I8d24d481d4e8cf782f578fa6deb6e3245c998a37
Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.
Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap
Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
Also, compute LocaleList's string representation at construction.
This is to further push the cost of doing costly operations related
to LocaleLists to construction time.
Change-Id: Ia55b8ce66b1088ff54cb42eb1e11149b5bd10f17