summaryrefslogtreecommitdiff
path: root/core/java/android/view/TextureView.java
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation clarifying the differences between Surface/TextureViewSumir Kataria2022-03-301-2/+39
| | | | | Test: Built docs Change-Id: Iec47b85bbfc537932832b1ad3fa98975a93075df
* Fix TextureView docs to use more modern sample codeChet Haase2021-07-221-30/+55
| | | | | | | | | | | | | The existing TextureView class docs use a sample that relies on Camera APIs, which have been deprecated for some time. The new sample uses MediaPlayer (and calls out to other possible components that could be used with TextureView). The docs have also been updated to reflect recommendations on using CameraX for camera functionality and SurfaceView vs. TextureView for performance reasons. Test: N/A, docs only Fixes: 191847306 Change-Id: I2038c09309ed63c79b583779124d48016ca225a2
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-7/+8
| | | | | | | | | | | | | | | | | | | 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. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-8/+7
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-7/+8
| | | | | | | | | | 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
* Move TextureLayer into android.graphicsLeon Scroggins III2020-06-021-1/+2
| | | | | | | | | | | | | | | | 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
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | 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: I5be7335b23a92b8ac80d2fd890198273b66ad644
* Add missing nullability annotationsJohn Reck2019-11-041-32/+34
| | | | | | Bug: 123674035 Test: none Change-Id: I5fa3a52f98a495b25c8aa01554ebba73ac89eb9f
* Rename & package shuffleJohn Reck2018-10-041-2/+3
| | | | | | | | | | Rename DisplayListCanvas -> RecordingCanvas Move RecordingCanvas to android.graphics Move RenderNode to android.graphics Bug: 112709971 Test: make & boot Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view 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: I4147b038ed7adf0311ee9918b44766f82a057eaf
* Rename HardwareLayer -> TextureLayerJohn Reck2018-02-211-5/+5
| | | | | | | | Update name to reflect meaning/usage Change-Id: Iddb3621cbca147f96faa83380867baa49c382aab Fixes: 20461288 Test: builds & boots
* docs: fix grammar mistake in TextureView am: e8691d19cb am: 4ff96480b3Mark Lu2016-09-071-1/+1
|\ | | | | | | | | | | am: 43e0737ce0 Change-Id: Iba626dce4bea3d1426665e45f392e78f214dec30
| * docs: fix grammar mistake in TextureView am: e8691d19cbMark Lu2016-09-071-1/+1
| |\ | | | | | | | | | | | | | | | am: 4ff96480b3 Change-Id: I13790afb7f25cd73ce24ae84de63b1bf3b56332e
| | * docs: fix grammar mistake in TextureViewMark Lu2016-08-301-1/+1
| | | | | | | | | Bug: 6441115
| | * Cherry pick TextureView fixesChris Craik2016-08-291-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following changes are in this commit: Avoid destroying TextureView surfaces for onStop bug:30238922 TextureViews will hold onto their backing surfaces, which will allow them to resume gracefully when the app's surfaces are saved. Now only resources that are destroyed for onStop are DisplayLists. (cherry picked from commit 391d560402c2902e0fd701f99eabd91025154201) TextureView: destroy layer on destroyHardwareResources event bug:30468770 (cherry picked from commit 1c16c37d8646ed25e844af8472eede988ad0c2f0) Fix NPE in TextureView Bug: 30651595 (cherry picked from commit 3c2587f26eed32a8723488131d1d8940dc147ee1) Fix NPE in TextureView Bug: 30779663 (cherry picked from commit 7e237189c292cdb886733eb95c6069b7ac002527) Fix maps resume being blank Bug: 30889568 Fixes an issue where mLayer didn't have the mSurface set on it in certain resume scenarios. (cherry picked from commit 03df0834e63b587dbfb8fdcd0086e3e1e72b9f9d)
* | | TextureView: clean up displaylists am: 17dd01b693 am: ac2ca87e92sergeyv2016-08-311-0/+1
|\| | | | | | | | | | | | | | | | | am: bb37b7b613 Change-Id: I12252ddc60ad7f52fe1604ac84042a759b8373c4
| * | TextureView: clean up displaylistssergeyv2016-08-301-0/+1
| | | | | | | | | | | | | | | bug:31066756 Change-Id: Ibc61825ad1ed12479e9de18cc06be7401d3fc93a
* | | Fix maps resume being blank am: 03df0834e6 am: 08669fff33John Reck2016-08-171-1/+1
|\| | | | | | | | | | | | | | | | | am: 28f4ee5f7b Change-Id: I5d6ea69cb13a43401a6cdc7039eafc1186a2fa85
| * | Fix maps resume being blankJohn Reck2016-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 30889568 Fixes an issue where mLayer didn't have the mSurface set on it in certain resume scenarios. Change-Id: Ib75065d3d75e6141d6cd8f306584f6a569b9907c
* | | resolve merge conflicts of cdbdd46 to masterJohn Reck2016-08-121-4/+5
|\| | | | | | | | | | | Change-Id: I18a60477799865973fc9d6c876d95e3cee6e5031
| * | Fix NPE in TextureViewJohn Reck2016-08-111-4/+5
| | | | | | | | | | | | | | | Bug: 30779663 Change-Id: Ib3d40b60674ab3de8bfcfdd8489b89cf07b8d8b3
* | | Fix NPE in TextureView am: 3c2587f26e am: 8fe31ec0e0John Reck2016-08-041-11/+13
|\| | | | | | | | | | | | | | | | | am: 2f072bae6e Change-Id: I8c1a2c4505086f5022fb4e0893cf32e201c2a31b
| * | Fix NPE in TextureViewJohn Reck2016-08-041-11/+13
| | | | | | | | | | | | | | | Bug: 30651595 Change-Id: Ic6cc2a1598de173aaadb4061562236a563a662b3
* | | TextureView: destroy layer on destroyHardwareResources event am: 1c16c37d86 ↵sergeyv2016-08-031-18/+30
|\| | | | | | | | | | | | | | | | | | | | | | | am: ab7b865ef6 am: 221b1f7b46 Change-Id: I7f7d9133e168906524b892a5c4e5388e0b3a33bc
| * | TextureView: destroy layer on destroyHardwareResources eventsergeyv2016-08-021-18/+30
| | | | | | | | | | | | | | | bug:30468770 Change-Id: I5174808e3fa6e4a87e3522246522c4e6d7ee2c3c
* | | Avoid destroying TextureView surfaces for onStop am: 391d560402Chris Craik2016-07-261-11/+0
|\| | | | | | | | | | | | | | | | | am: 5fbbcdcd32 Change-Id: I1bda6841c540572ff9390c0124cb1ac9f6f22c83
| * | Avoid destroying TextureView surfaces for onStopChris Craik2016-07-251-11/+0
| |/ | | | | | | | | | | | | | | | | | | | | bug:30238922 TextureViews will hold onto their backing surfaces, which will allow them to resume gracefully when the app's surfaces are saved. Now only resources that are destroyed for onStop are DisplayLists. Change-Id: Ia768ba9ffc4497c26aa3a5b101a0f5fa1a258b9c
* / Fix wording regarding ThreadedRendererStan Iliev2016-06-281-2/+2
|/ | | | | | | | ThreadedRenderer is not synonymous with hardware rendering, so remove references to hardware rendering when referring to ThreadedRenderer. Change-Id: Ic66a482ccf05f556ebe6ec194ce4f858f75bbb8b
* Clean up setLayerType and setLayerPaintsergeyv2016-03-241-16/+9
| | | | | bug:21755299 Change-Id: I8f0953ccfc3d743abdecc8ec228ed3e1b6718c3c
* Check api level before throwing in drawable settersChris Craik2016-01-041-2/+2
| | | | | | | | bug:25801789 TextureView started throwing in these in N. Change-Id: I538d1c57deb0a5a6a25c297833af06d3f237600c
* Revert "Revert "Simplify TextureView draw path""Chris Craik2015-08-211-11/+17
| | | | | | | | Fixed build breakage This reverts commit d35dcb13115ca1dd8c07e397f43a186cd7fd1a01. Change-Id: Id3a103fbaac15a05f558bce2161ce17b6e8d2ea3
* Merge "Revert "Simplify TextureView draw path""Bart Sears2015-08-201-17/+11
|\
| * Revert "Simplify TextureView draw path"Bart Sears2015-08-201-17/+11
| | | | | | | | | | | | This reverts commit 20a248934c67b19c8734362dba76a5cc94254686. Change-Id: Iaa3ebb1d868acbe184080087aec312b43e87e3c7
* | Merge "Simplify TextureView draw path"Chris Craik2015-08-201-11/+17
|\|
| * Simplify TextureView draw pathChris Craik2015-08-191-11/+17
| | | | | | | | | | | | bug:20461288 Change-Id: I239fbd26ab2177481c84feb62a1da68faeb634ac
* | Throw exception when setting a fg/bg on TextureViewChris Craik2015-08-191-0/+17
|/ | | | Change-Id: Iead53e0947d941ebc1331f77fc478c475e24c812
* Fix whitespace in TextureViewJohn Reck2015-05-201-74/+74
| | | | Change-Id: I22396b7205dc2b9cf0eda5bd8aa951cad8d8bd87
* Fix NPE in setSurfaceTexureJohn Reck2015-05-201-3/+7
| | | | | Bug: 20088412 Change-Id: I9b78636a7d89438c8924bb1bf2adba00e74366eb
* Check for setting to already setJohn Reck2015-05-141-0/+8
| | | | | Bug: 20105644 Change-Id: Ia79d2ae5c725c139d2b7c423a899be625cb8f14f
* Make sure transform matrix is applied when hardware layer is re-createdDoris Liu2015-04-301-0/+3
| | | | | Bug: 11168275 Change-Id: I9234a2efc7580d27ac8b7f0e60ceed7df23f5f25
* Remove View:hasStaticLayer()John Reck2015-04-281-5/+0
| | | | | Bug: 19113169 Change-Id: I81286db45eecc92c0adf04a5983b752bf3290d45
* Fix setSurfaceTexture to handle surface cachingNaveen Kalla2015-03-181-0/+6
| | | | | | | | | | | | | | | TextureView contains its surfaceTexture (i.e. mSurface) and its OnFrameAvailableListener(i.e. mUpdateListener). In order to apply a cached/pre-existing SurfaceTexture s1 to a TextureView, if we call TextureView.setSurfaceTexture(s1), the OnFrameAvailableListener of s1 should get set to mUpdateListener of TextureView since the mSurface has been updated. The existing code doesn't apply this and causes the frames to not be updated on a TextureView that uses setSurfaceTexture. This change fixes setSurfaceTexture method by setting s1's OnFrameAvailableListener to mUpdateListener. Change-Id: I4c1a704c587e977ab7a6b1fe3a7d3e0d20d00218
* More cleanupsJohn Reck2014-06-271-7/+4
| | | | Change-Id: Id5967944b949a2aec57e4fe9fdcdc04c11b8c35a
* Move LayerType to RenderNodeJohn Reck2014-06-121-5/+5
| | | | Change-Id: Icb79a5015cb0362b1f3a66d09007450730135a97
* Fix NPE in onVisibilityChangedJohn Reck2014-05-291-1/+3
| | | | | | | | | | | Bug: 15089790 onVisibilityChanged may happen before the View is attached. Only attempt to re-set the update listener if mLayer is not null, as it means the View is attached and has already drawn once. If mLayer is null then the update listener will be set when the view next draws Change-Id: I406e359a0a0720988f026f9cbde26afdb564ca92
* Fix crash due to texture view callback threading invariants.Jeff Brown2014-05-061-19/+11
| | | | | | | | | | | | | | | | | | Allow the client of a SurfaceTexture to specify the Handler to which the update callback should be directed to avoid unnecessary scheduling ping-pong between threads. Fixed an invalid assumption in TextureView that it is attached to the main looper which could result in a crash under certain circumstances. In normal app processes, it is true that TextureViews must be created on the main looper since hardware rendering is currently only supported on the main looper. However, in the system server, UI components run a different thread. Although hardware rendering is normally disabled in the system server, it may be enabled for certain developer features. Bug: 14445309 Change-Id: I5ae17ad018b9ef05ba87ec2f972c7c82e2bca70a
* Revert "Revert "Workaround apps not calling super.onDetachedFromWindow()""John Reck2014-03-061-2/+3
| | | | | | This reverts commit bac16fae7e6fceb1e516252ede673844b772e7c3. Change-Id: I61e997b23fac1aa984129fdc0328426ff8891bdd
* Revert "Workaround apps not calling super.onDetachedFromWindow()"Bart Sears2014-03-061-2/+2
| | | | | | | | Requested by jreck to fix the build. This reverts commit 198d20842a537f3df3584ea084e74220e172b086. Change-Id: I733065cc124b59bf914034f5bac5e2e951a5b604
* Workaround apps not calling super.onDetachedFromWindow()John Reck2014-03-061-2/+2
| | | | | | | | Bug: 13338698 Move the releasing of hardware resources to a new @hide onDetachedFromWindowInternal Change-Id: I52b4e6ba4d5b3ce20b89cabffa248d1d780e3e81
* Support HardwareLayers in RenderThreadJohn Reck2014-02-191-24/+2
| | | | | | Also has a few HardwareLayer lifecycle fixes Change-Id: I6308cb05f8f199eed72189ace768013a46815941