Commit Graph

495 Commits

Author SHA1 Message Date
Artur Satayev
53ada2ab28 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv \
      git diff HEAD^ HEAD | grep '^[+-][^+-]' | grep -v '.import'
Merged-In: I853372f3c6fef905553bb31be4f1bb48df735f7a
Change-Id: I853372f3c6fef905553bb31be4f1bb48df735f7a
2020-01-14 15:54:55 +00:00
Austin Wang
a63a2c0130 Revert "Use new UnsupportedAppUsage annotation."
This reverts commit a5264903e2.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=sdk_phone_armv7-sdk&lkgb=6083299&lkbb=6085371&fkbb=6083313, bug b/146533269

Change-Id: Ie5b031d7b277cf0e09b0a9776b26bf74f5f69e70
2019-12-19 06:38:19 +00:00
Artur Satayev
a5264903e2 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv \
      git diff HEAD^ HEAD | grep '^[+-][^+-]' | grep -v '.import'
Change-Id: I087bb1cecbe59f1cf0c2e770c735d7a433722c6f
2019-12-18 12:07:36 +00: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
Hans Boehm
0f037171c9 Merge "Correct registerNativeAllocation type" am: fe015a098c am: 90e8135f1e
am: ecb7e4a77b

Change-Id: I2ba5370ad1f6f3b8f0ad757c0993b5c399baaea7
2019-03-12 16:23:19 -07:00
Miao Wang
08d7d0398e Add check for input allocation type for ScriptIntrinsicBlur.
Bug: 124466617
Test: mm
Test: CtsRenderscriptTestCases
Change-Id: I4784b96b5f96749d503bd1de8360e74b72f3f5c2
2019-03-06 12:49:19 -08:00
Hans Boehm
da3cee60c5 Correct registerNativeAllocation type
We're changing the argument type to long, since it should be roughly
large enough to hold a size_t everywhere.

Make style checker happy by reordering imports.

Test: Treehugger
Change-Id: Iccdc5fa592f56d448817f7762af1cff27b4fc2a8
2019-02-11 11:22:25 -08:00
Mathew Inwood
1d526c114f Merge "Add @UnsupportedAppUsage annotations"
am: 3d05f769a3

Change-Id: Id21c0f5dee82e2f2174d795763420bfed806a17b
2018-08-06 09:38:58 -07:00
Mathew Inwood
1532447a7b Add @UnsupportedAppUsage annotations
For packages:
  android.renderscript

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I016f6e720e79c48afe44f4690b5dd99fc81ae780
Merged-In: I1aa8ebca448547031b426a7b305c5c3d6fcf2652
2018-08-06 11:19:48 +01:00
Mathew Inwood
f0c90b1f36 Add @UnsupportedAppUsage annotations
For packages:
  android.renderscript

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I1aa8ebca448547031b426a7b305c5c3d6fcf2652
2018-08-02 14:46:03 +01:00
Todd Kopriva
1057fc37f5 Merge "docs: fixing bug 36982027 and 30636712, typos" into oc-mr1-dev
am: 5b0a4eea8d

Change-Id: Iff4044c52e7ccdf6f7f879b9d5457ce1458b21bd
2018-03-23 22:11:38 +00:00
kopriva
6a7f167f67 docs: fixing bug 36982027 and 30636712, typos
Test: make ds-docs

Bug: 36982027
Bug: 30636712

Change-Id: I70d6d216c714a31b7e762a203a27f6124642131e
2018-03-20 17:59:48 -07:00
Adam Lesinski
bebfcc46a2 Refactor AssetManager
Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
2018-02-28 19:06:48 -08:00
Miao Wang
503185873e Add OWNERS to frameworks/base/rs
Bug: 73485081
Test: none needed
Change-Id: I1d0c351d51fb5398799090a868b33e4a8e639588
2018-02-15 11:36:49 -08:00
Adam Lesinski
bde1df21ad Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit 1187590da3.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
2018-02-09 12:43:24 -08: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
Adam Lesinski
f7d01dd7e1 Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit dcb3c6559b.

Bug:72511998
Change-Id: I665966ca109f66f85d8665db388c71ea2303c3b8
2018-01-25 17:39:40 -08:00
Adam Lesinski
dcb3c6559b Replace AssetManager with AssetManager2 implementation
Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I572eb13c6a4372c7f656f5912821cececd5bf3d4
2018-01-24 15:19:04 -08:00
Adam Lesinski
7fb3831136 Revert "Replace AssetManager with AssetManager2 implementation"
This reverts commit b20a0ce59f.
2018-01-23 03:17:26 -08:00
Adam Lesinski
b20a0ce59f Replace AssetManager with AssetManager2 implementation
Test: Existing CTS tests pass
Test: make libandroidfw_tests
Change-Id: I858f7e1d909c08273b096601136e3f28e15eb5d4
2018-01-09 16:28:58 -08:00
Mike Reed
7569de0f90 switch to new API for compute image size
Test: make

Change-Id: Ie3a5d068bef1c2a1790ab227f6398695aee11cf7
2017-10-06 16:25:55 -04:00
Derek Sollenberger
71b36912e0 Merge "Reduce overhead by combining libskia and libhwui into a single library." 2017-09-25 15:45:34 +00:00
Derek Sollenberger
d938e5a2e2 Reduce overhead by combining libskia and libhwui into a single library.
This is a multiproject change as we need to both the libraries
themselves as well as those that had dependencies on libskia.so

Bug: 31971097
Test: compile only
Change-Id: Ie6ff1f4682d03289205f4d6048cde9f95c61a90f
2017-07-24 09:42:07 -04:00
Steven Moreland
9f430b2782 Merge "frameworks/base: use proper nativehelper headers" am: 826eafd958 am: 5c091dc944
am: c840945a78

Change-Id: I654e14f0d1b495450db81592a2e564e308746350
2017-07-20 03:05:02 +00:00
Steven Moreland
5c091dc944 Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Steven Moreland
2279b25342 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Yang Ni
532a67c464 Merge "Do not CloseGuard KernelID or FieldID" am: 6b70eafae1 am: d25acf1022
am: 1b74e324f6

Change-Id: I1220dcc0ee27b8ba5650bf78cf9e8574b16e3486
2017-06-13 22:29:12 +00:00
Yang Ni
1b74e324f6 Merge "Do not CloseGuard KernelID or FieldID" am: 6b70eafae1
am: d25acf1022

Change-Id: I900b48f94fdbdd1f502de36e3f121f472ea1daf8
2017-06-13 22:18:51 +00:00
Treehugger Robot
6b70eafae1 Merge "Do not CloseGuard KernelID or FieldID" 2017-06-13 21:49:49 +00:00
Yang Ni
3a84a23f36 Do not CloseGuard KernelID or FieldID
Bug: 28053584

Stop CloseGuarding for two reasons:

1) KernelID and FieldID objects are constructed in auto-generated
(RenderScript reflected) Java code. It would be impossible for a user to
explicitly call destroy() on them. Guarding them would leave a lot of
noisy warnings in logcat.

2) These KernelID and FieldID objects are not big compared to other
RenderScript objects, e.g. Allocations. They occupy almost no native
resources except for a native pointer. Leaving their destruction to Java
GC would be completely acceptable, since any delay in reclaiming them is
unlikely to cause memory pressure.

Test: CTS on x86_64 emulator
Change-Id: I587b5561a0b2bdbf0b2e95bf2995c20d5f5faf9d
2017-06-13 19:41:55 +00:00
Yang Ni
25f6c69fbb Merge "Destroy Allocation right away on exception" am: 52bc790f61 am: a37bef769a am: fd9f091995
am: 26a5164479

Change-Id: I5017653d4a19b6a0e111f5ae5f0905cf7a5e7d2c
2017-05-08 16:22:04 +00:00
Yang Ni
26a5164479 Merge "Destroy Allocation right away on exception" am: 52bc790f61 am: a37bef769a
am: fd9f091995

Change-Id: Ie83694e722af77c7fc324b8b850e4308f093ab04
2017-05-08 16:12:37 +00:00
Yang Ni
c48a09cce8 Destroy Allocation right away on exception
Bug: 28053584

To avoid holding the resource (surface) for too long.

Test: CTS on x86_64 emulator
Change-Id: I2fdec107c2a16b7dadbf78a9aee79c33423a3676
2017-05-05 15:32:34 +00:00
Yang Ni
674f774176 Merge "Destroy Allocation with ScriptIntrinsicLut" am: 622b140f94 am: 088eca8302 am: 43dca4780f
am: a21bcbff08

Change-Id: Iad951014bb6c3c08a9fcb280bc263a51dc8e6705
2017-05-04 19:14:48 +00:00
Yang Ni
a21bcbff08 Merge "Destroy Allocation with ScriptIntrinsicLut" am: 622b140f94 am: 088eca8302
am: 43dca4780f

Change-Id: Ic180a772a7131e32987364d01581b0333315b798
2017-05-04 19:08:27 +00:00
Yang Ni
8b8f75a700 Destroy Allocation with ScriptIntrinsicLut
Bug: 28053584

On destroying the intrinsic, destroy its contained Allocation right away.

Test: CTS on x86_64 emulator
Change-Id: I5ca0da33b620c3291b7cafda31a6cc83eb7461a0
2017-05-04 18:44:17 +00:00
Steven Moreland
c941fb0f1a RenderScript: IWYU
Renderscript was depending on macros from android-base that were
transitively included from MQDescriptor.h

Test: links
Bug: 37791060
Change-Id: Ie34ddef67328c5fcc6b0122a32725b980615ff43
(cherry picked from commit dc01e938c2)
2017-05-02 19:04:08 +00:00
Steven Moreland
dc01e938c2 RenderScript: IWYU
Renderscript was depending on macros from android-base that were
transitively included from MQDescriptor.h

Test: links
Bug: 37791060
Change-Id: Ie34ddef67328c5fcc6b0122a32725b980615ff43
2017-05-01 12:56:08 -07:00
Yang Ni
2d5664f68b Merge "Validates Intrinsic Blur only takes 2D Allocations" am: b44f4d2f51 am: 0962a6e83c am: cfe40aa165
am: 5be70d014b

Change-Id: Ie79dfe42049354c3bb60de9e9987fc8c75167f30
2017-04-20 23:04:07 +00:00
Yang Ni
5be70d014b Merge "Validates Intrinsic Blur only takes 2D Allocations" am: b44f4d2f51 am: 0962a6e83c
am: cfe40aa165

Change-Id: I7f191c2da99f310b4af599ab4849daeb90eb7497
2017-04-20 22:58:37 +00:00
Yang Ni
bb671376ff Validates Intrinsic Blur only takes 2D Allocations
Bug: 24555166

Test: RSTest on x86_64 emulator
Change-Id: I0c8c970ce85989c3213fb4986e517ac0be5beb26
2017-04-18 15:43:08 -07:00
Mike Reed
7c0ae0f58b bitmaps and pixelrefs no longer need lock/unlock
Test: covered by CtsGraphicsTestCases and hwui_unit_tests

Change-Id: I42a25961a2eb3755d2fd22a617aa21a24ec0994f
2017-04-18 10:22:42 -04:00
Miao Wang
f35ddc9843 [RenderScript] Connect ANativeWindow to BufferQueue before calling
AllocationSetSurface.

Bug: 34334222
Test: mm, boot Sailfish, CTS pass and ImageProcessingJB works well.
Change-Id: I77e7fb69987a347862286299622343b4f7879ab0
2017-04-04 05:59:19 +00:00
Pawin Vongmasa
34cca21eac Make IGraphicBufferProducer a hybrid interface.
android::IGraphicBufferProducer will now become a hybrid
interface on
top of the HIDL interface
android::hardware::graphics::bufferqueue::V1_0::IGraphicBufferProducer.

Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'

Bug: 33854657
Change-Id: Ia8914ea49d2acf3d43682982a164d7e10f7b8542
2017-03-14 18:45:26 -07:00
Miao Wang
db889edb1d Merge changes from topic 'USAGE_IO_INPUT'
am: 70fac233fa

Change-Id: I3f8db9b25a8ccee8ddb596baf5e54a268747de9f
2017-03-09 20:51:50 +00:00
Miao Wang
483a424903 [RenderScript] Use ANativeWindow_fromSurface to get ANativeWindow from Java Surface.
am: 33287e8a89

Change-Id: Iffd2de04c50f07806063543abe9cd359ce48b6df
2017-03-09 20:50:38 +00:00
Miao Wang
70fac233fa Merge changes from topic 'USAGE_IO_INPUT'
* changes:
  [RenderScript] Update RenderScript JNI with the corresponding AllocationGetSurface driver implementation change.
  [RenderScript] Use ANativeWindow_fromSurface to get ANativeWindow from Java Surface.
2017-03-09 20:38:49 +00:00
Yang Ni
25684ceff5 Merge "Removed close guards for Element and Type objects"
am: 97c9b57cec

Change-Id: I28b4149b6a0ace42dff2ca4ce9a1803b0baa4430
2017-03-07 00:36:19 +00:00
Miao Wang
1e95fc8658 [RenderScript] Update RenderScript JNI with the corresponding
AllocationGetSurface driver implementation change.

 - AllocationGetSurface now returns opaque handle to ANativeWindow*,
 instead of IGraphicBufferProducer*, as IGraphicBufferProducer is not
 part of NDK. So the JNI side need to change accordingly.

Bug: 34396220
Test: mm, CTS tests pass.
Change-Id: If9b6a733202d29bc40c0e0b87c4fb48db092cbe5
2017-03-06 10:03:30 -08:00
Miao Wang
33287e8a89 [RenderScript] Use ANativeWindow_fromSurface to get ANativeWindow
from Java Surface.

 - ANativeWindow_fromSurface and ANativeWindow_release has to be used in
 pairs to avoid leaks.

Bug: 34396220
Test: mm, CTS tests pass.
Change-Id: Id67fd005a056df4d496a48f705d445a2d8c45232
2017-03-06 09:59:06 -08:00