If the developer gives some weight/italic to the Typeface.Builder
the fallback used the metadata in the font file. We should use
provided data instead.
This CL also adjusts upper and lower limits on weight, from 100..900 to
1..1000
Bug: 37257745
Bug: 37251569
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I7cf390d96b49afcce359928373698b0c9a9babd8
The goal is to eliminate the times we have to manually save ref or
unref.
Test: hwui_unit_tests and CtsGraphicsTestCases pass
Change-Id: I69273acc18d3f3beea60625a37bf007907ff05e9
setFallbackTypeface is returned by Builder.build() method when the
provided font is not loaded due to some reasons.
The fallback family is resolved with width/italic passed to Builder.
Bug: 36794225
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I65e220aca823fd815a52437b11c8e6dc952de8e2
See skbug.com/6481
With pixelrefs now always (logically) locked, we no longer override
onNewLockPixels/onUnlockPixels. We also must now pass our
address/rowBytes to the base constructor.
These changes allow us to remove duplicate fields in the hwui Bitmap
subclass -- mRowBytes and mColorTable, since these fields are now always
available from the base-class.
However, since this subclass still wants to overwrite const fields in
the base-class (its reconfigure api), change the impl to use the newly
added private method (android_only_reset) to encapsulate this.
Test: hwui_unit_tests and CtsGraphicsTestCases pass
Change-Id: I57a3af1135580513b708f35549a6defb7ac6c04e
This is a natural consequence of the fact that we always call
setPreLocked from the constructor. Future Skia will remove the virtual
for lockPixels (onNewLockPixels), but that is compatible with this
subclass since does not change its pixel-addr or pixel-type after the
constructor.
See skbug.com/6481 for more details
Test: existing tests apply, no behavior change
Change-Id: I0f9d3efc9a05b71907480eaaadbc7fafe9dd491b
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
For picture-backed canvases, we will defer the xform
until playback.
Test: Unit tests and cts test.
Bug: 32984164
Change-Id: Ib74663bcb688b74b6ba8792b403b0475126732af
This allows Skia to remove
SK_SUPPORT_LEGACY_CANVAS_VERTICES
SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF
SK_SUPPORT_LEGACY_PIXELREFFACTORY
Test: Existing CTS cover these changes
Running CtsGraphicsTestCases, there were 6 failures w/ and w/o this CL.
None of the 6 seems related to this CL.
Change-Id: I724082357d9f6cb699770df3c0b9ef555b957697
Fix a bug in DrawShadow matrix calculation. Recorded matrix does
not need to be applied, because parent display lists have already
replayed matrix transformations.
Test: added a new HWUI unit test that is passing only after this fix
Bug: 33103723
Change-Id: I7a47dbe879df6b9e5920a47c0e1168d9902a3e70
Avoid one memcpy in Canvas::drawGlyphs for all pipelines.
Test: CTS passed with exception of SweepTests#testBasicDraws
shadowtext, which fails with and without this CL.
Change-Id: I0841232dc7a6173eb3b03f939dbde15a84186296
This is fixed in Skia by passing the appropriate flag when the shader is
generated. The fix in HWUI is to reverse the premultiplication and
interpolation steps.
Test: bit CtsUiRenderingTestCases:.testclasses.ShaderTests
Bug: 34323783
Change-Id: I3417141949f62fcc696b6d8213a4b446d7d0cbf8
Fix failing RenderNode unit tests with Skia pipeline, caused by
TestUtils::syncHierarchyPropertiesAndDisplayList not walking past
root node.
Test: ran HWUI unit tests.
bug: 32507847
Change-Id: I7e64fb02fd8f4874eadacafcac7e9f1ae4e56365