summaryrefslogtreecommitdiff
path: root/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
AgeCommit message (Collapse)Author
2020-10-27Add maxTargetSdk restriction to unused APIs.Mathew Inwood
These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-04-01Replace ImageDecoder.sApiLevel with a SystemApi helperLeon Scroggins III
Bug: 152322291 Test: CtsGraphicsTestCases ImageDecoder is moving to a mainline module, so the system can no longer access the @hidden sApiLevel without making it @SystemApi. Instead of promoting the existing API, provide a common class to be used by any UI rendering class that needs to access the targetSdkVersion. Switch AVD to use the new class, which is a SystemApi. Change-Id: Ie7172fb93364a1e04ab844b8fa64887bf9d8b005
2020-02-13Move RenderNodeAnimator to android.graphics.animation packageDerek Sollenberger
A wrapper still exists at android.view.RenderNode animator as it needs access to internals of the view that would violate the package layering if moved into android.graphics.animation. This CL also moves the Java and cpp files associated with creating a native interpolator that can be run directly on the RenderThread. Bug: 149293249 Test: CtsViewTestCases Change-Id: I5260331fedbd634cf2f6d6d392941e7284527420
2020-01-07Use new UnsupportedAppUsage annotation.Artur Satayev
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 Change-Id: I8ffa1da1bcd43c25f4ff817575db77a33c0f3d31
2019-04-15Added BlendMode equivalent APIs to replace deprecated PorterDuffNader Jawad
variants Updated various framework Views to have equivalent BlendMode APIs to replace the deprecated PorterDuff equivalents. Updated InspectableProperty annotations to refer to the same xml attributes as the original tintmode APIs Bug: 126726419 Test: Added CTS tests to verify new BlendMode APIs Change-Id: Id9ab36d3d4d29f351250723e9d13d49bc6062c83
2019-03-26Added framework APIs to leverage new BlendMode APINader Jawad
Updated various framework APIs to leverage the new BlendMode API that parallels the corresponding porterduff mode equivalent. Added new Drawable#onApplyBlendMode API that provides a backward compatible solution for Drawable implementations that leverage the new BlendMode API as well as fall back on the traditional setTintMode(PorterDuff.Mode) API for instances where it is not implemented Bug:126726419 Test: Re-ran CTS graphics test cases Change-Id: I119a7f57dce0a095c0a73cf83dc50b82beff5e32
2019-03-14Stop double-counting native memory in graphics classesLeon Scroggins III
Bug: 121304803 Test: Infeasible Previously, the NativeAllocationRegistry needed to report how much native memory was being held onto by the Java class in order to get a more accurate count of how much memory was in use. But recent changes allow the system to have an even more accurate view of the native memory with mallinfo(). Further, the AOSP change Idccb8b50d26c8c3e93cc34040d784f74dfcdbf51 introduces new APIs that allow distinguishing between large native malloc allocations, which should cause more frequent mallinfo() checks, and whose sizes need be available to ahat etc, and smaller native malloc allocations. Bitmap and AnimatedImageDrawable use the version for large native malloc allocations. The rest pass an implied size of 0. Note that many of the old Registries used somewhat arbitrary sizes, reinforcing the fact that the new way of keeping track of this is better. Add Bitmap::pixelStorageType to differentiate between types of memory that should be accounted for by the Registry. Update Bitmap::getAllocationByteCount to report the actual size of ashmem allocation. Fix a typo in LineBreaker.java, discovered while looking to find existing callers of Bitmap's constructor. Change-Id: I57c407258450aeaf08b47df32432466639d9faed
2019-02-08Make HardwareRenderer public APIJohn Reck
Bug: 123661129 Test: HardwareRenderer CTS tests Change-Id: Ic7ff69c9489d00e3f525eec761a84d06cf81be7a
2018-10-04Rename & package shuffleJohn Reck
Rename DisplayListCanvas -> RecordingCanvas Move RecordingCanvas to android.graphics Move RenderNode to android.graphics Bug: 112709971 Test: make & boot Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
2018-09-26De-couple RenderNode from View packageJohn Reck
First step of moving RenderNode to the graphics package Test: builds Change-Id: Ife7f5ec6698e32393d1b85ed2bad909ef0210be4
2018-07-31Add @UnsupportedAppUsage annotationsMathew Inwood
For packages: android.graphics android.graphics.drawable android.graphics.drawable.shapes android.graphics.fonts android.graphics.pdf 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: I7fc1162d2c63df8751a4660607e8ce72070efed8
2018-06-13Merge "docs: repaired link to internal section" into pi-dev am: bcae0ff7a2Laura Davis
am: ad824eb7a8 Change-Id: I0c4d86cf6d6cf2465f01e209edf3b47c6c6bb4a2
2018-06-07docs: repaired link to internal sectionLaura Davis
Test: make ds-docs Bug: 79236136 Change-Id: Idf48cf7a055a0aa3841d6b4d0540724b43c61241
2018-05-09Update Drawable API to expose getOpticalBounds method as well asNader Jawad
the Insets class Updated all Drawable implementations to remove the @hide annotation Fixes: 78942648 Test: Re-run CtsGraphicsTestCases and updated Drawable CTS tests to verify getOpticalBounds implementations Change-Id: Id9b6bbbe15173e310bbf44184b4678fb29ef1cd8
2018-03-01Recommend res/animator/ for animator style res in AVDDoris Liu
BUG: 74074384 Test: Visual inspection Change-Id: Ifd268efd85124c7597b5b135a3dbe13d009dc917
2017-10-27Add more gradient info in VectorDrawable's javadocztenghui
b/30269243 Test: make offline-sdk-docs -j24 Change-Id: Ie9a353c05508b818efd7e401c2624b9be5dbdcc2
2017-06-05Better error message for AVDDoris Liu
Moved the error checking to an earlier stage of the AVD, so that the error message can contain more information. BUG: 36571432 Test: Follow the repro step in b/36244835, the error message is much clear now. Change-Id: Ibc6a0e666cc4c23c3dfa589755a77a015da2db1c
2016-11-16Update the documentation related to VD / AVDTeng-Hui Zhu
fix:32705240 fix:32683765 fix:32831830 fix:32705244 Test: make offline-sdk-docs and view the HTML file. Change-Id: I6ae3e5850494f13a241b2e9e4d2c5b95d5199aae
2016-10-07Convert VD/AVD to FastNativeJohn Reck
Test: build & boots Change-Id: I6519ba245eca1a43fb00de36c91a05a9740c8c5f
2016-10-03Restrict AVD and VD parsing to the current element instead of the whole documentDoris Liu
This CL changes the AVD xml parsing to parsing only within the current element, which prevents AVD parsing from always skipping to the end of the doucment. So things that are defined after AVD in the same document can be picked up by the xml parser. The same fix has been applied to VD as well. BUG: 31865175 Test: Manually following comment #1 in the bug above Change-Id: I4ebdce1eb2e92d6f6e2c37caed9607253d24602f
2016-09-21Improve Javadoc for AnimatedVectorDrawableDoris Liu
This CL adds a summary of what developers can expect from running AVD on RenderThread. Also re-structure the class level Javadoc summary to better organize the examples. Test: make offline-sdk-docs BUG: 30402908 Change-Id: I7111f67db5f2ec352730f633bb34f2e89e1c70e9
2016-08-22Update the javaDoc for VectorDrawable and AnimatedVectorDrawableTeng-Hui Zhu
b/30269243 Change-Id: I139a3fcac95c41a667fa06aa3223b812caad6243 (cherry picked from commit c224417511d8179a08c4dfd4badc73dd9699ebf2)
2016-08-17Fix listeners not getting called when AVD falls back on UI threadDoris Liu
When AVD fall back on UI thread, in addition to transfer the pending actions from RT animator to UI animator, we also need to transfer the listener, if any. BUG: 30901495 Change-Id: Ib4a7ebb2996a02596bb5789704617c894a5dd474
2016-08-09Fix issue #30766518: Document what targeting N doesDianne Hackborn
Also small documentation cleanup in a few other places. Change-Id: I16581c751aa0ffa146faba3b140a8fa2170f4520
2016-08-05Support repeatMode = reverse in AVDDoris Liu
BUG: 30641232 Change-Id: I34c823a0a45c8441873a9b467275174c5529994b
2016-06-16Support AVD animation falling back on UI threadDoris Liu
AVD will fall back to UI thread animation if the host view is rendering onto a SW layer. BUG: 27617346 Change-Id: I5b644529048a0c30aada3abf2f4e95e40760936d
2016-06-09Support Keyframe definition for AVD on RTDoris Liu
BUG: 27441613 Change-Id: Iece386f65f3704d1b7caa2b3690a8d3048ccf6e2
2016-06-09Throw Exception for wrong valueType with API guardDoris Liu
Previously, wrong valueType error is swallowed in jni. As a result, some animations are quietly skipped without letting developers know. This CL maintains that behavior for pre-N, and throws Exception to notify developers of the error for N and above. Bug: 29009391 Change-Id: I3e8f003cdb97d214da72af3f93a84f64797b1c2c (cherry picked from commit 94db09917a17976135e2c63d8e4171c54730c079)
2016-06-09Merge "Handle hidden RT VectorDrawable animators" into nyc-mr1-devDoris Liu
2016-06-09Handle hidden RT VectorDrawable animatorsDoris Liu
This CL changes the target of VD specific animators to VectorDrawable, instead of RenderNode. The benefit of doing so is that animators can now detect whether the animation is meaningful by checking whether their VD target is in the display list. If not, that means the VD is not drawing for the current frame, in which case we can be smarter and more power efficient by removing the animator from the list and posting a delayed onFinished listener callback. By setting VD as the animation target, when an ImageView decides to update its drawable from one AVD to something else, we'll be able to detect that the previous AVD is no longer in the display list, and stop providing animation pulse to the stale AVD, which is something we couldn't do previously. This change also handles the case where one AVD instance could be drawn in two different views. Bug: 27441375 Change-Id: Iaad1ed09cfd526276b95db0dd695275c28e074e8
2016-06-08Improve the property modification effiency of VectorDrawable animatorsDoris Liu
Previously, the VectorDrawable animators modify the VD properties by doing reflection based on the property name. This CL avoids the overhead of calling reflection by wrapping the setters of VD objects in Float/IntProperty. Bug: 28124049 Change-Id: I562c8d749fdfe508564c82a700a92e835cdd9ff4 (cherry picked from commit 9f3b31b9530a2121b4557fc312972c4faa133d5e)
2016-04-18Pause infinite AVD when the drawable is not visibleDoris Liu
And resume when it becomes visible again Bug: 27441375 Change-Id: Ic5140a30f5726df252ca63be9e14c495cbd76466
2016-04-04Make AVD thread safeDoris Liu
This CL introduces staging properties to VectorDrawable, which holds properties coming from UI thread. When staging properties are changed, they are marked dirty, and the staging properties then get pushed to RenderThread at sync point. In cases where no staging property has been changed, at sync point we sync the render thread properties back to staging properties to reflect the latest render thread animation value change. Also, update Vector Drawable bitmap only when it's dirty Bug: 27343970 Bug: 27385912 Bug: 27263667 Bug: 27927674 Bug: 27774383 Change-Id: Ia864f5400a53a08dbfb284fae581fb1aac4fff87
2016-03-22Fix callback issue for AVD on UI threadTeng-Hui Zhu
We have created AnimatorSet from XML, but it is assigned to the AVD only when we start the animation due to theme-ing operations. Given listeners can be added to AVD at any time, we have to cache them if AnimatorSet is not setup yet. b/26979225 Change-Id: I94315892de83f93a0205efe5e70dca0cd0f0a8e3
2016-03-14Switch back to UI-driven AVDJohn Reck
Bug: 27550546 Change-Id: I7c37438555fb8a72d2ff0bc42bf5de25a31cc464
2016-03-14Merge "Ensure all Java-side usages of config flags are using Java flags" ↵Alan Viverette
into nyc-dev
2016-03-11Ensure all Java-side usages of config flags are using Java flagsAlan Viverette
Previously we were using native config flags in some places that expected Java flags, and vice-versa. All usages of config flags are now annotated to ensure we're using the right type. Cleans up annotations on most methods that were touched. Bug: 21161798 Change-Id: Ifd87dfb12199fc8258915d8a510e03ddb681ca89
2016-03-11Merge "Add consistent @NonNull annotations for drawable callbacks" into nyc-devAlan Viverette
2016-03-11Merge "Add the missing overriden API" into nyc-devTenghui Zhu
2016-03-11Add consistent @NonNull annotations for drawable callbacksAlan Viverette
Bug: 27599515 Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
2016-03-09Add the missing overriden APITeng-Hui Zhu
This is exposed by the CTS test. Change-Id: Ic25fda1567d8c8504612d4e825dbb646f7db1076
2016-03-09Merge "Update the VD and AVD's getOpacity()" into nyc-devTenghui Zhu
2016-03-08Update the VD and AVD's getOpacity()Teng-Hui Zhu
static VectorDrawable should be returning Transparent while root alpha is 0. AnimatedVectorDrawable running on RenderThread now, and the opacity should be conservatively set as Translucent. http://b/27554766 Change-Id: I9a78696cab94f10ba40a733cc9c00f1c2d7ebb7f
2016-03-01Handle multiple animation actions within one frameDoris Liu
Bug: 27438778 Change-Id: I1b14da4bc7b4e82e5b4e45f3eb9ad04e3d7842c4
2016-02-23Support running AVD on UI threadDoris Liu
By default, AVD animates on RT thread. But since in some cases there's a need for a finer control on when the frame update for the animation should happen, such as coordiating the AVD animation with other animations that run on UI thread, we are providing a way to force the AVD to run on UI thread. Bug: 27278616 Change-Id: I372ecd3dc52e3fa0bdce3a1e9c19443f9b199027
2016-02-19Ensure invalidate is called after start()/reverse()Doris Liu
Change-Id: Iec96ada74cc7b845e21b5f0eb208ff7c7b1071ed
2016-02-19Revert "Revert "Check RenderNode's owning view before attaching animators""Doris Liu
This reverts commit eb40178af3b7c8d925eaf6c1aa0bef739c8ea47e. Change-Id: I6838ecb35b50847746ee66ac204f14eb5f579b91
2016-02-19VectorDrawable native rendering - Step 5 of MANYDoris Liu
This is reverting the revert of what reverts the revert of the original implementation. Fourth revert is a charm! This reverts commit df7fdb1e0bdb5c289bbc08047e5c710185503309. Change-Id: I6fc3a5accfd8b79c3da31bbc101ad9e9b4d6e7dd
2016-02-18Revert "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY"""Doris Liu
This reverts commit 0d20a275a5baf8579c8b9111cf2ce6615874a6b6. Change-Id: I97c782f1164a5d39ab74dc098cca71d9e1b30cd8
2016-02-12Revert "Revert "VectorDrawable native rendering - Step 5 of MANY""Doris Liu
This reverts commit e03ef25a3e44ef5d495e366c30b9b5b69fc58194. Change-Id: I9c2e1c891667451a3ee668e414bf337ad67279ab