14 Commits

Author SHA1 Message Date
Seigo Nonaka
1dd39f3bde Make Font class being able to create from native instance
This CL refactors followings:
- Use infomation stored in native instance as the source-of-truth.
- Being able to create Font instance from native instance.
- Use ByteBuffer as a wrapper of the native byte buffer.

Bug: 179113771
Test: atest CtsTextTestCases CtsGraphicsTestCases
Test: atest android.graphics.fonts.NativeSystemFontTest
Test: atest android.graphics.fonts.SystemFontsTest
Test: atest FrameworksCoreTests:android.text
Test: atest FrameworksCoreTests:android.graphics
Change-Id: Icc1df1c76ba78d4f8800984444439fd03970e179
2021-02-05 19:15:29 -08:00
Seigo Nonaka
3a28205645 Create Font sets from native fonts
Bug: 173752727
Test: atest SystemFontsTest (with enabling LAZY flag)
Change-Id: Ic4e405a68e355919ee6493e51528fd44d79cd48e
2020-12-03 12:19:58 -08:00
TreeHugger Robot
703427e52c Merge "Add TextShaper API" 2020-09-30 00:21:22 +00:00
Nader Jawad
390d6e8586 Added RenderEffect property on RenderNode
Introduced RenderEffect API to handle consuming
SkImageFilter parameters on RenderNode objects
in order to support blur.

Updated SilkFX demo to use RenderEffect
APIs on RenderNode instead of BlurShader

Bug: 168549524
Test: Added tests to RenderNode CTS test cases
Change-Id: I5005a322a6d75438dd104e6915630264406cf771
2020-09-29 14:20:02 -07:00
Seigo Nonaka
f3a1915b2e Add TextShaper API
TextShaper API provides a primitive text layout result, e.g. what glyph is used etc.

Here is the new APIs and its description

- PositionedGlyphs
This is a native instance backed object that gives layout information to developers.

- GlyphStyle
The glyph style is an object that holds the parameters that will be used for drawing.
This object is a subset of the Paint object for avoiding creating lots of Paint copy.

- TextShaper#shapeText
This does a text shaping and gives TextShaper.Result. This is a native backed primitive
shaping API.

- StyledTextShaper
This is a text shaper for a styled text. This will be the top-level developer facing
API for shaping text.

Bug: 168048923
Test: atest FontTest TextShaperTest StyledTextShaperTest
Change-Id: I2e91d1ef8503b25b28efc94da7de7cad49c4c1a9
2020-09-29 12:38:28 -07:00
Yiwei Zhang
6a7dc402d5 Zygote: preload Vulkan driver if hwui renders with Vulkan
In Android 12, vkEnumerateInstanceVersion is made to trigger driver
loading and the api itself neither has extra overhead nor talk to the
driver. So this change uses vkEnumerateInstanceVersion to preload
Vulkan driver in Zygote.

Bug: 135536511
Test: atest CtsUiRenderingTestCases all pass on GL backend
Test: atest CtsUiRenderingTestCases no regression on VK backend
Change-Id: I5017b922843aadc2c4a4237711b8011857703129
2020-07-31 14:24:52 -07:00
Leon Scroggins III
87d429262b Move TextureLayer into android.graphics
Bug: 155905258
Test: make and boot

It is tightly integrated with android.graphics.HardwareRenderer, and
this follows on I30d34055b6870dc1039f190a88f4a747cee17300, which moved
the native component into android_graphics_TextureLayer.cpp, and
Ifa044281a3c36cbc1b413175711e9b172cda640f, which registers its JNI along
with other graphics classes.

Make TextureLayer AutoCloseable, replacing destroy() with close(). Add
annotations where appropriate.

Change-Id: I1b146ff02a20751246636144c88fe6f8eec43514
2020-06-02 14:20:05 -04:00
Automerger Merge Worker
ff80d0ec95 Merge "Merge "Don't update the genID for an immutable bitmap" into rvc-dev am: 10dd5e9a18 am: e9f550649f" into rvc-d1-dev-plus-aosp am: 848a36f78f am: 934dc9ec1f
Change-Id: I15e75e79c1d64d6de976fd314f18422e8bdf1df1
2020-04-07 14:25:53 +00:00
Derek Sollenberger
d3e9eecf5b Don't update the genID for an immutable bitmap
AndroidBitmap_unlockPixels is the only way to release the ref on
pixels acquired using AndroidBitmap_lockPixels.  Apps that lock an
immutable bitmap therefore are forced to call unlock pixels. Prior
to this CL the unlock would update the GenID of the bitmap and also
print a warning that the app was modifying an immutable bitmap. After
this CL the bitmap's GenID will not be updated and no warning will be
printed.

As a result, apps that were using the NDK to allow them to mutate
immutable bitmaps will break without getting a warning message.

Test: hwui_unit_tests
Bug: 150823341
Change-Id: Ie5e5cf86a7a83d53c179c9b3cf9be1a0566cfd93
2020-04-06 20:26:49 +00:00
Alec Mouri
ef37c24f44 Initial boilerplate for an updatable graphics jar
Bug: 149773383
Test: builds
Test: hacks to verify that @hide apis are actually two-way hidden
Change-Id: I148b54fe47560b2335e9d878ed93bf167d6c7517
2020-03-18 19:50:27 +00:00
Derek Sollenberger
2173ea286a Export symbols for the newly exposed APEX/internal headers
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: I71c6d1a53ae080bf104848679ee62a77cf07c9fa
2020-02-20 21:50:06 -05:00
Derek Sollenberger
c5882c4eb6 Remove dependencies on headers outside UI module
This includes AndroidRuntime and core_jni_helper.h

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: If3d26f41eaf4981505ee47634097f3645fd563fd
2020-02-20 21:49:44 -05:00
Derek Sollenberger
5368eda512 Cleanup LOG_TAG when bundled in HWUI
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: If0f1377e0ab831f38d752c3bbe282397c061b02c
2020-02-19 21:13:34 -05:00
Derek Sollenberger
83ccff716f Move android.graphics JNI & APEX files into HWUI
The graphics JNI code is now separate from libandroid_runtime
and it along with HWUI headers are no longer visible to targets
outside the boundary of what is to become the UI mainline module

The exposed headers to targets outside the module are now restriced
to C APIs contained in the apex header directory.

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: I30d34055b6870dc1039f190a88f4a747cee17300
2020-02-19 21:13:34 -05:00