Commit Graph

10 Commits

Author SHA1 Message Date
Derek Sollenberger
79201b16f1 Remove native calls to HWUI from Surface and use the public API instead
Test: CtsGraphicsTestCases
Bug: 137655431
Change-Id: I1eda485282306d571ca973e179e7202958b59105
2019-10-25 16:25:39 -04:00
Leon Scroggins III
71fae62f5f Pass Bitmap's native instance to JNI where feasible
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases,
      CtsRenderscriptTestCases

This is significantly faster than passing the Java object down and then
calling a JNI method to retrieve the pointer. See
https://buganizer.corp.google.com/issues/16656908#comment19

In some cases this changes what used to be native crashes (due to
android::BitmapWrapper:assertValid's LOG_ALWAYS_FATAL_IF) into
NullPointerExceptions (if a caller used a null Bitmap).

In addition:
- Remove unnecessary JNIEnv param from toBitmap(jlong)
- Change instances of toBitmap(JNIEnv*, jobject) to the above
- Replace calls to GraphicsJNI::getSkBitmap() to inline calls to
  toBitmap/getSkBitmap
- make Canvas#nInitRaster @FastNative (FIXME: Could these be
  @CriticalNative?)

Change-Id: I6194097be1b6e6952eba70e1e7052a5a250eed93
2019-03-27 13:39:23 -04:00
John Reck
28a1f9428e Address API council feedback
Fixes: 127532446
Test: build & checked docs
Change-Id: Ibf14ad52040694ccd503aaa187b99c19338b727a
2019-03-06 17:31:36 -08:00
John Reck
45d70c2bc2 Add nullability annotations to HardwareRenderer
Fixes: 126701502
Test: none
Change-Id: Ic215ffeb8decdadd1ae140c0b278b481b3eb010c
2019-03-04 10:20:27 -08:00
John Reck
e57475e6c9 Address API council feedback
Bug: 125027187
Bug: 125026102
Bug: 125026678
Bug: 125026234
Bug: 125027586
Bug: 125026476
Bug: 125026103
Bug: 125026237
Bug: 125027248
Bug: 125026475
Bug: 125027487
Test: RenderNodeTests
Change-Id: Ic63ea7a3cfe359a7dff0c1b46e534e499f7e928b
2019-02-22 14:24:28 -08:00
Stan Iliev
898123b6a3 Start RenderThread earlier to preload Vulkan/EGL drivers
This CL should fix application startup regression for Vulkan
detected by "Hermetic Startup: EmptyActivity" test.
EGL drivers are loaded in a temp thread to leave more time
in RenderThread for other work. Loading EGL drivers
on the RenderThread may cause a perf regression.

Test: Ran cold-dropcache-test test.
Bug: 122659224
Bug: 123361175
Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
2019-02-20 02:10:52 +00:00
John Reck
fe5dfcacfc Make HardwareRenderer public API
Bug: 123661129
Test: HardwareRenderer CTS tests
Change-Id: Ic7ff69c9489d00e3f525eec761a84d06cf81be7a
2019-02-08 10:50:14 -08:00
Peiyong Lin
a94f3221da [Color] Make setColorMode togglable.
Previously setColorMode must be called before view is set, and has no effect
after that. The state of WCG on Android when this patch was written, was that
most hardware out there can not handle mixed color spaces composition well
which results in GPU composition. And this situation will remain true for a
long time.

Despite photography applications want to have WCG, it's a power cost especially
during video playback. In order to mitigate this fact and the desire to move
the ecosystem forward in WCG, we make setColorMode togglable such that in the
next app vsync, when color mode is changed we issue a surface update which
results in the old EGLSurface or VkSurface being destroyed and new EGLSurface
or VkSurface being created with the target color space being set. As a result,
applications can now togglable WCG on/off.

BUG: 120288123
Test: Build, flash and boot. Verify with SurfaceFlinger dumpsys on demo app.
Change-Id: I09bf8c380a01f4dde364873d37b248cedc6ccfd3
2019-01-31 21:34:50 -08:00
John Reck
5cca8f250c Add continuous SKP capture test api
Bug: 122856066
Test: PictureCaptureDemo
Change-Id: Iaf3a4bc1c8a2c18c7dff635c5f1cf726b331f8bf
2019-01-22 13:13:06 -08:00
John Reck
8785ceb3b9 Refactors and a potential public API for rendering
Split out the View/ViewRootImpl bits from the
hardware rendering bits.

Create a potential public API surface for
hardware rendering

Bug: 112709971
Test: builds & boots

Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
2018-11-08 15:32:35 -08:00